Skip incompatible image formats when building discard pattern

If the pattern's dimensions are not an integer multiple of the format's block size, then do not attempt to create the discard pattern, just exit early.

Fixes 3466
This commit is contained in:
Cam Mannett
2024-11-05 14:03:22 +00:00
committed by Baldur Karlsson
parent 8b3ae8fd4d
commit 0e9322e610
+8 -1
View File
@@ -2381,9 +2381,16 @@ void VulkanDebugManager::FillWithDiscardPattern(VkCommandBuffer cmd, DiscardType
if(buf == VK_NULL_HANDLE)
{
GPUBuffer &stage = m_DiscardStage[key];
bytebuf pattern = GetDiscardPattern(key.second, MakeResourceFormat(key.first));
BlockShape shape = GetBlockShape(key.first, 0);
if((PatternBatchWidth % shape.width) != 0 || (PatternBatchHeight % shape.height) != 0)
{
RDCWARN("Skipping discard pattern for %s as block size is incompatible (%d * %d)",
ToStr(MakeResourceFormat(key.first).type).c_str(), shape.width, shape.height);
return;
}
bytebuf pattern = GetDiscardPattern(key.second, MakeResourceFormat(key.first));
if(key.first == VK_FORMAT_D32_SFLOAT_S8_UINT)
shape = {1, 1, 4};