mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-29 00:55:51 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user