Commit cd4a63f5 by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Fix ASSERT in CreateRenderPass2

RenderPass2 was used for when a depth/stencil attachment is needed, or the VK_EXT_multisampled_render_to_single_sampled extension. The logic that decided this was "has D/S resolve || has MSRTSS extension", but the function itself asserted that the render pass is using MSRTSS if not D/S resolve. This caused an assertion failure on platforms where MSRTSS is present, but a non-MSRTSS render pass is used. Bug: chromium:1201455 Change-Id: Iefd26a071303c703a322d946f82474f85f5bf767 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2849180Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 1bdd34ff
...@@ -752,8 +752,12 @@ angle::Result CreateRenderPass2(Context *context, ...@@ -752,8 +752,12 @@ angle::Result CreateRenderPass2(Context *context,
} }
else else
{ {
RendererVk *renderer = context->getRenderer();
ASSERT(isRenderToTexture); ASSERT(isRenderToTexture);
ASSERT(renderer->getFeatures().supportsMultisampledRenderToSingleSampled.enabled);
ASSERT(subpassDescriptions.size() == 1); ASSERT(subpassDescriptions.size() == 1);
subpassDescriptions.back().pNext = &renderToTextureInfo; subpassDescriptions.back().pNext = &renderToTextureInfo;
} }
...@@ -1197,13 +1201,10 @@ angle::Result InitializeRenderPassFromDesc(ContextVk *contextVk, ...@@ -1197,13 +1201,10 @@ angle::Result InitializeRenderPassFromDesc(ContextVk *contextVk,
createInfo.pDependencies = subpassDependencies.data(); createInfo.pDependencies = subpassDependencies.data();
} }
const bool hasRenderToTextureEXT =
renderer->getFeatures().supportsMultisampledRenderToSingleSampled.enabled;
// If depth/stencil resolve is used, we need to create the render pass with // If depth/stencil resolve is used, we need to create the render pass with
// vkCreateRenderPass2KHR. Same when using the VK_EXT_multisampled_render_to_single_sampled // vkCreateRenderPass2KHR. Same when using the VK_EXT_multisampled_render_to_single_sampled
// extension. // extension.
if (depthStencilResolve.pDepthStencilResolveAttachment != nullptr || hasRenderToTextureEXT) if (depthStencilResolve.pDepthStencilResolveAttachment != nullptr || desc.isRenderToTexture())
{ {
ANGLE_TRY(CreateRenderPass2(contextVk, createInfo, depthStencilResolve, ANGLE_TRY(CreateRenderPass2(contextVk, createInfo, depthStencilResolve,
desc.hasDepthUnresolveAttachment(), desc.hasDepthUnresolveAttachment(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment