summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2015-09-09 10:27:04 -0700
committerIan Romanick <[email protected]>2015-09-10 20:29:51 -0700
commit4603723722127e707a5c1fa28736ee932f326846 (patch)
tree40b3fbd09fec3cd1228807e63e7d3111d962ac5a /src/mesa
parent767c33e88138afa64443417860b264a494eba33d (diff)
meta: Use result of texture coordinate clamping operation
Previously the result of the complicated clamp() expression just dropped on the floor: clamp does not modify any of its parameters. Looking at the surrounding code, I believe this is supposed to modify the value of tex_coord. This change (along with a change to avoid the use of brw_blorp_framebuffer) does not affect any existing piglit tests. I'm not sure what this clamp is trying to accomplish, so I'm not sure how to write a test to exercise this path. I also noticed another bug in this code. There is no way the array texture case could possibly work. This will generate code for the TEXEL_FETCH macro like: #define TEXEL_FETCH(coord) texelFetch(texSampler, ivec3(coord), sample_map[int(2 * fract(coord.x))]); Since the coord parameter of this macro is a vec2 at all invocations, no expansion of this macro will even compile. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Cc: Topi Pohjolainen <[email protected]> Cc: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/common/meta_blit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index 71d18de87db..a41fe42338f 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -187,8 +187,8 @@ setup_glsl_msaa_blit_scaled_shader(struct gl_context *ctx,
" vec2 tex_coord = texCoords - s_0_offset;\n"
"\n"
" tex_coord *= scale;\n"
- " clamp(tex_coord.x, 0.0f, scale.x * src_width - 1.0f);\n"
- " clamp(tex_coord.y, 0.0f, scale.y * src_height - 1.0f);\n"
+ " tex_coord.x = clamp(tex_coord.x, 0.0f, scale.x * src_width - 1.0f);\n"
+ " tex_coord.y = clamp(tex_coord.y, 0.0f, scale.y * src_height - 1.0f);\n"
" interp = fract(tex_coord);\n"
" tex_coord = ivec2(tex_coord) * scale_inv;\n"
"\n"