diff --git a/src/bgfx_p.h b/src/bgfx_p.h index d49209a5a..e875f4818 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -2985,6 +2985,17 @@ namespace bgfx BGFX_API_FUNC(void reset(uint32_t _width, uint32_t _height, uint32_t _flags, TextureFormat::Enum _format) ) { + const TextureFormat::Enum format = TextureFormat::Count != _format ? _format : m_init.resolution.format; + + if (m_init.resolution.format == format + && m_init.resolution.width == _width + && m_init.resolution.height == _height + && m_init.resolution.reset == _flags) + { + // Nothing changed, ignore request. + return; + } + BX_WARN(g_caps.limits.maxTextureSize >= _width && g_caps.limits.maxTextureSize >= _height , "Frame buffer resolution width or height can't be larger than limits.maxTextureSize %d (width %d, height %d)." @@ -2992,7 +3003,7 @@ namespace bgfx , _width , _height ); - m_init.resolution.format = TextureFormat::Count != _format ? _format : m_init.resolution.format; + m_init.resolution.format = format; m_init.resolution.width = bx::clamp(_width, 1u, g_caps.limits.maxTextureSize); m_init.resolution.height = bx::clamp(_height, 1u, g_caps.limits.maxTextureSize); m_init.resolution.reset = 0