From da273b2b7b4ceb46dc10a8f746aa74a8c502d2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Mon, 13 Dec 2021 14:14:04 +0100 Subject: [PATCH] anv: Put first few push constants directly into Task/Mesh InlineData Reviewed-by: Caio Oliveira Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 8 ++++++++ src/intel/vulkan/genX_pipeline.c | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 24ea3cf1781..4ceaa2efc76 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -3554,6 +3554,10 @@ cmd_buffer_flush_mesh_inline_data(struct anv_cmd_buffer *cmd_buffer, uint64_t addr = anv_address_physical(buffer); data.InlineData[0] = addr & 0xffffffff; data.InlineData[1] = addr >> 32; + + memcpy(&data.InlineData[BRW_TASK_MESH_PUSH_CONSTANTS_START_DW], + cmd_buffer->state.gfx.base.push_constants.client_data, + BRW_TASK_MESH_PUSH_CONSTANTS_SIZE_DW * 4); } } } @@ -3573,6 +3577,10 @@ cmd_buffer_flush_mesh_inline_data(struct anv_cmd_buffer *cmd_buffer, uint64_t addr = anv_address_physical(buffer); data.InlineData[0] = addr & 0xffffffff; data.InlineData[1] = addr >> 32; + + memcpy(&data.InlineData[BRW_TASK_MESH_PUSH_CONSTANTS_START_DW], + cmd_buffer->state.gfx.base.push_constants.client_data, + BRW_TASK_MESH_PUSH_CONSTANTS_SIZE_DW * 4); } } } diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index b4b80d8ad89..598b2093b29 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -2652,7 +2652,8 @@ emit_task_state(struct anv_graphics_pipeline *pipeline) /* * 3DSTATE_TASK_SHADER_DATA.InlineData[0:1] will be used for an address - * of a buffer with push constants and descriptor set table. + * of a buffer with push constants and descriptor set table and + * InlineData[2:7] will be used for first few push constants. */ task.EmitInlineParameter = true; @@ -2725,7 +2726,8 @@ emit_mesh_state(struct anv_graphics_pipeline *pipeline) /* * 3DSTATE_MESH_SHADER_DATA.InlineData[0:1] will be used for an address - * of a buffer with push constants and descriptor set table. + * of a buffer with push constants and descriptor set table and + * InlineData[2:7] will be used for first few push constants. */ mesh.EmitInlineParameter = true;