From ce40a1e05bf039dc7ce9dbcf62eb930a19d266ed Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 19 Nov 2024 16:44:22 +0200 Subject: [PATCH] anv: remove 3DSTATE_MULTISAMPLE from the pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can make this completely dynamic, there is no information from the pipeline. Signed-off-by: Lionel Landwerlin Reviewed-by: Tapani Pälli Reviewed-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_cmd_buffer.c | 1 - src/intel/vulkan/anv_private.h | 1 - src/intel/vulkan/genX_gfx_state.c | 12 ++++++++++-- src/intel/vulkan/genX_pipeline.c | 17 ----------------- 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 81b46ba3661..780bb20aa21 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -562,7 +562,6 @@ anv_cmd_buffer_flush_pipeline_state(struct anv_cmd_buffer *cmd_buffer, diff_fix_state(CLIP, partial.clip); diff_fix_state(SF, partial.sf); - diff_fix_state(MULTISAMPLE, partial.ms); diff_fix_state(WM, partial.wm); diff_fix_state(STREAMOUT, partial.so); diff_fix_state(GS, partial.gs); diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 5f125abf388..602e319255a 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -4891,7 +4891,6 @@ struct anv_graphics_pipeline { struct { struct anv_gfx_state_ptr clip; struct anv_gfx_state_ptr sf; - struct anv_gfx_state_ptr ms; struct anv_gfx_state_ptr ps_extra; struct anv_gfx_state_ptr wm; struct anv_gfx_state_ptr so; diff --git a/src/intel/vulkan/genX_gfx_state.c b/src/intel/vulkan/genX_gfx_state.c index fa6750b13fc..ff5fbc1d0f9 100644 --- a/src/intel/vulkan/genX_gfx_state.c +++ b/src/intel/vulkan/genX_gfx_state.c @@ -2296,8 +2296,16 @@ cmd_buffer_gfx_state_emission(struct anv_cmd_buffer *cmd_buffer) } if (BITSET_TEST(hw_state->dirty, ANV_GFX_STATE_MULTISAMPLE)) { - anv_batch_emit_merge(&cmd_buffer->batch, GENX(3DSTATE_MULTISAMPLE), - pipeline, partial.ms, ms) { + anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_MULTISAMPLE), ms) { + ms.PixelLocation = CENTER; + + /* The PRM says that this bit is valid only for DX9: + * + * SW can choose to set this bit only for DX9 API. DX10/OGL API's + * should not have any effect by setting or not setting this bit. + */ + ms.PixelPositionOffsetEnable = false; + SET(ms, ms, NumberofMultisamples); } } diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index 1cf90ed997f..39c0475446e 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -766,22 +766,6 @@ emit_rs_state(struct anv_graphics_pipeline *pipeline, } } -static void -emit_ms_state(struct anv_graphics_pipeline *pipeline, - const struct vk_multisample_state *ms) -{ - anv_pipeline_emit(pipeline, partial.ms, GENX(3DSTATE_MULTISAMPLE), ms) { - ms.PixelLocation = CENTER; - - /* The PRM says that this bit is valid only for DX9: - * - * SW can choose to set this bit only for DX9 API. DX10/OGL API's - * should not have any effect by setting or not setting this bit. - */ - ms.PixelPositionOffsetEnable = false; - } -} - static void emit_3dstate_clip(struct anv_graphics_pipeline *pipeline, const struct vk_input_assembly_state *ia, @@ -1859,7 +1843,6 @@ genX(graphics_pipeline_emit)(struct anv_graphics_pipeline *pipeline, emit_rs_state(pipeline, state->ia, state->rs, state->ms, state->rp, urb_deref_block_size); - emit_ms_state(pipeline, state->ms); compute_kill_pixel(pipeline, state->ms, state); emit_3dstate_clip(pipeline, state->ia, state->vp, state->rs);