Enable shaderStorageImageMultisample at capture time for MSAA stores

* We need this to be able to add STORAGE_BIT to the image even if we don't do
  MSAA stores at capture time
This commit is contained in:
baldurk
2021-04-12 17:49:36 +01:00
parent e037795a85
commit b9f9874c06
2 changed files with 11 additions and 1 deletions
@@ -32,7 +32,8 @@
void VulkanDebugManager::CopyTex2DMSToArray(VkImage destArray, VkImage srcMS, VkExtent3D extent,
uint32_t layers, uint32_t samples, VkFormat fmt)
{
if(!m_pDriver->GetDeviceEnabledFeatures().shaderStorageImageWriteWithoutFormat)
if(!m_pDriver->GetDeviceEnabledFeatures().shaderStorageImageWriteWithoutFormat ||
!m_pDriver->GetDeviceEnabledFeatures().shaderStorageImageMultisample)
return;
if(m_MS2ArrayPipe == VK_NULL_HANDLE)
@@ -3559,6 +3559,15 @@ VkResult WrappedVulkan::vkCreateDevice(VkPhysicalDevice physicalDevice,
"shaderStorageImageWriteWithoutFormat = false, multisampled textures will have empty "
"contents at frame start.");
// even though we don't actually do any multisampled stores, this is needed to be able to create
// MSAA images with STORAGE_BIT usage
if(availFeatures.shaderStorageImageMultisample)
enabledFeatures.shaderStorageImageMultisample = true;
else
RDCWARN(
"shaderStorageImageMultisample = false, multisampled textures will have empty "
"contents at frame start.");
// patch the enabled features
if(enabledFeatures2)
enabledFeatures2->features = enabledFeatures;