From 0a5053b687e7c9b69ecc743a770dff99952071b3 Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Tue, 3 Mar 2020 15:42:33 -0800 Subject: [PATCH] anv: Reduce compute pipeline batch_data size The batch associated with the compute pipeline only needs room for a MEDIA_VFE_STATE. So this patch moves the batch_data to each pipeline struct and cap the one in compute pipeline. Reviewed-by: Jason Ekstrand Part-of: --- src/intel/vulkan/anv_pipeline.c | 4 ++-- src/intel/vulkan/anv_private.h | 4 +++- src/intel/vulkan/genX_pipeline.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 7c324d54408..227cf73cf5f 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -1866,8 +1866,8 @@ anv_pipeline_init(struct anv_graphics_pipeline *pipeline, return result; pipeline->base.batch.alloc = alloc; - pipeline->base.batch.next = pipeline->base.batch.start = pipeline->base.batch_data; - pipeline->base.batch.end = pipeline->base.batch.start + sizeof(pipeline->base.batch_data); + pipeline->base.batch.next = pipeline->base.batch.start = pipeline->batch_data; + pipeline->base.batch.end = pipeline->base.batch.start + sizeof(pipeline->batch_data); pipeline->base.batch.relocs = &pipeline->base.batch_relocs; pipeline->base.batch.status = VK_SUCCESS; diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index defe44a3383..51e3845629b 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -3171,7 +3171,6 @@ struct anv_pipeline { struct anv_batch batch; struct anv_reloc_list batch_relocs; - uint32_t batch_data[512]; void * mem_ctx; @@ -3186,6 +3185,8 @@ struct anv_pipeline { struct anv_graphics_pipeline { struct anv_pipeline base; + uint32_t batch_data[512]; + anv_cmd_dirty_mask_t dynamic_state_mask; struct anv_dynamic_state dynamic_state; @@ -3238,6 +3239,7 @@ struct anv_compute_pipeline { struct anv_shader_bin * cs; uint32_t cs_right_mask; + uint32_t batch_data[9]; uint32_t interface_descriptor_data[8]; }; diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index d65fd216636..e775c29a2c2 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -2242,8 +2242,8 @@ compute_pipeline_create( return result; } pipeline->base.batch.alloc = alloc; - pipeline->base.batch.next = pipeline->base.batch.start = pipeline->base.batch_data; - pipeline->base.batch.end = pipeline->base.batch.start + sizeof(pipeline->base.batch_data); + pipeline->base.batch.next = pipeline->base.batch.start = pipeline->batch_data; + pipeline->base.batch.end = pipeline->base.batch.start + sizeof(pipeline->batch_data); pipeline->base.batch.relocs = &pipeline->base.batch_relocs; pipeline->base.batch.status = VK_SUCCESS; -- 2.30.2