From 7114490115f1f1c95b647a0c400274f6f886ebf5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 8 Mar 2022 10:59:32 -0500 Subject: [PATCH] lavapipe: update multisample state after blend state null blend pipeline state will zero the blend struct, which would cause values set here to be overwritten cc: mesa-stable Reviewed-by: Dave Airlie Part-of: --- src/gallium/frontends/lavapipe/lvp_execute.c | 68 ++++++++++++++-------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index c88e93c..e7d0dc7 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -603,40 +603,6 @@ static void handle_graphics_pipeline(struct vk_cmd_queue_entry *cmd, state->rs_dirty = true; } - state->disable_multisample = pipeline->disable_multisample; - if (pipeline->graphics_create_info.pMultisampleState) { - const VkPipelineMultisampleStateCreateInfo *ms = pipeline->graphics_create_info.pMultisampleState; - state->rs_state.multisample = ms->rasterizationSamples > 1; - state->sample_mask = ms->pSampleMask ? ms->pSampleMask[0] : 0xffffffff; - state->blend_state.alpha_to_coverage = ms->alphaToCoverageEnable; - state->blend_state.alpha_to_one = ms->alphaToOneEnable; - state->blend_dirty = true; - state->rs_dirty = true; - state->min_samples = 1; - state->sample_mask_dirty = true; - fb_samples = ms->rasterizationSamples; - if (ms->sampleShadingEnable) { - state->min_samples = ceil(ms->rasterizationSamples * ms->minSampleShading); - if (state->min_samples > 1) - state->min_samples = ms->rasterizationSamples; - if (state->min_samples < 1) - state->min_samples = 1; - } - if (pipeline->force_min_sample) - state->min_samples = ms->rasterizationSamples; - state->min_samples_dirty = true; - } else { - state->rs_state.multisample = false; - state->sample_mask_dirty = state->sample_mask != 0xffffffff; - state->sample_mask = 0xffffffff; - state->min_samples_dirty = state->min_samples; - state->min_samples = 0; - state->blend_dirty |= state->blend_state.alpha_to_coverage || state->blend_state.alpha_to_one; - state->blend_state.alpha_to_coverage = false; - state->blend_state.alpha_to_one = false; - state->rs_dirty = true; - } - if (pipeline->graphics_create_info.pDepthStencilState) { const VkPipelineDepthStencilStateCreateInfo *dsa = pipeline->graphics_create_info.pDepthStencilState; @@ -740,6 +706,40 @@ static void handle_graphics_pipeline(struct vk_cmd_queue_entry *cmd, state->blend_dirty = true; } + state->disable_multisample = pipeline->disable_multisample; + if (pipeline->graphics_create_info.pMultisampleState) { + const VkPipelineMultisampleStateCreateInfo *ms = pipeline->graphics_create_info.pMultisampleState; + state->rs_state.multisample = ms->rasterizationSamples > 1; + state->sample_mask = ms->pSampleMask ? ms->pSampleMask[0] : 0xffffffff; + state->blend_state.alpha_to_coverage = ms->alphaToCoverageEnable; + state->blend_state.alpha_to_one = ms->alphaToOneEnable; + state->blend_dirty = true; + state->rs_dirty = true; + state->min_samples = 1; + state->sample_mask_dirty = true; + fb_samples = ms->rasterizationSamples; + if (ms->sampleShadingEnable) { + state->min_samples = ceil(ms->rasterizationSamples * ms->minSampleShading); + if (state->min_samples > 1) + state->min_samples = ms->rasterizationSamples; + if (state->min_samples < 1) + state->min_samples = 1; + } + if (pipeline->force_min_sample) + state->min_samples = ms->rasterizationSamples; + state->min_samples_dirty = true; + } else { + state->rs_state.multisample = false; + state->sample_mask_dirty = state->sample_mask != 0xffffffff; + state->sample_mask = 0xffffffff; + state->min_samples_dirty = state->min_samples; + state->min_samples = 0; + state->blend_dirty |= state->blend_state.alpha_to_coverage || state->blend_state.alpha_to_one; + state->blend_state.alpha_to_coverage = false; + state->blend_state.alpha_to_one = false; + state->rs_dirty = true; + } + if (!dynamic_states[conv_dynamic_state_idx(VK_DYNAMIC_STATE_VERTEX_INPUT_EXT)]) { const VkPipelineVertexInputStateCreateInfo *vi = pipeline->graphics_create_info.pVertexInputState; int i; -- 2.7.4