aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp7
-rw-r--r--mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 6319079d5..74b3e5b58 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4889,6 +4889,13 @@ st_translate_program(
t->outputs[i] = ureg_DECL_output(ureg,
outputSemanticName[i],
outputSemanticIndex[i]);
+ if (outputSemanticName[i] == TGSI_SEMANTIC_FOG) {
+ /* force register to contain a fog coordinate in the form (F, 0, 0, 1). */
+ ureg_MOV(ureg,
+ ureg_writemask(t->outputs[i], TGSI_WRITEMASK_XYZW & ~TGSI_WRITEMASK_X),
+ ureg_imm4f(ureg, 0.0f, 0.0f, 0.0f, 1.0f));
+ t->outputs[i] = ureg_writemask(t->outputs[i], TGSI_WRITEMASK_X);
+ }
}
if (passthrough_edgeflags)
emit_edgeflags(t);
diff --git a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 921b0f9b8..7d79c6235 100644
--- a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -1121,6 +1121,13 @@ st_translate_mesa_program(
t->outputs[i] = ureg_DECL_output( ureg,
outputSemanticName[i],
outputSemanticIndex[i] );
+ if (outputSemanticName[i] == TGSI_SEMANTIC_FOG) {
+ /* force register to contain a fog coordinate in the form (F, 0, 0, 1). */
+ ureg_MOV(ureg,
+ ureg_writemask(t->outputs[i], TGSI_WRITEMASK_XYZW & ~TGSI_WRITEMASK_X),
+ ureg_imm4f(ureg, 0.0f, 0.0f, 0.0f, 1.0f));
+ t->outputs[i] = ureg_writemask(t->outputs[i], TGSI_WRITEMASK_X);
+ }
}
if (passthrough_edgeflags)
emit_edgeflags( t, program );