From: Connor Abbott Date: Thu, 23 Apr 2020 14:08:21 +0000 (+0200) Subject: st/nir: Fix assigning PointCoord location with !PIPE_CAP_TEXCOORD X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=662e9c180176e906406c65871b4c090702ed4c99;p=mesa.git st/nir: Fix assigning PointCoord location with !PIPE_CAP_TEXCOORD 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: --- diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index cf27da7e0c7..d7277f7f5c5 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -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;