mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-01 04:40:22 +01:00
Revert "radv: re-apply "Do not access set layout during vkCmdBindDescriptorSets.""
The most famous RADV revert over the past months. This was an issue in RADV and not an use-after-free (descriptor set layouts can be destroyed almost at any time). This reverts commitb775aaff1e. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14621> (cherry picked from commit9ea4029f9f)
This commit is contained in:
parent
5ff5f3cbf7
commit
ba2d22e95f
4 changed files with 7 additions and 13 deletions
|
|
@ -193,7 +193,7 @@
|
|||
"description": "Revert \"radv: re-apply \"Do not access set layout during vkCmdBindDescriptorSets.\"\"",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "b775aaff1ec86f4ebd50867a045695da1fbeb2e1"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4727,6 +4727,7 @@ radv_bind_descriptor_set(struct radv_cmd_buffer *cmd_buffer, VkPipelineBindPoint
|
|||
radv_set_descriptor_set(cmd_buffer, bind_point, set, idx);
|
||||
|
||||
assert(set);
|
||||
assert(!(set->header.layout->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR));
|
||||
|
||||
if (!cmd_buffer->device->use_global_bo_list) {
|
||||
for (unsigned j = 0; j < set->header.buffer_count; ++j)
|
||||
|
|
@ -4764,7 +4765,7 @@ radv_CmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pi
|
|||
radv_bind_descriptor_set(cmd_buffer, pipelineBindPoint, set, set_idx);
|
||||
}
|
||||
|
||||
for (unsigned j = 0; j < layout->set[set_idx].dynamic_offset_count; ++j, ++dyn_idx) {
|
||||
for (unsigned j = 0; j < set->header.layout->dynamic_offset_count; ++j, ++dyn_idx) {
|
||||
unsigned idx = j + layout->set[i + firstSet].dynamic_offset_start;
|
||||
uint32_t *dst = descriptors_state->dynamic_buffers + idx * 4;
|
||||
assert(dyn_idx < dynamicOffsetCount);
|
||||
|
|
@ -4790,7 +4791,7 @@ radv_CmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pi
|
|||
}
|
||||
}
|
||||
|
||||
cmd_buffer->push_constant_stages |= layout->set[set_idx].dynamic_offset_stages;
|
||||
cmd_buffer->push_constant_stages |= set->header.layout->dynamic_shader_stages;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -496,16 +496,11 @@ radv_CreatePipelineLayout(VkDevice _device, const VkPipelineLayoutCreateInfo *pC
|
|||
layout->set[set].layout = set_layout;
|
||||
|
||||
layout->set[set].dynamic_offset_start = dynamic_offset_count;
|
||||
layout->set[set].dynamic_offset_count = 0;
|
||||
layout->set[set].dynamic_offset_stages = 0;
|
||||
|
||||
for (uint32_t b = 0; b < set_layout->binding_count; b++) {
|
||||
layout->set[set].dynamic_offset_count +=
|
||||
set_layout->binding[b].array_size * set_layout->binding[b].dynamic_offset_count;
|
||||
layout->set[set].dynamic_offset_stages |= set_layout->dynamic_shader_stages;
|
||||
dynamic_offset_count += set_layout->binding[b].array_size * set_layout->binding[b].dynamic_offset_count;
|
||||
dynamic_shader_stages |= set_layout->dynamic_shader_stages;
|
||||
}
|
||||
dynamic_offset_count += layout->set[set].dynamic_offset_count;
|
||||
dynamic_shader_stages |= layout->set[set].dynamic_offset_stages;
|
||||
|
||||
/* Hash the entire set layout except for the vk_object_base. The
|
||||
* rest of the set layout is carefully constructed to not have
|
||||
|
|
|
|||
|
|
@ -89,9 +89,7 @@ struct radv_pipeline_layout {
|
|||
struct {
|
||||
struct radv_descriptor_set_layout *layout;
|
||||
uint32_t size;
|
||||
uint16_t dynamic_offset_start;
|
||||
uint16_t dynamic_offset_count;
|
||||
VkShaderStageFlags dynamic_offset_stages;
|
||||
uint32_t dynamic_offset_start;
|
||||
} set[MAX_SETS];
|
||||
|
||||
uint32_t num_sets;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue