From fa1b656961feb0b0323ea46898eed7c450178813 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 9 Apr 2017 22:14:20 +0200 Subject: [PATCH] glgsg: fix get_host() of GL FBO. Fixes LP 1672560 shadow bug --- panda/src/glstuff/glGraphicsBuffer_src.cxx | 10 ++++++++++ panda/src/glstuff/glGraphicsBuffer_src.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index a4daaf3931..e76f8fccb9 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -1501,6 +1501,16 @@ open_buffer() { return true; } +/** + * This is normally called only from within make_texture_buffer(). When + * called on a ParasiteBuffer, it returns the host of that buffer; but when + * called on some other buffer, it returns the buffer itself. + */ +GraphicsOutput *CLP(GraphicsBuffer):: +get_host() { + return _host; +} + /** * Closes the buffer right now. Called from the window thread. */ diff --git a/panda/src/glstuff/glGraphicsBuffer_src.h b/panda/src/glstuff/glGraphicsBuffer_src.h index 9f99850a7f..d119148247 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.h +++ b/panda/src/glstuff/glGraphicsBuffer_src.h @@ -77,6 +77,8 @@ public: void unregister_shared_depth_buffer(GraphicsOutput *graphics_output); protected: + virtual GraphicsOutput *get_host(); + virtual void close_buffer(); virtual bool open_buffer();