Skip to content

Commit 7599264

Browse files
committed
Don't add STORAGE_BIT to MSAA textures unless it's supported
* Now that we've decoupled MS->Array and Array->MS we might have the former even if the latter is unsupported.
1 parent 5ba3026 commit 7599264

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

renderdoc/driver/vulkan/vk_debug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class VulkanDebugManager
6161
void GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, bytebuf &ret);
6262

6363
bool IsMS2ArraySupported() { return m_MS2ArrayPipe != VK_NULL_HANDLE; }
64+
bool IsArray2MSSupported() { return m_Array2MSPipe != VK_NULL_HANDLE; }
6465
void CopyTex2DMSToArray(VkImage destArray, VkImage srcMS, VkExtent3D extent, uint32_t layers,
6566
uint32_t samples, VkFormat fmt);
6667
void CopyArrayToTex2DMS(VkImage destMS, VkImage srcArray, VkExtent3D extent, uint32_t layers,

renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,11 +1497,11 @@ bool WrappedVulkan::Serialise_vkCreateImage(SerialiserType &ser, VkDevice device
14971497
// to take a slower path that uses drawing
14981498
if(!IsDepthOrStencilFormat(CreateInfo.format))
14991499
{
1500-
// only add STORAGE_BIT if we have an MS2Array pipeline. If it failed to create due to lack
1500+
// only add STORAGE_BIT if we have an Array2MS pipeline. If it failed to create due to lack
15011501
// of capability or because we disabled it as a workaround then we don't need this
15021502
// capability (and it might be the bug we're trying to work around by disabling the
15031503
// pipeline)
1504-
if(GetDebugManager()->IsMS2ArraySupported())
1504+
if(GetDebugManager()->IsArray2MSSupported())
15051505
CreateInfo.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
15061506
}
15071507
else
@@ -1650,7 +1650,7 @@ VkResult WrappedVulkan::vkCreateImage(VkDevice device, const VkImageCreateInfo *
16501650
{
16511651
// need to check the debug manager here since we might be creating this internal image from
16521652
// its constructor
1653-
if(GetDebugManager() && GetDebugManager()->IsMS2ArraySupported())
1653+
if(GetDebugManager() && GetDebugManager()->IsArray2MSSupported())
16541654
createInfo_adjusted.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
16551655
}
16561656
else

0 commit comments

Comments
 (0)