Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mours <pmours@nvidia.com>2022-06-01 16:26:55 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-06-03 19:56:30 +0300
commit34f94a02f37005210f629f04635c457d98ff5f91 (patch)
tree4339231acf82070c1e8c6f1c71f52640eb069dd8 /intern/cycles/hydra/display_driver.h
parent7f7ed8e0989d3c6a3078404567e7da419d6f92f5 (diff)
Fix use of OpenGL interop breaking in Hydra viewports that do not support it
Rendering directly to a resource using OpenGL interop and Hgi doesn't work in Houdini, since it never uses the resulting resource (it does not call `HdRenderBuffer::GetResource`). But since doing that simultaneously disables mapping (`HdRenderBuffer::Map` is not implemented then), nothing was displayed. To fix this, keep track of whether a Hydra viewport does support displaying a Hgi resource directly, by checking whether `HdRenderBuffer::GetResource` is ever called and only enable use of OpenGL interop if that is the case. Differential Revision: https://developer.blender.org/D15090
Diffstat (limited to 'intern/cycles/hydra/display_driver.h')
-rw-r--r--intern/cycles/hydra/display_driver.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/intern/cycles/hydra/display_driver.h b/intern/cycles/hydra/display_driver.h
index 20086830e6a..2a05397c325 100644
--- a/intern/cycles/hydra/display_driver.h
+++ b/intern/cycles/hydra/display_driver.h
@@ -19,9 +19,6 @@ class HdCyclesDisplayDriver final : public CCL_NS::DisplayDriver {
~HdCyclesDisplayDriver();
private:
- void init();
- void deinit();
-
void next_tile_begin() override;
bool update_begin(const Params &params, int texture_width, int texture_height) override;
@@ -41,6 +38,11 @@ class HdCyclesDisplayDriver final : public CCL_NS::DisplayDriver {
void draw(const Params &params) override;
+ void gl_context_create();
+ bool gl_context_enable();
+ void gl_context_disable();
+ void gl_context_dispose();
+
HdCyclesSession *const _renderParam;
Hgi *const _hgi;
@@ -48,7 +50,6 @@ class HdCyclesDisplayDriver final : public CCL_NS::DisplayDriver {
void *hdc_ = nullptr;
void *gl_context_ = nullptr;
#endif
-
CCL_NS::thread_mutex mutex_;
PXR_NS::HgiTextureHandle texture_;