Mesa (master): tgsi_to_nir: Set correct location for uniforms.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 5 19:14:04 UTC 2019


Module: Mesa
Branch: master
Commit: 45809bcb33f273ac0b5c2511e1f2711af2eb1bad
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=45809bcb33f273ac0b5c2511e1f2711af2eb1bad

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Mon Mar  4 15:10:55 2019 +0100

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 at gmail.com>
Tested-by: Andre Heider <a.heider at gmail.com>
Tested-by: Rob Clark <robdclark at gmail.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

---

 src/gallium/auxiliary/nir/tgsi_to_nir.c | 1 +
 1 file changed, 1 insertion(+)

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;




More information about the mesa-commit mailing list