radeonsi/nir: Use correct location for uniform access bound
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 29 May 2019 15:09:45 +0000 (17:09 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Fri, 31 May 2019 09:02:57 +0000 (11:02 +0200)
location is the API-level location, but driver_location is the actual
location the uniform gets passed to the driver. This apparently only
caused failures with builtins, where the location is 0 because it's
represented via the state tokens instead.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/gallium/drivers/radeonsi/si_shader_nir.c

index 10e72fd9f4d244f14928650aedc0bd1bc1fc50d0..3a5e17c6b29bf730b2a73d2541eba8da182d3164 100644 (file)
@@ -709,7 +709,7 @@ void si_nir_scan_shader(const struct nir_shader *nir,
                enum glsl_base_type base_type =
                        glsl_get_base_type(glsl_without_array(type));
                unsigned aoa_size = MAX2(1, glsl_get_aoa_size(type));
-               unsigned loc = variable->data.location;
+               unsigned loc = variable->data.driver_location / 4;
                int slot_count = glsl_count_attribute_slots(type, false);
                int max_slot = MAX2(info->const_file_max[0], (int) loc) + slot_count;