From: Jason Ekstrand Date: Thu, 15 Oct 2015 20:45:07 +0000 (-0700) Subject: anv/cmd_buffer: Add an alloc_surface_state helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6dc4cad994ca03b71f99b79856d8d8ff5cf3ed83;p=mesa.git anv/cmd_buffer: Add an alloc_surface_state helper --- diff --git a/src/vulkan/anv_batch_chain.c b/src/vulkan/anv_batch_chain.c index c621c0745b7..77fbd6635c0 100644 --- a/src/vulkan/anv_batch_chain.c +++ b/src/vulkan/anv_batch_chain.c @@ -483,6 +483,12 @@ anv_cmd_buffer_alloc_binding_table(struct anv_cmd_buffer *cmd_buffer, return state; } +struct anv_state +anv_cmd_buffer_alloc_surface_state(struct anv_cmd_buffer *cmd_buffer) +{ + return anv_state_stream_alloc(&cmd_buffer->surface_state_stream, 64, 64); +} + struct anv_state anv_cmd_buffer_alloc_dynamic_state(struct anv_cmd_buffer *cmd_buffer, uint32_t size, uint32_t alignment) diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index 757a149289f..bcfb6fada50 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -992,6 +992,8 @@ struct anv_state anv_cmd_buffer_alloc_binding_table(struct anv_cmd_buffer *cmd_buffer, uint32_t entries, uint32_t *state_offset); struct anv_state +anv_cmd_buffer_alloc_surface_state(struct anv_cmd_buffer *cmd_buffer); +struct anv_state anv_cmd_buffer_alloc_dynamic_state(struct anv_cmd_buffer *cmd_buffer, uint32_t size, uint32_t alignment); diff --git a/src/vulkan/gen7_state.c b/src/vulkan/gen7_state.c index d317fa4ec16..aef97838e17 100644 --- a/src/vulkan/gen7_state.c +++ b/src/vulkan/gen7_state.c @@ -118,8 +118,7 @@ gen7_alloc_surface_state(struct anv_device *device, struct anv_cmd_buffer *cmd_buffer) { if (cmd_buffer) { - return anv_state_stream_alloc(&cmd_buffer->surface_state_stream, - 64, 64); + return anv_cmd_buffer_alloc_surface_state(cmd_buffer); } else { return anv_state_pool_alloc(&device->surface_state_pool, 64, 64); } diff --git a/src/vulkan/gen8_state.c b/src/vulkan/gen8_state.c index 9be3bf46021..d9438127f2a 100644 --- a/src/vulkan/gen8_state.c +++ b/src/vulkan/gen8_state.c @@ -104,8 +104,7 @@ gen8_alloc_surface_state(struct anv_device *device, struct anv_cmd_buffer *cmd_buffer) { if (cmd_buffer) { - return anv_state_stream_alloc(&cmd_buffer->surface_state_stream, - 64, 64); + return anv_cmd_buffer_alloc_surface_state(cmd_buffer); } else { return anv_state_pool_alloc(&device->surface_state_pool, 64, 64); }