V-EZ icon indicating copy to clipboard operation
V-EZ copied to clipboard

UncompressedImageSubData fails to update the correct Z/depth of a 3d texture [fixed]

Open EvilTrev opened this issue 1 year ago • 0 comments

Make the following change in Device.cpp to fix this, it is incorrectly ignoring the .z offset when deciding the current offset.

            // Each depth layer in a 3D texture is copied separately.
            for (auto z = 0U; z < pSubDataInfo->imageExtent.depth; z += maxExtent.depth)
            {
                // Set current destination image z offset.
                curOffset.z = pSubDataInfo->imageOffset.z + z;

Also whilst I'm at it, GetUncompressedImageFormatSize returns the wrong size for VK_FORMAT_R16G16_SFLOAT in VkHelpers.h. It should read:

            case VK_FORMAT_R16G16_SFLOAT: return 4;

EvilTrev avatar May 06 '23 08:05 EvilTrev