[Mesa-dev] [PATCH 3/4] anv/cmd_buffer: Re-emit MEDIA_CURBE_LOAD when CS push constants are dirty
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Tue Nov 22 10:15:08 UTC 2016
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
On 22/11/16 04:26, Jason Ekstrand wrote:
> 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.
>
> Cc: "13.0" <mesa-stable at lists.freedesktop.org>
> Cc: Jordan Justen <jordan.l.justen at intel.com>
> ---
> src/intel/vulkan/genX_cmd_buffer.c | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
> index 6645d1b..eded1c9 100644
> --- a/src/intel/vulkan/genX_cmd_buffer.c
> +++ b/src/intel/vulkan/genX_cmd_buffer.c
> @@ -1687,19 +1687,10 @@ 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);
> -
> - 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;
> - }
> - }
> -
> uint32_t iface_desc_data_dw[GENX(INTERFACE_DESCRIPTOR_DATA_length)];
> struct GENX(INTERFACE_DESCRIPTOR_DATA) desc = {
> .BindingTablePointer = surfaces.offset,
> @@ -1738,6 +1729,18 @@ genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer)
> if (cmd_buffer->state.compute_dirty & ANV_CMD_DIRTY_PIPELINE)
> anv_batch_emit_batch(&cmd_buffer->batch, &pipeline->batch);
>
> + 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;
> + }
> + }
> + }
> +
> if ((cmd_buffer->state.descriptors_dirty & VK_SHADER_STAGE_COMPUTE_BIT) ||
> (cmd_buffer->state.compute_dirty & ANV_CMD_DIRTY_PIPELINE)) {
> /* FIXME: figure out descriptors for gen7 */
More information about the mesa-dev
mailing list