From: Timur Kristóf Date: Mon, 4 Mar 2019 14:10:55 +0000 (+0100) Subject: tgsi_to_nir: Set correct location for uniforms. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=45809bcb33f273ac0b5c2511e1f2711af2eb1bad;p=mesa.git 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 Tested-by: Andre Heider Tested-by: Rob Clark Reviewed-by: Timothy Arceri --- diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index 016e2b46f08..09e40977fd8 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -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;