anv: Reduce compute pipeline batch_data size
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 3 Mar 2020 23:42:33 +0000 (15:42 -0800)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 12 Mar 2020 20:18:54 +0000 (13:18 -0700)
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 <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4040>

src/intel/vulkan/anv_pipeline.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_pipeline.c

index 7c324d54408c92e3a15988940ae8554cdbdf8a81..227cf73cf5fb770d5eddda3d4330a7a4a812f978 100644 (file)
@@ -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;
 
index defe44a338331163d2aec7c6502f01b95f57393e..51e3845629b2dd5a666df0b1166e175b3639805b 100644 (file)
@@ -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];
 };
 
index d65fd2166363e37340a0e55d30451feca80c3488..e775c29a2c28ee3d9d5206c69e1c9b6846605a31 100644 (file)
@@ -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;