anv: handle push descriptor sets when they are sent with push constants
When vkCmdPushDescriptorSetKHR is used, the descriptor set is allocated
internally without belonging to any pool. Such descriptor set will be
visible on the GPU side because it's a part of the dynamic state stream,
but we still have to store its address in the array of descriptor sets.
Complements: 379b9bb7b0
("anv: Support fetching descriptor addresses from push constants")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11577>
This commit is contained in:

committed by
Marge Bot

parent
79a50c6f54
commit
904bd8f358
@@ -931,7 +931,12 @@ anv_cmd_buffer_bind_descriptor_set(struct anv_cmd_buffer *cmd_buffer,
|
||||
}
|
||||
|
||||
VkShaderStageFlags dirty_stages = 0;
|
||||
if (pipe_state->descriptors[set_index] != set) {
|
||||
/* If it's a push descriptor set, we have to flag things as dirty
|
||||
* regardless of whether or not the CPU-side data structure changed as we
|
||||
* may have edited in-place.
|
||||
*/
|
||||
if (pipe_state->descriptors[set_index] != set ||
|
||||
anv_descriptor_set_is_push(set)) {
|
||||
pipe_state->descriptors[set_index] = set;
|
||||
|
||||
/* Ray-tracing shaders are entirely bindless and so they don't have
|
||||
@@ -941,23 +946,19 @@ anv_cmd_buffer_bind_descriptor_set(struct anv_cmd_buffer *cmd_buffer,
|
||||
if (bind_point == VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR) {
|
||||
struct anv_push_constants *push = &pipe_state->push_constants;
|
||||
|
||||
push->desc_sets[set_index] = anv_address_physical(set->desc_addr);
|
||||
struct anv_address addr = anv_descriptor_set_address(cmd_buffer, set);
|
||||
push->desc_sets[set_index] = anv_address_physical(addr);
|
||||
|
||||
anv_reloc_list_add_bo(cmd_buffer->batch.relocs,
|
||||
cmd_buffer->batch.alloc,
|
||||
set->pool->bo);
|
||||
if (addr.bo) {
|
||||
anv_reloc_list_add_bo(cmd_buffer->batch.relocs,
|
||||
cmd_buffer->batch.alloc,
|
||||
addr.bo);
|
||||
}
|
||||
}
|
||||
|
||||
dirty_stages |= stages;
|
||||
}
|
||||
|
||||
/* If it's a push descriptor set, we have to flag things as dirty
|
||||
* regardless of whether or not the CPU-side data structure changed as we
|
||||
* may have edited in-place.
|
||||
*/
|
||||
if (set->pool == NULL)
|
||||
dirty_stages |= stages;
|
||||
|
||||
if (dynamic_offsets) {
|
||||
if (set_layout->dynamic_offset_count > 0) {
|
||||
struct anv_push_constants *push = &pipe_state->push_constants;
|
||||
|
Reference in New Issue
Block a user