radeonsi/nir: don't add bindless samplers/images to declared bitmasks
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 28 Mar 2018 01:31:01 +0000 (12:31 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 10 Apr 2018 04:43:45 +0000 (14:43 +1000)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader_nir.c

index 47f9ef29454367cabf5fa8de42b807d9a0fbaa2e..80c436247c85d7f4e79709715cf5e7d56e223592 100644 (file)
@@ -657,22 +657,22 @@ void si_nir_scan_shader(const struct nir_shader *nir,
                 * eliminated struct dereferences.
                 */
                if (base_type == GLSL_TYPE_SAMPLER) {
-                       info->samplers_declared |=
-                               u_bit_consecutive(variable->data.binding, aoa_size);
-
                        if (variable->data.bindless) {
                                info->const_buffers_declared |= 1;
                                info->const_file_max[0] +=
                                        glsl_count_attribute_slots(type, false);
+                       } else {
+                               info->samplers_declared |=
+                                       u_bit_consecutive(variable->data.binding, aoa_size);
                        }
                } else if (base_type == GLSL_TYPE_IMAGE) {
-                       info->images_declared |=
-                               u_bit_consecutive(variable->data.binding, aoa_size);
-
                        if (variable->data.bindless) {
                                info->const_buffers_declared |= 1;
                                info->const_file_max[0] +=
                                        glsl_count_attribute_slots(type, false);
+                       } else {
+                               info->images_declared |=
+                                       u_bit_consecutive(variable->data.binding, aoa_size);
                        }
                } else if (base_type != GLSL_TYPE_ATOMIC_UINT) {
                        if (strncmp(variable->name, "state.", 6) == 0 ||