aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-08-18 15:54:53 -0600
committerBrian Paul <[email protected]>2011-08-19 13:31:10 -0600
commit0eb18ee55719377ebd90456bde605384ce4ec14a (patch)
tree3d638fd6add50cd98e5539cd4cfd65e81c3483b2 /src/mesa/program
parent352cab498a6210e1fdd57d6be2a30d33024ef37f (diff)
mesa: set Q=1 for OPCODE_TEX execution
Q should not be significant for OPCODE_TEX, but it winds up getting passed to the compute_lambda() function. Make sure it's 1.0 to prevent garbage values, which is effectively what we get when the swizzle is coord.xyzz (which is what GLSL gives us). Part of the fix for piglit's fbo-generatemipmap-array test. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/prog_execute.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
index c70a1e344e5..77f842a1630 100644
--- a/src/mesa/program/prog_execute.c
+++ b/src/mesa/program/prog_execute.c
@@ -1651,6 +1651,14 @@ _mesa_execute_program(struct gl_context * ctx,
GLfloat texcoord[4], color[4];
fetch_vector4(&inst->SrcReg[0], machine, texcoord);
+ /* For TEX, texcoord.Q should not be used and its value should not
+ * matter (at most, we pass coord.xyz to texture3D() in GLSL).
+ * Set Q=1 so that FetchTexelDeriv() doesn't get a garbage value
+ * which is effectively what happens when the texcoord swizzle
+ * is .xyzz
+ */
+ texcoord[3] = 1.0f;
+
fetch_texel(ctx, machine, inst, texcoord, 0.0, color);
if (DEBUG_PROG) {