zink: always take the compact descriptor size path with kernel shaders
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 18 Oct 2022 15:42:04 +0000 (11:42 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Oct 2022 22:01:34 +0000 (22:01 +0000)
this guarantees compaction of the size arrays

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19327>

src/gallium/drivers/zink/zink_descriptors.c

index 00b0746..1d09652 100644 (file)
@@ -486,7 +486,7 @@ zink_descriptor_program_init(struct zink_context *ctx, struct zink_program *pg)
          /* some sets can have multiple descriptor types: ensure the size arrays for these types are contiguous for creating the pool key */
          VkDescriptorPoolSize *sz = &sizes[idx];
          VkDescriptorPoolSize sz2[4];
-         if (screen->compact_descriptors) {
+         if (screen->compact_descriptors || (pg->is_compute && stages[0]->nir->info.stage == MESA_SHADER_KERNEL)) {
             unsigned found = 0;
             while (found < num_type_sizes[desc_type]) {
                if (sz->descriptorCount) {