mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
anv/cmd_buffer: Re-emit MEDIA_CURBE_LOAD when CS push constants are dirty
This can happen even if the binding table isn't changed. For instance, you could have dynamic offsets with your descriptor set. This fixes the new stress.lots-of-surface-state.cs.dynamic cricible test. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit054e48ee0e) Conflicts: src/intel/vulkan/genX_cmd_buffer.c Squashed with commit: anv/cmd_buffer: Emit CS push constants after binding tables Emitting binding tables can cause push constants to be dirtied if the shader uses images so we need to handle push constants later. (cherry picked from commit7a2cfd4adb)
This commit is contained in:
parent
2722144bed
commit
7dceb97604
1 changed files with 13 additions and 10 deletions
|
|
@ -1356,22 +1356,13 @@ flush_compute_descriptor_set(struct anv_cmd_buffer *cmd_buffer)
|
|||
result = emit_binding_table(cmd_buffer, MESA_SHADER_COMPUTE, &surfaces);
|
||||
assert(result == VK_SUCCESS);
|
||||
}
|
||||
|
||||
result = emit_samplers(cmd_buffer, MESA_SHADER_COMPUTE, &samplers);
|
||||
assert(result == VK_SUCCESS);
|
||||
|
||||
|
||||
struct anv_state push_state = anv_cmd_buffer_cs_push_constants(cmd_buffer);
|
||||
|
||||
const struct brw_cs_prog_data *cs_prog_data = get_cs_prog_data(pipeline);
|
||||
const struct brw_stage_prog_data *prog_data = &cs_prog_data->base;
|
||||
|
||||
if (push_state.alloc_size) {
|
||||
anv_batch_emit(&cmd_buffer->batch, GENX(MEDIA_CURBE_LOAD), curbe) {
|
||||
curbe.CURBETotalDataLength = push_state.alloc_size;
|
||||
curbe.CURBEDataStartAddress = push_state.offset;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t slm_size = encode_slm_size(GEN_GEN, prog_data->total_shared);
|
||||
|
||||
struct anv_state state =
|
||||
|
|
@ -1441,6 +1432,18 @@ genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer)
|
|||
cmd_buffer->state.descriptors_dirty &= ~VK_SHADER_STAGE_COMPUTE_BIT;
|
||||
}
|
||||
|
||||
if (cmd_buffer->state.push_constants_dirty & VK_SHADER_STAGE_COMPUTE_BIT) {
|
||||
struct anv_state push_state =
|
||||
anv_cmd_buffer_cs_push_constants(cmd_buffer);
|
||||
|
||||
if (push_state.alloc_size) {
|
||||
anv_batch_emit(&cmd_buffer->batch, GENX(MEDIA_CURBE_LOAD), curbe) {
|
||||
curbe.CURBETotalDataLength = push_state.alloc_size;
|
||||
curbe.CURBEDataStartAddress = push_state.offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cmd_buffer->state.compute_dirty = 0;
|
||||
|
||||
genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue