Commit c8d7f047 by Ian Elliott Committed by Commit Bot

Vulkan: Update number of samples when changing draw framebuffer

This fixes a crash (preceeded by Vulkan validation errors) when running the following test: --gtest_filter=dEQP.KHR_GLES31/core_texture_storage_multisample_FunctionalTests_blitting_multisampled_depth_attachment* --use-angle=vulkan The problem is that GraphicsPipelineDesc::updateRasterizationSamples() is rarely called (e.g. glBindFramebuffer). The above dEQP test changes between draw attachments that do and don't have multisampling enabled. The number of samples is set (the first time) to have multisampling enabled, and never changed, even though other attachments don't have multisampling. FramebufferVk::syncState() now calls updateRasterizationSamples(). That fix uncovered a latent problem: when an application destroys all framebuffers (including the draw framebuffer), the ContextVk still points at the old draw framebuffer's FramebufferVk (now freed). This is fixed with new plubming to clean-up ContextVk::mDrawFramebuffer. Bug: angleproject:4240 Change-Id: I151ec40ab821efc07c26323c34275c9165ad2ed5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1983393Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
parent 2c63b83c
......@@ -2734,6 +2734,12 @@ void ContextVk::onDrawFramebufferChange(FramebufferVk *framebufferVk)
// Ensure that the RenderPass description is updated.
invalidateCurrentGraphicsPipeline();
if (mGraphicsPipelineDesc->getRasterizationSamples() !=
static_cast<uint32_t>(framebufferVk->getSamples()))
{
mGraphicsPipelineDesc->updateRasterizationSamples(&mGraphicsPipelineTransition,
framebufferVk->getSamples());
}
mGraphicsPipelineDesc->updateRenderPassDesc(&mGraphicsPipelineTransition, renderPassDesc);
}
......
......@@ -990,6 +990,11 @@ void GraphicsPipelineDesc::updateRasterizerDiscardEnabled(
transition->set(ANGLE_GET_TRANSITION_BIT(mRasterizationAndMultisampleStateInfo, bits));
}
uint32_t GraphicsPipelineDesc::getRasterizationSamples() const
{
return mRasterizationAndMultisampleStateInfo.bits.rasterizationSamples;
}
void GraphicsPipelineDesc::setRasterizationSamples(uint32_t rasterizationSamples)
{
mRasterizationAndMultisampleStateInfo.bits.rasterizationSamples = rasterizationSamples;
......
......@@ -390,6 +390,7 @@ class GraphicsPipelineDesc final
bool rasterizerDiscardEnabled);
// Multisample states
uint32_t getRasterizationSamples() const;
void setRasterizationSamples(uint32_t rasterizationSamples);
void updateRasterizationSamples(GraphicsPipelineTransitionBits *transition,
uint32_t rasterizationSamples);
......
......@@ -53,7 +53,10 @@
4194 VULKAN PIXEL2ORXL : KHR-GLES31.core.compute_shader.built-in-variables = FAIL
// Multisampled textures:
3565 VULKAN : KHR-GLES31.core.texture_storage_multisample.* = SKIP
3565 VULKAN : KHR-GLES31.core.texture_storage_multisample.FunctionalTests.verify_sample_masking_for_non_integer_color_renderable_internalformats = FAIL
3565 SWIFTSHADER : KHR-GLES31.core.texture_storage_multisample.APIDependencies.fbo_with_renderbuffer_and_multisample_texture_attachments_with_different_number_of_samples = FAIL
// --gtest_filter=dEQP.KHR_GLES31/core_texture_storage_multisample_FunctionalTests_verify_sample_masking_for_non_integer_color_renderable_internalformats* --use-angle=swiftshader
3565 SWIFTSHADER : KHR-GLES31.core.texture_storage_multisample.APIDependencies.no_error_generated_for_valid_renderbuffer_storage_multisample_calls = FAIL
// Program Pipeline Objects:
3570 VULKAN : KHR-GLES31.core.shader_atomic_counters.advanced-usage-many-draw-calls2 = FAIL
......
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