diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2021-06-21 12:45:24 -0700 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2021-07-06 01:12:16 -0700 |
commit | 78b40bb584f3b172da5e382775610f90d254597a (patch) | |
tree | 47801c0050ffc72cd87d67dd767c1e727d23d793 | |
parent | 2862058afbca6739a7c97f3c1e7a061314eee9d9 (diff) |
blorp: Add blorp_alloc_general_state
Reworks:
* Add crocus
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
-rw-r--r-- | src/gallium/drivers/crocus/crocus_blorp.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/iris/iris_blorp.c | 10 | ||||
-rw-r--r-- | src/intel/blorp/blorp_genX_exec.h | 7 | ||||
-rw-r--r-- | src/intel/vulkan/genX_blorp_exec.c | 16 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/genX_blorp_exec.c | 10 |
5 files changed, 53 insertions, 0 deletions
diff --git a/src/gallium/drivers/crocus/crocus_blorp.c b/src/gallium/drivers/crocus/crocus_blorp.c index c6f4c06fc93..4bf7523da55 100644 --- a/src/gallium/drivers/crocus/crocus_blorp.c +++ b/src/gallium/drivers/crocus/crocus_blorp.c @@ -159,6 +159,16 @@ blorp_alloc_dynamic_state(struct blorp_batch *blorp_batch, return stream_state(batch, size, alignment, offset, NULL); } +UNUSED static void * +blorp_alloc_general_state(struct blorp_batch *blorp_batch, + uint32_t size, + uint32_t alignment, + uint32_t *offset) +{ + /* Use dynamic state range for general state on crocus. */ + return blorp_alloc_dynamic_state(blorp_batch, size, alignment, offset); +} + static void blorp_alloc_binding_table(struct blorp_batch *blorp_batch, unsigned num_entries, diff --git a/src/gallium/drivers/iris/iris_blorp.c b/src/gallium/drivers/iris/iris_blorp.c index 6180fbb7d15..0191606a66e 100644 --- a/src/gallium/drivers/iris/iris_blorp.c +++ b/src/gallium/drivers/iris/iris_blorp.c @@ -139,6 +139,16 @@ blorp_alloc_dynamic_state(struct blorp_batch *blorp_batch, size, alignment, offset, NULL); } +UNUSED static void * +blorp_alloc_general_state(struct blorp_batch *blorp_batch, + uint32_t size, + uint32_t alignment, + uint32_t *offset) +{ + /* Use dynamic state range for general state on iris. */ + return blorp_alloc_dynamic_state(blorp_batch, size, alignment, offset); +} + static void blorp_alloc_binding_table(struct blorp_batch *blorp_batch, unsigned num_entries, diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h index acecede6687..fd6a7886007 100644 --- a/src/intel/blorp/blorp_genX_exec.h +++ b/src/intel/blorp/blorp_genX_exec.h @@ -61,6 +61,13 @@ blorp_alloc_dynamic_state(struct blorp_batch *batch, uint32_t size, uint32_t alignment, uint32_t *offset); + +UNUSED static void * +blorp_alloc_general_state(struct blorp_batch *batch, + uint32_t size, + uint32_t alignment, + uint32_t *offset); + static void * blorp_alloc_vertex_buffer(struct blorp_batch *batch, uint32_t size, struct blorp_address *addr); diff --git a/src/intel/vulkan/genX_blorp_exec.c b/src/intel/vulkan/genX_blorp_exec.c index 9ca1fb66284..57bc9d16aea 100644 --- a/src/intel/vulkan/genX_blorp_exec.c +++ b/src/intel/vulkan/genX_blorp_exec.c @@ -134,6 +134,22 @@ blorp_alloc_dynamic_state(struct blorp_batch *batch, return state.map; } +UNUSED static void * +blorp_alloc_general_state(struct blorp_batch *batch, + uint32_t size, + uint32_t alignment, + uint32_t *offset) +{ + struct anv_cmd_buffer *cmd_buffer = batch->driver_batch; + + struct anv_state state = + anv_state_stream_alloc(&cmd_buffer->general_state_stream, size, + alignment); + + *offset = state.offset; + return state.map; +} + static void blorp_alloc_binding_table(struct blorp_batch *batch, unsigned num_entries, unsigned state_size, unsigned state_alignment, diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c b/src/mesa/drivers/dri/i965/genX_blorp_exec.c index 3cdcef9e37c..83a6531138a 100644 --- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c +++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c @@ -130,6 +130,16 @@ blorp_alloc_dynamic_state(struct blorp_batch *batch, return brw_state_batch(brw, size, alignment, offset); } +UNUSED static void * +blorp_alloc_general_state(struct blorp_batch *blorp_batch, + uint32_t size, + uint32_t alignment, + uint32_t *offset) +{ + /* Use dynamic state range for general state on i965. */ + return blorp_alloc_dynamic_state(blorp_batch, size, alignment, offset); +} + static void blorp_alloc_binding_table(struct blorp_batch *batch, unsigned num_entries, unsigned state_size, unsigned state_alignment, |