7#ifndef PXR_IMAGING_HD_RENDER_THREAD_H
8#define PXR_IMAGING_HD_RENDER_THREAD_H
11#include "pxr/imaging/hd/api.h"
14#include <condition_variable>
19PXR_NAMESPACE_OPEN_SCOPE
273 std::function<void()> _renderCallback;
278 std::function<void()> _shutdownCallback;
281 static void _DefaultRenderCallback();
284 static void _DefaultShutdownCallback();
308 State _requestedState;
309 std::mutex _requestedStateMutex;
310 std::condition_variable _requestedStateCV;
317 std::atomic_flag _enableRender;
326 std::atomic<bool> _pauseRender;
331 std::atomic<bool> _pauseDirty;
337 std::atomic<bool> _rendering;
340 std::thread _renderThread;
345 std::mutex _frameBufferMutex;
349PXR_NAMESPACE_CLOSE_SCOPE
HdRenderThread is a utility that specific render delegates can choose to use depending on their needs...
HD_API void StopThread()
Stop the rendering background thread.
HD_API void StartRender()
Ask the render thread to start rendering.
HD_API bool IsPauseDirty()
Query whether the pause/resume state has changed since the last time we called IsPauseDirty.
HD_API bool IsPauseRequested()
Query whether hydra has asked to pause rendering.
HD_API bool IsThreadRunning()
Check whether the background thread is running (i.e.
HD_API void SetShutdownCallback(std::function< void()> shutdownCallback)
Set the shutdown callback for the render thread to use.
HD_API void StartThread()
Start the rendering background thread.
HD_API std::unique_lock< std::mutex > LockFramebuffer()
Return a scoped lock on the render delegate's framebuffer.
HD_API void PauseRender()
Ask the render thread to pause rendering.
HD_API bool IsRendering()
Query whether the render thread is currently rendering.
HD_API void SetRenderCallback(std::function< void()> renderCallback)
Set the rendering callback for the render thread to use.
HD_API bool IsStopRequested()
Query whether hydra has asked to interrupt the current frame since the last time StartRender() was ca...
HD_API void ResumeRender()
Ask the render thread to resume rendering.
HD_API void StopRender()
Ask the render thread to stop rendering, and block until the render thread is idle.