summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_blit.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-11-07 15:55:52 +0100
committerNicolai Hähnle <[email protected]>2016-11-16 10:31:21 +0100
commit3817a7a1d7434ae5ae069599013cea81cf809aa5 (patch)
tree3758d474e6c4d8f12e306846abeec92623668c05 /src/gallium/auxiliary/util/u_blit.c
parentab5fd10eaa7e9a7cca20f6aa6b01240e8fd62c49 (diff)
util/blitter: add clamping during SINT <-> UINT blits
Even though glBlitFramebuffer cannot be used for SINT <-> UINT blits, we still need to handle this type of blit here because it can happen as part of texture uploads / downloads, e.g. uploading a GL_RGBA8I texture from GL_UNSIGNED_INT data. Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_blit.c')
-rw-r--r--src/gallium/auxiliary/util/u_blit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c
index fbc9c77dfcc..6d8178ee561 100644
--- a/src/gallium/auxiliary/util/u_blit.c
+++ b/src/gallium/auxiliary/util/u_blit.c
@@ -180,11 +180,13 @@ set_fragment_shader(struct blit_state *ctx, uint writemask,
if (!ctx->fs[pipe_tex][writemask][idx]) {
unsigned tgsi_tex = util_pipe_tex_to_tgsi_tex(pipe_tex, 0);
+ /* OpenGL does not allow blits from signed to unsigned integer
+ * or vice versa. */
ctx->fs[pipe_tex][writemask][idx] =
util_make_fragment_tex_shader_writemask(ctx->pipe, tgsi_tex,
TGSI_INTERPOLATE_LINEAR,
writemask,
- stype);
+ stype, stype);
}
cso_set_fragment_shader_handle(ctx->cso, ctx->fs[pipe_tex][writemask][idx]);