diff options
author | Dave Airlie <[email protected]> | 2011-09-12 10:57:40 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-09-14 11:18:07 +0100 |
commit | 093dc9e548537e6c77e33064a584f849ad90dfa5 (patch) | |
tree | 4a3ecd84f123cd89a29fea6700603a5da53d62cb /src/mesa/main/get.c | |
parent | b06613c6cc029c3ff200430b0706b5229c4508bd (diff) |
mesa: introduce a clear color union to be used for int/unsigned buffers
This introduces a new gl_color_union union and moves the current
ClearColorUnclamped to use it, it removes current ClearColor completely and
renames CCU to CC, then all drivers are modified to expected unclamped floats instead.
also fixes st to use translated color in one place it wasn't.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r-- | src/mesa/main/get.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 069254b18f5..a777bd8c403 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1673,10 +1673,13 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu COPY_4FV(v->value_float_4, ctx->Fog.ColorUnclamped); break; case GL_COLOR_CLEAR_VALUE: - if(ctx->Color._ClampFragmentColor) - COPY_4FV(v->value_float_4, ctx->Color.ClearColor); - else - COPY_4FV(v->value_float_4, ctx->Color.ClearColorUnclamped); + if(ctx->Color._ClampFragmentColor) { + v->value_float_4[0] = CLAMP(ctx->Color.ClearColor.f[0], 0.0F, 1.0F); + v->value_float_4[1] = CLAMP(ctx->Color.ClearColor.f[1], 0.0F, 1.0F); + v->value_float_4[2] = CLAMP(ctx->Color.ClearColor.f[2], 0.0F, 1.0F); + v->value_float_4[3] = CLAMP(ctx->Color.ClearColor.f[3], 0.0F, 1.0F); + } else + COPY_4FV(v->value_float_4, ctx->Color.ClearColor.f); break; case GL_BLEND_COLOR_EXT: if(ctx->Color._ClampFragmentColor) |