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 <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
194fa58285
commit
12dee851a3
|
@ -643,6 +643,7 @@ anv_descriptor_set_write_buffer_view(struct anv_descriptor_set *set,
|
||||||
void
|
void
|
||||||
anv_descriptor_set_write_buffer(struct anv_descriptor_set *set,
|
anv_descriptor_set_write_buffer(struct anv_descriptor_set *set,
|
||||||
struct anv_device *device,
|
struct anv_device *device,
|
||||||
|
struct anv_state_stream *alloc_stream,
|
||||||
VkDescriptorType type,
|
VkDescriptorType type,
|
||||||
struct anv_buffer *buffer,
|
struct anv_buffer *buffer,
|
||||||
uint32_t binding,
|
uint32_t binding,
|
||||||
|
@ -672,6 +673,13 @@ anv_descriptor_set_write_buffer(struct anv_descriptor_set *set,
|
||||||
else
|
else
|
||||||
bview->range = range;
|
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,
|
anv_fill_buffer_surface_state(device, bview->surface_state,
|
||||||
bview->format,
|
bview->format,
|
||||||
bview->offset, bview->range, 1);
|
bview->offset, bview->range, 1);
|
||||||
|
@ -736,6 +744,7 @@ void anv_UpdateDescriptorSets(
|
||||||
|
|
||||||
anv_descriptor_set_write_buffer(set,
|
anv_descriptor_set_write_buffer(set,
|
||||||
device,
|
device,
|
||||||
|
NULL,
|
||||||
write->descriptorType,
|
write->descriptorType,
|
||||||
buffer,
|
buffer,
|
||||||
write->dstBinding,
|
write->dstBinding,
|
||||||
|
|
|
@ -960,6 +960,7 @@ anv_descriptor_set_write_buffer_view(struct anv_descriptor_set *set,
|
||||||
void
|
void
|
||||||
anv_descriptor_set_write_buffer(struct anv_descriptor_set *set,
|
anv_descriptor_set_write_buffer(struct anv_descriptor_set *set,
|
||||||
struct anv_device *device,
|
struct anv_device *device,
|
||||||
|
struct anv_state_stream *alloc_stream,
|
||||||
VkDescriptorType type,
|
VkDescriptorType type,
|
||||||
struct anv_buffer *buffer,
|
struct anv_buffer *buffer,
|
||||||
uint32_t binding,
|
uint32_t binding,
|
||||||
|
|
Loading…
Reference in New Issue