diff options
author | Dave Airlie <[email protected]> | 2011-09-14 11:08:57 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-09-14 11:18:08 +0100 |
commit | 81a86aea4f0990a1b8795f9e00e7a6c4ba368281 (patch) | |
tree | 9798a61c65a74aba6790849544afcd6b32e15f51 /src/mesa/swrast/s_clear.c | |
parent | 093dc9e548537e6c77e33064a584f849ad90dfa5 (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_clear.c')
-rw-r--r-- | src/mesa/swrast/s_clear.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/mesa/swrast/s_clear.c b/src/mesa/swrast/s_clear.c index 16d1cdbfcc8..980d29bbade 100644 --- a/src/mesa/swrast/s_clear.c +++ b/src/mesa/swrast/s_clear.c @@ -60,10 +60,7 @@ clear_rgba_buffer_with_masking(struct gl_context *ctx, struct gl_renderbuffer *r span.array->ChanType = rb->DataType; if (span.array->ChanType == GL_UNSIGNED_BYTE) { GLubyte clearColor[4]; - UNCLAMPED_FLOAT_TO_UBYTE(clearColor[RCOMP], ctx->Color.ClearColor.f[0]); - UNCLAMPED_FLOAT_TO_UBYTE(clearColor[GCOMP], ctx->Color.ClearColor.f[1]); - UNCLAMPED_FLOAT_TO_UBYTE(clearColor[BCOMP], ctx->Color.ClearColor.f[2]); - UNCLAMPED_FLOAT_TO_UBYTE(clearColor[ACOMP], ctx->Color.ClearColor.f[3]); + _mesa_unclamped_float_rgba_to_ubyte(clearColor, ctx->Color.ClearColor.f); for (i = 0; i < width; i++) { COPY_4UBV(span.array->rgba[i], clearColor); } @@ -127,10 +124,7 @@ clear_rgba_buffer(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint buf switch (rb->DataType) { case GL_UNSIGNED_BYTE: - UNCLAMPED_FLOAT_TO_UBYTE(clear8[0], ctx->Color.ClearColor.f[0]); - UNCLAMPED_FLOAT_TO_UBYTE(clear8[1], ctx->Color.ClearColor.f[1]); - UNCLAMPED_FLOAT_TO_UBYTE(clear8[2], ctx->Color.ClearColor.f[2]); - UNCLAMPED_FLOAT_TO_UBYTE(clear8[3], ctx->Color.ClearColor.f[3]); + _mesa_unclamped_float_rgba_to_ubyte(clear8, ctx->Color.ClearColor.f); clearVal = clear8; break; case GL_UNSIGNED_SHORT: |