radeonsi/nir: clean up some nir_scan_shader code
authorMarek Olšák <marek.olsak@amd.com>
Tue, 23 Jul 2019 21:42:26 +0000 (17:42 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 31 Jul 2019 02:06:23 +0000 (22:06 -0400)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/gallium/drivers/radeonsi/si_shader_nir.c

index db40c04eb66decb414f3b4b444f232ecd676de8e..23728a72375ae3f81a824c7b584073ef0aaaf439 100644 (file)
@@ -762,22 +762,12 @@ void si_nir_scan_shader(const struct nir_shader *nir,
                /* We rely on the fact that nir_lower_samplers_as_deref has
                 * eliminated struct dereferences.
                 */
-               if (base_type == GLSL_TYPE_SAMPLER) {
-                       if (variable->data.bindless) {
-                               info->const_buffers_declared |= 1;
-                               info->const_file_max[0] = max_slot;
-                       } else {
-                               info->samplers_declared |=
-                                       u_bit_consecutive(variable->data.binding, aoa_size);
-                       }
-               } else if (base_type == GLSL_TYPE_IMAGE) {
-                       if (variable->data.bindless) {
-                               info->const_buffers_declared |= 1;
-                               info->const_file_max[0] = max_slot;
-                       } else {
-                               info->images_declared |=
-                                       u_bit_consecutive(variable->data.binding, aoa_size);
-                       }
+               if (base_type == GLSL_TYPE_SAMPLER && !variable->data.bindless) {
+                       info->samplers_declared |=
+                               u_bit_consecutive(variable->data.binding, aoa_size);
+               } else if (base_type == GLSL_TYPE_IMAGE && !variable->data.bindless) {
+                       info->images_declared |=
+                               u_bit_consecutive(variable->data.binding, aoa_size);
                } else if (base_type != GLSL_TYPE_ATOMIC_UINT) {
                        info->const_buffers_declared |= 1;
                        info->const_file_max[0] = max_slot;