tgsi_to_nir: Set correct location for uniforms.
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 4 Mar 2019 14:10:55 +0000 (15:10 +0100)
committerEric Anholt <eric@anholt.net>
Tue, 5 Mar 2019 19:13:27 +0000 (19:13 +0000)
Previously, only the driver_location was set for all variables,
but constants need to use the location field instead. This change
is necessary because the nine state tracker can produce non-packed
constants whose location needs to be explicitly set.

Signed-Off-By: Timur Kristóf <timur.kristof@gmail.com>
Tested-by: Andre Heider <a.heider@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/gallium/auxiliary/nir/tgsi_to_nir.c

index 016e2b46f08cbc9fe4fe3bbeb705bbf30ebeb69e..09e40977fd8f5ca2f2f11e02bb28502a4f76efb3 100644 (file)
@@ -414,6 +414,7 @@ ttn_emit_declaration(struct ttn_compile *c)
          case TGSI_FILE_CONSTANT:
             var->data.mode = nir_var_uniform;
             var->name = ralloc_asprintf(var, "uniform_%d", idx);
+            var->data.location = idx;
 
             exec_list_push_tail(&b->shader->uniforms, &var->node);
             break;