From 2b49249a4dd3d85d3368719da32f06b035fd0156 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 12 Nov 2024 10:04:06 +0200 Subject: [PATCH] anv: remove 3DSTATE_RASTER from pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At a pipeline level, we only put fixed values in this instruction. Might has well put that in the final emission and avoid : - store the instruction on the anv_graphics_pipeline - diff the instructions between pipelines 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 | 14 ++++++++++++-- src/intel/vulkan/genX_pipeline.c | 14 -------------- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 1d5e6cef1c4..81b46ba3661 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(RASTER, partial.raster); diff_fix_state(MULTISAMPLE, partial.ms); diff_fix_state(WM, partial.wm); diff_fix_state(STREAMOUT, partial.so); diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index a21770941b6..5f125abf388 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 raster; struct anv_gfx_state_ptr ms; struct anv_gfx_state_ptr ps_extra; struct anv_gfx_state_ptr wm; diff --git a/src/intel/vulkan/genX_gfx_state.c b/src/intel/vulkan/genX_gfx_state.c index 3a513bc76d2..fa6750b13fc 100644 --- a/src/intel/vulkan/genX_gfx_state.c +++ b/src/intel/vulkan/genX_gfx_state.c @@ -2264,8 +2264,18 @@ cmd_buffer_gfx_state_emission(struct anv_cmd_buffer *cmd_buffer) } if (BITSET_TEST(hw_state->dirty, ANV_GFX_STATE_RASTER)) { - anv_batch_emit_merge(&cmd_buffer->batch, GENX(3DSTATE_RASTER), - pipeline, partial.raster, raster) { + anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_RASTER), raster) { + /* For details on 3DSTATE_RASTER multisample state, see the BSpec + * table "Multisample Modes State". + * + * NOTE: 3DSTATE_RASTER::ForcedSampleCount affects the SKL PMA fix + * computations. If we ever set this bit to a different value, they + * will need to be updated accordingly. + */ + raster.ForcedSampleCount = FSC_NUMRASTSAMPLES_0; + raster.ForceMultisampling = false; + raster.ScissorRectangleEnable = true; + SET(raster, raster, APIMode); SET(raster, raster, DXMultisampleRasterizationEnable); SET(raster, raster, AntialiasingEnable); diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index 83a4d913c43..1cf90ed997f 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -764,20 +764,6 @@ emit_rs_state(struct anv_graphics_pipeline *pipeline, sf.PointWidth = 1.0; } } - - anv_pipeline_emit(pipeline, partial.raster, GENX(3DSTATE_RASTER), raster) { - /* For details on 3DSTATE_RASTER multisample state, see the BSpec table - * "Multisample Modes State". - */ - /* NOTE: 3DSTATE_RASTER::ForcedSampleCount affects the BDW and SKL PMA fix - * computations. If we ever set this bit to a different value, they will - * need to be updated accordingly. - */ - raster.ForcedSampleCount = FSC_NUMRASTSAMPLES_0; - raster.ForceMultisampling = false; - - raster.ScissorRectangleEnable = true; - } } static void