From 610a7c84c3766337778b273bc2a6dbf47900de39 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 29 Apr 2024 17:21:50 +0300 Subject: [PATCH] anv: move empty_vs_input to physical device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lionel Landwerlin Reviewed-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_private.h | 12 ++++++------ src/intel/vulkan/genX_gfx_state.c | 4 ++-- src/intel/vulkan/genX_init_state.c | 17 +++++++++-------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 7faa6af8bd0..22dcb93a6f6 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1250,6 +1250,12 @@ struct anv_physical_device { /* Value of PIPELINE_SELECT::PipelineSelection == GPGPU */ uint32_t gpgpu_pipeline_value; + + /** A pre packed VERTEX_ELEMENT_STATE feeding 0s to the VS stage + * + * For use when a pipeline has no VS input + */ + uint32_t empty_vs_input[2]; }; static inline uint32_t @@ -1910,12 +1916,6 @@ struct anv_device { struct anv_bo *btd_fifo_bo; struct anv_address rt_uuid_addr; - /** A pre packed VERTEX_ELEMENT_STATE feeding 0s to the VS stage - * - * For use when a pipeline has no VS input - */ - uint32_t empty_vs_input[2]; - bool robust_buffer_access; uint32_t protected_session_id; diff --git a/src/intel/vulkan/genX_gfx_state.c b/src/intel/vulkan/genX_gfx_state.c index 5f0b1e1c538..ce788347571 100644 --- a/src/intel/vulkan/genX_gfx_state.c +++ b/src/intel/vulkan/genX_gfx_state.c @@ -1874,8 +1874,8 @@ cmd_buffer_gfx_state_emission(struct anv_cmd_buffer *cmd_buffer) if (p) { if (ve_count == 0) { - memcpy(p + 1, cmd_buffer->device->empty_vs_input, - sizeof(cmd_buffer->device->empty_vs_input)); + memcpy(p + 1, cmd_buffer->device->physical->empty_vs_input, + sizeof(cmd_buffer->device->physical->empty_vs_input)); } else if (ve_count == pipeline->vertex_input_elems) { /* MESA_VK_DYNAMIC_VI is not dynamic for this pipeline, so * everything is in pipeline->vertex_input_data and we can just diff --git a/src/intel/vulkan/genX_init_state.c b/src/intel/vulkan/genX_init_state.c index e86a6e42232..3593c590ea4 100644 --- a/src/intel/vulkan/genX_init_state.c +++ b/src/intel/vulkan/genX_init_state.c @@ -347,14 +347,6 @@ init_render_queue_state(struct anv_queue *queue, bool is_companion_rcs_batch) .end = (void *) cmds + sizeof(cmds), }; - struct GENX(VERTEX_ELEMENT_STATE) empty_ve = { - .Valid = true, - .Component0Control = VFCOMP_STORE_0, - .Component1Control = VFCOMP_STORE_0, - .Component2Control = VFCOMP_STORE_0, - .Component3Control = VFCOMP_STORE_0, - }; - GENX(VERTEX_ELEMENT_STATE_pack)(NULL, device->empty_vs_input, &empty_ve); genX(emit_pipeline_select)(&batch, _3D, device); @@ -778,6 +770,15 @@ genX(init_physical_device_state)(ASSERTED struct anv_physical_device *pdevice) pdevice->cmd_emit_timestamp = genX(cmd_emit_timestamp); pdevice->gpgpu_pipeline_value = GPGPU; + + struct GENX(VERTEX_ELEMENT_STATE) empty_ve = { + .Valid = true, + .Component0Control = VFCOMP_STORE_0, + .Component1Control = VFCOMP_STORE_0, + .Component2Control = VFCOMP_STORE_0, + .Component3Control = VFCOMP_STORE_0, + }; + GENX(VERTEX_ELEMENT_STATE_pack)(NULL, pdevice->empty_vs_input, &empty_ve); } VkResult