summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-09-18 12:32:31 -0700
committerCarl Worth <cworth@cworth.org>2013-09-27 15:31:29 -0700
commit8a9099d4ef7daa8c6df76f25ce14345c36f4325f (patch)
tree3a9a89a46e27af401c2aabc9647a9e73e50ff653
parentbeebb2d9d5913b251e50dca9db3e427fdbaee8be (diff)
downloadmesa-8a9099d4ef7daa8c6df76f25ce14345c36f4325f.tar.gz
mesa-8a9099d4ef7daa8c6df76f25ce14345c36f4325f.tar.bz2
mesa-8a9099d4ef7daa8c6df76f25ce14345c36f4325f.zip
i965/gen4: Fix fragment program rectangle texture shadow compares.
The rescale_texcoord(), if it does something, will return just the GLSL-sized coordinate, leaving out the 3rd and 4th components where we were storing our projected shadow compare and the texture projector. Deref the shadow compare before using the shared rescale-the-coordinate code to fix the problem. Fixes piglit tex-shadow2drect.shader_test and txp-shadow2drect.shader_test Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69525 NOTE: This is a candidate for stable branches. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 938956ad52bc7659212b5877080967d4af0aad81)
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_fp.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
index 68531e3b2fa..0594948ee06 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
@@ -490,15 +490,15 @@ fs_visitor::emit_fragment_program_code()
ir_constant_data junk_data;
ir->coordinate = new(mem_ctx) ir_constant(coordinate_type, &junk_data);
- coordinate = rescale_texcoord(ir, coordinate,
- fpi->TexSrcTarget == TEXTURE_RECT_INDEX,
- fpi->TexSrcUnit, fpi->TexSrcUnit);
-
if (fpi->TexShadow) {
shadow_c = regoffset(coordinate, 2);
ir->shadow_comparitor = new(mem_ctx) ir_constant(0.0f);
}
+ coordinate = rescale_texcoord(ir, coordinate,
+ fpi->TexSrcTarget == TEXTURE_RECT_INDEX,
+ fpi->TexSrcUnit, fpi->TexSrcUnit);
+
fs_inst *inst;
if (brw->gen >= 7) {
inst = emit_texture_gen7(ir, dst, coordinate, shadow_c, lod, dpdy, sample_index);