From 0f372f3966c434da5faa8e221f9da2aa48999a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sat, 29 Aug 2020 14:03:15 +0200 Subject: GPUContext: Update internal framebuffer size when activating context This is to ensure the FrameBuffer extents are always up to date. --- source/blender/gpu/intern/gpu_context_private.hh | 2 ++ source/blender/gpu/intern/gpu_framebuffer_private.hh | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'source/blender/gpu/intern') diff --git a/source/blender/gpu/intern/gpu_context_private.hh b/source/blender/gpu/intern/gpu_context_private.hh index 0374df9bbc5..04b347d1bff 100644 --- a/source/blender/gpu/intern/gpu_context_private.hh +++ b/source/blender/gpu/intern/gpu_context_private.hh @@ -65,6 +65,8 @@ struct GPUContext { /** Thread on which this context is active. */ pthread_t thread_; bool is_active_; + /** Avoid including GHOST headers. Can be NULL for offscreen contexts. */ + void *ghost_window_; public: GPUContext(); diff --git a/source/blender/gpu/intern/gpu_framebuffer_private.hh b/source/blender/gpu/intern/gpu_framebuffer_private.hh index 93551b0ef8b..a34fe38a267 100644 --- a/source/blender/gpu/intern/gpu_framebuffer_private.hh +++ b/source/blender/gpu/intern/gpu_framebuffer_private.hh @@ -130,6 +130,12 @@ class FrameBuffer { void (*callback)(void *userData, int level), void *userData); + inline void size_set(int width, int height) + { + width_ = width; + height_ = height; + } + inline GPUTexture *depth_tex(void) const { if (attachments_[GPU_FB_DEPTH_ATTACHMENT].tex) { -- cgit v1.2.3