diff --git a/.pick_status.json b/.pick_status.json index 3acabd22d7f..bc8927e2283 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -373,7 +373,7 @@ "description": "anv: disable baked in pipeline bits from dynamic emission path", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "4ad4cd89069bfc98533182d2ae9151fa74fb5414" }, diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index a8b30274c91..654611f8a12 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -2080,6 +2080,11 @@ copy_non_dynamic_state(struct anv_graphics_pipeline *pipeline, } pipeline->dynamic_state_mask = states; + + /* For now that only state that can be either dynamic or baked in the + * pipeline is the sample location. + */ + pipeline->static_state_mask = states & ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS; } static void diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 44ce29127f8..86a31bd552c 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -3339,7 +3339,17 @@ struct anv_graphics_pipeline { uint32_t batch_data[512]; + /* States that are part of batch_data and should be not emitted + * dynamically. + */ + anv_cmd_dirty_mask_t static_state_mask; + + /* States that need to be reemitted in cmd_buffer_flush_dynamic_state(). + * This might cover more than the dynamic states specified at pipeline + * creation. + */ anv_cmd_dirty_mask_t dynamic_state_mask; + struct anv_dynamic_state dynamic_state; uint32_t topology; diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 4a0d8b85f0e..11cde846a21 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -3565,6 +3565,11 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer) if (cmd_buffer->state.gfx.dirty & ANV_CMD_DIRTY_PIPELINE) { anv_batch_emit_batch(&cmd_buffer->batch, &pipeline->base.batch); + /* Remove from dynamic state emission all of stuff that is baked into + * the pipeline. + */ + cmd_buffer->state.gfx.dirty &= ~pipeline->static_state_mask; + /* If the pipeline changed, we may need to re-allocate push constant * space in the URB. */