summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_blend.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-09-14 11:08:57 +0100
committerDave Airlie <[email protected]>2011-09-14 11:18:08 +0100
commit81a86aea4f0990a1b8795f9e00e7a6c4ba368281 (patch)
tree9798a61c65a74aba6790849544afcd6b32e15f51 /src/mesa/swrast/s_blend.c
parent093dc9e548537e6c77e33064a584f849ad90dfa5 (diff)
mesa/colormac: introduce inline helper for 4 unclamped float to ubyte.
This introduces an UNCLAMPED_FLOAT_TO_UBYTE x 4 inline function, as suggested by Brian. It uses it in a few places I noticed from previous color changes, and also some core mesa places. I haven't updated other places yet. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/swrast/s_blend.c')
-rw-r--r--src/mesa/swrast/s_blend.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c
index 793921250ad..3760f91d64b 100644
--- a/src/mesa/swrast/s_blend.c
+++ b/src/mesa/swrast/s_blend.c
@@ -851,12 +851,8 @@ blend_general(struct gl_context *ctx, GLuint n, const GLubyte mask[],
blend_general_float(ctx, n, mask, rgbaF, destF, chanType);
/* convert back to ubytes */
for (i = 0; i < n; i++) {
- if (mask[i]) {
- UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][RCOMP], rgbaF[i][RCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][GCOMP], rgbaF[i][GCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][BCOMP], rgbaF[i][BCOMP]);
- UNCLAMPED_FLOAT_TO_UBYTE(rgba[i][ACOMP], rgbaF[i][ACOMP]);
- }
+ if (mask[i])
+ _mesa_unclamped_float_rgba_to_ubyte(rgba[i], rgbaF[i]);
}
}
else if (chanType == GL_UNSIGNED_SHORT) {