summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texparam.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-03-26 13:06:22 +0100
committerMarek Olšák <[email protected]>2011-03-29 12:50:27 +0200
commite28fe8fe5d05c87a065f8e72adef8b5077da2c73 (patch)
tree4b60862cf403c296160a32034f0f6657d6e4f33e /src/mesa/main/texparam.c
parentb518f4d0ea72dc3872f351250034aa9155756dd3 (diff)
mesa: clamp texture border color if ARB_texture_float is unsupported
ARB_texture_float disables clamping of the texture border color, ARB_color_buffer_float only modifies clamping of the glGet query.
Diffstat (limited to 'src/mesa/main/texparam.c')
-rw-r--r--src/mesa/main/texparam.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index adb6bcebfab..34b6addb9b0 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -534,10 +534,18 @@ set_tex_parameterf(struct gl_context *ctx,
case GL_TEXTURE_BORDER_COLOR:
flush(ctx);
- texObj->BorderColor.f[RCOMP] = params[0];
- texObj->BorderColor.f[GCOMP] = params[1];
- texObj->BorderColor.f[BCOMP] = params[2];
- texObj->BorderColor.f[ACOMP] = params[3];
+ /* ARB_texture_float disables clamping */
+ if (ctx->Extensions.ARB_texture_float) {
+ texObj->BorderColor.f[RCOMP] = params[0];
+ texObj->BorderColor.f[GCOMP] = params[1];
+ texObj->BorderColor.f[BCOMP] = params[2];
+ texObj->BorderColor.f[ACOMP] = params[3];
+ } else {
+ texObj->BorderColor.f[RCOMP] = CLAMP(params[0], 0.0F, 1.0F);
+ texObj->BorderColor.f[GCOMP] = CLAMP(params[1], 0.0F, 1.0F);
+ texObj->BorderColor.f[BCOMP] = CLAMP(params[2], 0.0F, 1.0F);
+ texObj->BorderColor.f[ACOMP] = CLAMP(params[3], 0.0F, 1.0F);
+ }
return GL_TRUE;
default: