tgsi_to_nir: Set correct location for uniforms.

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>
This commit is contained in:
Timur Kristóf 2019-03-04 15:10:55 +01:00 committed by Eric Anholt
parent 770faf546d
commit 45809bcb33

View 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;