summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/src/renderer_d3d9.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/src/renderer_d3d9.h')
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/3rdparty/bgfx/src/renderer_d3d9.h b/3rdparty/bgfx/src/renderer_d3d9.h
index 84bb83f1399..dc5f234b7c3 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.h
+++ b/3rdparty/bgfx/src/renderer_d3d9.h
@@ -323,11 +323,21 @@ namespace bgfx { namespace d3d9
void create(const Memory* _mem, uint32_t _flags, uint8_t _skip);
- void destroy()
+ void destroy(bool _resize = false)
{
if (0 == (m_flags & BGFX_TEXTURE_INTERNAL_SHARED) )
{
- DX_RELEASE(m_ptr, 0);
+ if (_resize)
+ {
+ // BK - at the time of resize there might be one reference held by frame buffer
+ // surface. This frame buffer will be recreated later, and release reference
+ // to existing surface. That's why here we don't care about ref count.
+ m_ptr->Release();
+ }
+ else
+ {
+ DX_RELEASE(m_ptr, 0);
+ }
}
DX_RELEASE(m_surface, 0);
DX_RELEASE(m_staging, 0);