@@ -917,6 +917,20 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
917
917
attDesc.format = formats[f];
918
918
stages[1 ].module = modules[MS2ARR];
919
919
920
+ // initialise to NULL
921
+ m_DepthMS2ArrayPipe[f] = NULL ;
922
+ for (size_t s = 0 ; s < ARRAY_COUNT (sampleCounts); s++)
923
+ m_DepthArray2MSPipe[f][s] = NULL ;
924
+
925
+ // if the format isn't supported at all, bail out and don't try to create anything
926
+ if (!(m_pDriver->GetFormatProperties (attDesc.format ).optimalTilingFeatures &
927
+ VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
928
+ {
929
+ RDCDEBUG (" Depth copies MSAA -> Array not supported for format %s" ,
930
+ ToStr::Get (attDesc.format ).c_str ());
931
+ continue ;
932
+ }
933
+
920
934
VkRenderPass rp;
921
935
922
936
vkr = m_pDriver->vkCreateRenderPass (dev, &rpinfo, NULL , &rp);
@@ -931,13 +945,22 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
931
945
m_pDriver->vkDestroyRenderPass (dev, rp, NULL );
932
946
933
947
stages[1 ].module = modules[ARR2MS];
948
+ msaa.sampleShadingEnable = true ;
949
+ msaa.minSampleShading = 1 .0f ;
934
950
935
951
for (size_t s = 0 ; s < ARRAY_COUNT (sampleCounts); s++)
936
952
{
937
953
attDesc.samples = sampleCounts[s];
938
954
msaa.rasterizationSamples = sampleCounts[s];
939
- msaa.sampleShadingEnable = true ;
940
- msaa.minSampleShading = 1 .0f ;
955
+
956
+ // if this sample count isn't supported, don't create it
957
+ if (!(m_pDriver->GetDeviceProps ().limits .framebufferDepthSampleCounts &
958
+ (uint32_t )attDesc.samples ))
959
+ {
960
+ RDCDEBUG (" Depth copies Array -> MSAA not supported for sample count %u on format %s" ,
961
+ attDesc.samples , ToStr::Get (attDesc.format ).c_str ());
962
+ continue ;
963
+ }
941
964
942
965
vkr = m_pDriver->vkCreateRenderPass (dev, &rpinfo, NULL , &rp);
943
966
RDCASSERTEQUAL (vkr, VK_SUCCESS);
@@ -949,12 +972,13 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
949
972
RDCASSERTEQUAL (vkr, VK_SUCCESS);
950
973
951
974
m_pDriver->vkDestroyRenderPass (dev, rp, NULL );
952
-
953
- attDesc.samples = VK_SAMPLE_COUNT_1_BIT;
954
- msaa.sampleShadingEnable = false ;
955
- msaa.minSampleShading = 0 .0f ;
956
- msaa.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
957
975
}
976
+
977
+ attDesc.samples = VK_SAMPLE_COUNT_1_BIT;
978
+ msaa.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
979
+
980
+ msaa.sampleShadingEnable = false ;
981
+ msaa.minSampleShading = 0 .0f ;
958
982
}
959
983
960
984
// restore pipeline state to normal
0 commit comments