24 #ifndef PXR_IMAGING_HD_RENDER_THREAD_H 25 #define PXR_IMAGING_HD_RENDER_THREAD_H 28 #include "pxr/imaging/hd/api.h" 31 #include <condition_variable> 36 PXR_NAMESPACE_OPEN_SCOPE
290 std::function<void()> _renderCallback;
295 std::function<void()> _shutdownCallback;
298 static void _DefaultRenderCallback();
301 static void _DefaultShutdownCallback();
325 State _requestedState;
326 std::mutex _requestedStateMutex;
327 std::condition_variable _requestedStateCV;
334 std::atomic_flag _enableRender;
343 std::atomic<bool> _pauseRender;
348 std::atomic<bool> _pauseDirty;
354 std::atomic<bool> _rendering;
357 std::thread _renderThread;
362 std::mutex _frameBufferMutex;
366 PXR_NAMESPACE_CLOSE_SCOPE
368 #endif // PXR_IMAGING_HD_RENDER_THREAD_H HD_API std::unique_lock< std::mutex > LockFramebuffer()
Return a scoped lock on the render delegate's framebuffer.
HD_API bool IsThreadRunning()
Check whether the background thread is running (i.e.
HD_API void SetRenderCallback(std::function< void()> renderCallback)
Set the rendering callback for the render thread to use.
HD_API void StartThread()
Start 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 IsStopRequested()
Query whether hydra has asked to interrupt the current frame since the last time StartRender() was ca...
HD_API void StopThread()
Stop the rendering background thread.
HD_API void ResumeRender()
Ask the render thread to resume rendering.
HD_API void PauseRender()
Ask the render thread to pause rendering.
HD_API void SetShutdownCallback(std::function< void()> shutdownCallback)
Set the shutdown callback for the render thread to use.
HD_API bool IsRendering()
Query whether the render thread is currently rendering.
HD_API bool IsPauseRequested()
Query whether hydra has asked to pause rendering.
HD_API void StopRender()
Ask the render thread to stop rendering, and block until the render thread is idle.
HdRenderThread is a utility that specific render delegates can choose to use depending on their needs...