Fixed blit crash with BackbufferRatio textures after window resize. Closes #3134. (#3741)

This commit is contained in:
Branimir Karadžić
2026-06-08 20:49:50 -07:00
committed by GitHub
parent 48edba7c10
commit 8e68f79eeb

View File

@@ -5402,12 +5402,17 @@ namespace bgfx
void resizeTexture(TextureHandle _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, uint16_t _numLayers)
{
const TextureRef& ref = m_textureRef[_handle.idx];
TextureRef& ref = m_textureRef[_handle.idx];
BX_ASSERT(BackbufferRatio::Count != ref.m_bbRatio, "");
getTextureSizeFromRatio(BackbufferRatio::Enum(ref.m_bbRatio), _width, _height);
_numMips = calcNumMips(1 < _numMips, _width, _height);
ref.m_width = _width;
ref.m_height = _height;
ref.m_numMips = _numMips;
ref.m_numLayers = _numLayers;
BX_TRACE("Resize %3d: %4dx%d %s"
, _handle.idx
, _width