summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-01-10 12:15:24 +0100
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-01-10 15:59:55 +0100
commita07e4c9ce0c1687239301566bd0a05f91e65a24b (patch)
tree07611f99d82eb8ca018ce035465d491f05ba90f0
parent41969f0d068e15730c8b22d79293cc36cb414da6 (diff)
radeonsi: fix the offset in cube map coordinate conversion
The correct offset is really 0.5, both intuitively and according to the formulas in Section 8.13 (Cube Map Texture Selection) of the OpenGL spec. This mistake probably never hurt because wrap-around is constrained to individual cube faces.
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c
index 0a49bc2b2c..277ed5bf20 100644
--- a/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c
+++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c
@@ -961,7 +961,7 @@ static void si_llvm_cube_to_2d_coords(struct lp_build_tgsi_context *bld_base,
coords[2] = lp_build_emit_llvm_unary(bld_base, TGSI_OPCODE_RCP, coords[2]);
mad_args[1] = coords[2];
- mad_args[2] = LLVMConstReal(type, 1.5);
+ mad_args[2] = LLVMConstReal(type, 0.5);
mad_args[0] = coords[0];
coords[0] = lp_build_emit_llvm_ternary(bld_base, TGSI_OPCODE_MAD,