mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
anv/descriptor_set: Ensure that bindings are always in increasing order
Since applications are allowed to specify some set of bindings which need
not be dense they also need not be in order. For most things, this doesn't
matter, but it could result getting the wrong dynamic offsets. This adds a
quick-and-dirty sort to ensure that everything is always in increasing
order of binding index.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c13c5ac561)
This commit is contained in:
parent
a0be8d3d08
commit
b1f217b5a9
1 changed files with 13 additions and 0 deletions
|
|
@ -89,6 +89,19 @@ VkResult anv_CreateDescriptorSetLayout(
|
|||
for (uint32_t j = 0; j < pCreateInfo->bindingCount; j++) {
|
||||
const VkDescriptorSetLayoutBinding *binding = &pCreateInfo->pBindings[j];
|
||||
uint32_t b = binding->binding;
|
||||
/* We temporarily store the pointer to the binding in the
|
||||
* immutable_samplers pointer. This provides us with a quick-and-dirty
|
||||
* way to sort the bindings by binding number.
|
||||
*/
|
||||
set_layout->binding[b].immutable_samplers = (void *)binding;
|
||||
}
|
||||
|
||||
for (uint32_t b = 0; b <= max_binding; b++) {
|
||||
const VkDescriptorSetLayoutBinding *binding =
|
||||
(void *)set_layout->binding[b].immutable_samplers;
|
||||
|
||||
if (binding == NULL)
|
||||
continue;
|
||||
|
||||
assert(binding->descriptorCount > 0);
|
||||
#ifndef NDEBUG
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue