mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 13:00:32 +00:00
Check format/sample support for creating MSAA <-> Array renderpasses
This commit is contained in:
@@ -917,6 +917,20 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
attDesc.format = formats[f];
|
||||
stages[1].module = modules[MS2ARR];
|
||||
|
||||
// initialise to NULL
|
||||
m_DepthMS2ArrayPipe[f] = NULL;
|
||||
for(size_t s = 0; s < ARRAY_COUNT(sampleCounts); s++)
|
||||
m_DepthArray2MSPipe[f][s] = NULL;
|
||||
|
||||
// if the format isn't supported at all, bail out and don't try to create anything
|
||||
if(!(m_pDriver->GetFormatProperties(attDesc.format).optimalTilingFeatures &
|
||||
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
|
||||
{
|
||||
RDCDEBUG("Depth copies MSAA -> Array not supported for format %s",
|
||||
ToStr::Get(attDesc.format).c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
VkRenderPass rp;
|
||||
|
||||
vkr = m_pDriver->vkCreateRenderPass(dev, &rpinfo, NULL, &rp);
|
||||
@@ -931,13 +945,22 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
m_pDriver->vkDestroyRenderPass(dev, rp, NULL);
|
||||
|
||||
stages[1].module = modules[ARR2MS];
|
||||
msaa.sampleShadingEnable = true;
|
||||
msaa.minSampleShading = 1.0f;
|
||||
|
||||
for(size_t s = 0; s < ARRAY_COUNT(sampleCounts); s++)
|
||||
{
|
||||
attDesc.samples = sampleCounts[s];
|
||||
msaa.rasterizationSamples = sampleCounts[s];
|
||||
msaa.sampleShadingEnable = true;
|
||||
msaa.minSampleShading = 1.0f;
|
||||
|
||||
// if this sample count isn't supported, don't create it
|
||||
if(!(m_pDriver->GetDeviceProps().limits.framebufferDepthSampleCounts &
|
||||
(uint32_t)attDesc.samples))
|
||||
{
|
||||
RDCDEBUG("Depth copies Array -> MSAA not supported for sample count %u on format %s",
|
||||
attDesc.samples, ToStr::Get(attDesc.format).c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
vkr = m_pDriver->vkCreateRenderPass(dev, &rpinfo, NULL, &rp);
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
@@ -949,12 +972,13 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
m_pDriver->vkDestroyRenderPass(dev, rp, NULL);
|
||||
|
||||
attDesc.samples = VK_SAMPLE_COUNT_1_BIT;
|
||||
msaa.sampleShadingEnable = false;
|
||||
msaa.minSampleShading = 0.0f;
|
||||
msaa.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
|
||||
}
|
||||
|
||||
attDesc.samples = VK_SAMPLE_COUNT_1_BIT;
|
||||
msaa.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
|
||||
|
||||
msaa.sampleShadingEnable = false;
|
||||
msaa.minSampleShading = 0.0f;
|
||||
}
|
||||
|
||||
// restore pipeline state to normal
|
||||
|
||||
@@ -1472,6 +1472,11 @@ VkResult WrappedVulkan::vkCreateDevice(VkPhysicalDevice physicalDevice,
|
||||
ObjDisp(physicalDevice)
|
||||
->GetPhysicalDeviceFeatures(Unwrap(physicalDevice), &m_PhysicalDeviceData.features);
|
||||
|
||||
for(int i = VK_FORMAT_BEGIN_RANGE + 1; i < VK_FORMAT_END_RANGE; i++)
|
||||
ObjDisp(physicalDevice)
|
||||
->GetPhysicalDeviceFormatProperties(Unwrap(physicalDevice), VkFormat(i),
|
||||
&m_PhysicalDeviceData.fmtprops[i]);
|
||||
|
||||
m_PhysicalDeviceData.readbackMemIndex =
|
||||
m_PhysicalDeviceData.GetMemoryIndex(~0U, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, 0);
|
||||
m_PhysicalDeviceData.uploadMemIndex =
|
||||
|
||||
Reference in New Issue
Block a user