Fix handling of S8 textures on vulkan. Closes #2428

This commit is contained in:
baldurk committed 2022-01-10 12:54:25 +00:00
1 parent 87bd7a4179
commit f1e81f69c5
3 files changed
+35 -5

No files matched your search

@@ -2633,14 +2633,33 @@ void VulkanPipelineStateViewer::setState()
QString slotname;
if(colIdx >= 0)
{
slotname = QFormatStr("Color %1").arg(colIdx);
}
else if(resIdx >= 0)
{
slotname = QFormatStr("Resolve %1").arg(resIdx);
}
else if(state.currentPass.renderpass.fragmentDensityAttachment == i)
{
slotname = lit("Fragment Density Map");
}
else
{
slotname = lit("Depth");
if(p.viewFormat.type == ResourceFormatType::D16S8 ||
p.viewFormat.type == ResourceFormatType::D24S8 ||
p.viewFormat.type == ResourceFormatType::D32S8)
{
slotname = lit("Depth/Stencil");
}
else if(p.viewFormat.type == ResourceFormatType::S8)
{
slotname = lit("Stencil");
}
}
if(state.fragmentShader.reflection != NULL)
{
for(int s = 0; s < state.fragmentShader.reflection->outputSignature.count(); s++)
+1
View File
@@ -1736,6 +1736,7 @@ ResourceFormat MakeResourceFormat(VkFormat fmt)
case VK_FORMAT_D16_UNORM_S8_UINT: ret.type = ResourceFormatType::D16S8; break;
case VK_FORMAT_D24_UNORM_S8_UINT: ret.type = ResourceFormatType::D24S8; break;
case VK_FORMAT_D32_SFLOAT_S8_UINT: ret.type = ResourceFormatType::D32S8; break;
case VK_FORMAT_S8_UINT: ret.type = ResourceFormatType::S8; break;
case VK_FORMAT_BC1_RGB_UNORM_BLOCK:
case VK_FORMAT_BC1_RGB_SRGB_BLOCK:
case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
@@ -2098,7 +2098,17 @@ bool WrappedVulkan::Serialise_vkCreateImage(SerialiserType &ser, VkDevice device
state->isMemoryBound = true;
}
const char *prefix = "Image";
rdcstr prefix = "Image";
rdcstr depth = "Depth";
if(CreateInfo.format == VK_FORMAT_S8_UINT)
{
depth = "Stencil";
}
else if(IsStencilFormat(CreateInfo.format))
{
depth = "Depth/Stencil";
}
if(CreateInfo.imageType == VK_IMAGE_TYPE_1D)
{
@@ -2107,7 +2117,7 @@ bool WrappedVulkan::Serialise_vkCreateImage(SerialiserType &ser, VkDevice device
if(CreateInfo.usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
prefix = "1D Color Attachment";
else if(CreateInfo.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
prefix = "1D Depth Attachment";
prefix = "1D " + depth + " Attachment";
}
else if(CreateInfo.imageType == VK_IMAGE_TYPE_2D)
{
@@ -2116,7 +2126,7 @@ bool WrappedVulkan::Serialise_vkCreateImage(SerialiserType &ser, VkDevice device
if(CreateInfo.usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
prefix = "2D Color Attachment";
else if(CreateInfo.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
prefix = "2D Depth Attachment";
prefix = "2D " + depth + " Attachment";
else if(CreateInfo.usage & VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT)
prefix = "2D Fragment Density Map Attachment";
}
@@ -2127,10 +2137,10 @@ bool WrappedVulkan::Serialise_vkCreateImage(SerialiserType &ser, VkDevice device
if(CreateInfo.usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
prefix = "3D Color Attachment";
else if(CreateInfo.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
prefix = "3D Depth Attachment";
prefix = "3D " + depth + " Attachment";
}
AddResource(Image, ResourceType::Texture, prefix);
AddResource(Image, ResourceType::Texture, prefix.c_str());
DerivedResource(device, Image);
}