mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-15 04:10:35 +01:00
hk: Handle unbound sets that contain dynamic buffers
The offset for the dynamic buffers needs to be computed with the currently
bound pipeline layout. This change fixes incorrectly selecting the offset
for a dynamic buffer if a descriptor with a lower index than the currently
being bound contains a dynamic buffer but said descriptor hasn't being
bound yet. It also prevents the binding to override the dynamic buffers in
order to preserve the already bound dynamic descriptors.
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
(cherry picked from commit aaf4405507)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39440>
This commit is contained in:
parent
d2bc79c260
commit
f4e56b61da
2 changed files with 9 additions and 11 deletions
|
|
@ -4204,7 +4204,7 @@
|
|||
"description": "hk: Handle unbound sets that contain dynamic buffers",
|
||||
"nominated": false,
|
||||
"nomination_type": 0,
|
||||
"resolution": 4,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -376,13 +376,15 @@ hk_bind_descriptor_sets(UNUSED struct hk_cmd_buffer *cmd,
|
|||
*
|
||||
* This means that, if some earlier set gets bound in such a way that
|
||||
* it changes set_dynamic_buffer_start[s], this binding is implicitly
|
||||
* invalidated. Therefore, we can always look at the current value
|
||||
* of set_dynamic_buffer_start[s] as the base of our dynamic buffer
|
||||
* range and it's only our responsibility to adjust all
|
||||
* set_dynamic_buffer_start[p] for p > s as needed.
|
||||
* invalidated.
|
||||
*/
|
||||
uint8_t dyn_buffer_start =
|
||||
desc->root.set_dynamic_buffer_start[info->firstSet];
|
||||
uint8_t dyn_buffer_start = 0u;
|
||||
for (uint32_t i = 0u; i < info->firstSet; ++i) {
|
||||
const struct hk_descriptor_set_layout *set_layout =
|
||||
vk_to_hk_descriptor_set_layout(pipeline_layout->set_layouts[i]);
|
||||
if (set_layout)
|
||||
dyn_buffer_start += set_layout->dynamic_buffer_count;
|
||||
}
|
||||
|
||||
uint32_t next_dyn_offset = 0;
|
||||
for (uint32_t i = 0; i < info->descriptorSetCount; ++i) {
|
||||
|
|
@ -427,10 +429,6 @@ hk_bind_descriptor_sets(UNUSED struct hk_cmd_buffer *cmd,
|
|||
assert(dyn_buffer_start <= HK_MAX_DYNAMIC_BUFFERS);
|
||||
assert(next_dyn_offset <= info->dynamicOffsetCount);
|
||||
|
||||
for (uint32_t s = info->firstSet + info->descriptorSetCount; s < HK_MAX_SETS;
|
||||
s++)
|
||||
desc->root.set_dynamic_buffer_start[s] = dyn_buffer_start;
|
||||
|
||||
desc->root_dirty = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue