st/nir: Fix assigning PointCoord location with !PIPE_CAP_TEXCOORD
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 23 Apr 2020 14:08:21 +0000 (16:08 +0200)
committerMarge Bot <eric+marge@anholt.net>
Sat, 25 Apr 2020 15:52:05 +0000 (15:52 +0000)
This was trying to emulate the effect of mapping GL -> TGSI -> NIR,
but failed to handle VARYING_SLOT_PNTC which led to a kludgy workaround
in freedreno.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4732>

src/mesa/state_tracker/st_glsl_to_nir.cpp

index cf27da7e0c7f82ebd58b9baf3abe4933f80cf2f2..d7277f7f5c59a416a275b2c3b3930685a7201016 100644 (file)
@@ -71,6 +71,8 @@ st_nir_fixup_varying_slots(struct st_context *st, struct exec_list *var_list)
    nir_foreach_variable(var, var_list) {
       if (var->data.location >= VARYING_SLOT_VAR0) {
          var->data.location += 9;
+      } else if (var->data.location == VARYING_SLOT_PNTC) {
+         var->data.location = VARYING_SLOT_VAR8;
       } else if ((var->data.location >= VARYING_SLOT_TEX0) &&
                (var->data.location <= VARYING_SLOT_TEX7)) {
          var->data.location += VARYING_SLOT_VAR0 - VARYING_SLOT_TEX0;