diff options
author | Lionel Landwerlin <[email protected]> | 2017-01-17 17:43:08 +0000 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2017-03-02 10:34:06 +0000 |
commit | 12dee851a3108aabaa80b5c05a633b4bb3d4023b (patch) | |
tree | 44323876c03c2c5683acd83c0c38cad17978d803 /src/intel | |
parent | 194fa5828542604b65bdcee108cbcfb740327d09 (diff) |
anv: descriptor: make descriptor writing take a stream allocator
This allows us to allocate surface states from the command buffer when
pushing descriptor sets rather than allocating them through a
descriptor set pool.
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/anv_descriptor_set.c | 9 | ||||
-rw-r--r-- | src/intel/vulkan/anv_private.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index 2f72c604d56..e4224743eec 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -643,6 +643,7 @@ anv_descriptor_set_write_buffer_view(struct anv_descriptor_set *set, void anv_descriptor_set_write_buffer(struct anv_descriptor_set *set, struct anv_device *device, + struct anv_state_stream *alloc_stream, VkDescriptorType type, struct anv_buffer *buffer, uint32_t binding, @@ -672,6 +673,13 @@ anv_descriptor_set_write_buffer(struct anv_descriptor_set *set, else bview->range = range; + /* If we're writing descriptors through a push command, we need to allocate + * the surface state from the command buffer. Otherwise it will be + * allocated by the descriptor pool when calling + * vkAllocateDescriptorSets. */ + if (alloc_stream) + bview->surface_state = anv_state_stream_alloc(alloc_stream, 64, 64); + anv_fill_buffer_surface_state(device, bview->surface_state, bview->format, bview->offset, bview->range, 1); @@ -736,6 +744,7 @@ void anv_UpdateDescriptorSets( anv_descriptor_set_write_buffer(set, device, + NULL, write->descriptorType, buffer, write->dstBinding, diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 20376248868..2df69c9a350 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -960,6 +960,7 @@ anv_descriptor_set_write_buffer_view(struct anv_descriptor_set *set, void anv_descriptor_set_write_buffer(struct anv_descriptor_set *set, struct anv_device *device, + struct anv_state_stream *alloc_stream, VkDescriptorType type, struct anv_buffer *buffer, uint32_t binding, |