From: Brian Date: Wed, 11 Jul 2007 15:56:46 +0000 (-0600) Subject: need to clamp floats to [0,1] in write functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=300e97081e7e752c0ff9133149d15935baac7a46;p=mesa.git need to clamp floats to [0,1] in write functions --- diff --git a/src/mesa/drivers/x11/xm_surface.c b/src/mesa/drivers/x11/xm_surface.c index 2bef5e6b9e6..8ae5c248f43 100644 --- a/src/mesa/drivers/x11/xm_surface.c +++ b/src/mesa/drivers/x11/xm_surface.c @@ -122,7 +122,7 @@ write_quad_f(struct softpipe_surface *gs, GLint x, GLint y, GLuint i; GET_CURRENT_CONTEXT(ctx); for (i = 0; i < 16; i++) { - temp[i] = FLOAT_TO_UBYTE(src[i]); + UNCLAMPED_FLOAT_TO_UBYTE(temp[i], src[i]); } xrb->Base.PutRow(ctx, &xrb->Base, 2, x, y, temp, NULL); xrb->Base.PutRow(ctx, &xrb->Base, 2, x, y + 1, temp + 8, NULL); @@ -140,7 +140,7 @@ write_quad_f_swz(struct softpipe_surface *gs, GLint x, GLint y, GET_CURRENT_CONTEXT(ctx); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { - temp[j * 4 + i] = FLOAT_TO_UBYTE(src[i * 4 + j]); + UNCLAMPED_FLOAT_TO_UBYTE(temp[j * 4 + i], src[i * 4 + j]); } } xrb->Base.PutRow(ctx, &xrb->Base, 2, x, y, temp, NULL);