Fix calculation of remapped 3D mips in image viewer. Closes #3697

* For OpenGL we need to remap a 3D block-compressed texture to a 2D array for
  display, when doing so we need to account for the mip size when calculating
  the size of each chunk of data.
This commit is contained in:
baldurk
2025-09-08 16:35:40 +01:00
parent 2702bb1469
commit ce4edad163
+1 -1
View File
@@ -1055,7 +1055,7 @@ void ImageViewer::CreateProxyTexture(TextureDescription &texDetails, read_tex_da
const uint32_t slice = i / texDetails.mips;
// size of each subresource is 1/Nth for an N-sized array
size_t size = oldSubs[mip].second / texDetails.arraysize;
size_t size = oldSubs[mip].second / RDCMAX(1U, texDetails.arraysize >> mip);
// and the offset is slice steps further on
size_t offset = oldSubs[mip].first + size * slice;