Vulkan: Correct size for tex mip level readback.

Used by the GE debugger to display the texture levels.
This commit is contained in:
Unknown W. Brackets committed 2022-05-01 15:23:57 -07:00
1 parent 1dead5f095
commit 42d7226413
1 file changed
+7
+7
View File
@@ -1088,6 +1088,13 @@ bool TextureCacheVulkan::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int leve
int w = texture->GetWidth();
int h = texture->GetHeight();
if (level > 0) {
// In the future, maybe this could do something for 3D textures...
if (level >= texture->GetNumMips())
return false;
w >>= level;
h >>= level;
}
buffer.Allocate(w, h, bufferFormat);
renderManager->CopyImageToMemorySync(texture->GetImage(), level, 0, 0, w, h, drawFormat, (uint8_t *)buffer.GetData(), w, "GetCurrentTextureDebug");