summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/attrib.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-02-15 23:30:23 +0100
committerMarek Olšák <maraeo@gmail.com>2011-03-29 12:04:55 +0200
commite5c6a92a12b5cd7db205d72039f58d302b0be9d5 (patch)
tree4131a362c087d9d8b45999e0bb3868b7ff2942f8 /src/mesa/main/attrib.c
parent3bdd12ecb57e9cdc2b21cd665fab14698c1c07df (diff)
mesa: implement clamping controls (ARB_color_buffer_float)
Squashed commit of the following: Author: Marek Olšák <maraeo@gmail.com> mesa: fix getteximage so that it doesn't clamp values mesa: update the compute_version function mesa: add display list support for ARB_color_buffer_float mesa: fix glGet query with GL_ALPHA_TEST_REF and ARB_color_buffer_float commit b2f6ddf907935b2594d2831ddab38cf57a1729ce Author: Luca Barbieri <luca@luca-barbieri.com> Date: Tue Aug 31 16:50:57 2010 +0200 mesa: document known possible deviations from ARB_color_buffer_float commit 5458935be800c1b19d1c9d1569dc4fa30a97e8b8 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Tue Aug 24 21:54:56 2010 +0200 mesa: expose GL_ARB_color_buffer_float commit aef5c3c6be6edd076e955e37c80905bc447f8a82 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Thu Aug 26 18:12:34 2010 +0200 mesa, mesa/st: handle read color clamping properly (I'll squash the st/mesa part to a separate commit. -Marek) We set IMAGE_CLAMP_BIT in the caller based on _ClampReadColor, where the operation mandates it. TODO: did I get the set of operations mandating it right? commit 3a9cb5e59b676b6148c50907ce6eef5441677e36 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Thu Aug 26 18:09:41 2010 +0200 mesa: respect color clamping in texenv programs (v2) Changes in v2: - Fix attributes other than vertex color sometimes getting clamped commit de26f9e47e886e176aab6e5a2c3d4481efb64362 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Thu Aug 26 18:05:53 2010 +0200 mesa: restore color clamps on glPopAttrib commit a55ac3c300c189616627c05d924c40a8b55bfafa Author: Luca Barbieri <luca@luca-barbieri.com> Date: Thu Aug 26 18:04:26 2010 +0200 mesa: clamp color queries if and only if fragment clamping is enabled commit 9940a3e31c2fb76cc3d28b15ea78dde369825107 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Wed Aug 25 00:00:16 2010 +0200 mesa: introduce derived _ClampXxxColor state resolving FIXED_ONLY To do this, we make ClampColor call FLUSH_VERTICES with the appropriate _NEW flag. We introduce _NEW_FRAG_CLAMP since fragment clamping has wide-ranging effects, despite being in the Color attrib group. This may be easily changed by s/_NEW_FRAG_CLAMP/_NEW_COLOR/g commit 6244c446e3beed5473b4e811d10787e4019f59d6 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Thu Aug 26 17:58:24 2010 +0200 mesa: add unclamped color parameters
Diffstat (limited to 'src/mesa/main/attrib.c')
-rw-r--r--src/mesa/main/attrib.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index ae7f633b8d8..340c06c979d 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -879,10 +879,10 @@ _mesa_PopAttrib(void)
color = (const struct gl_colorbuffer_attrib *) attr->data;
_mesa_ClearIndex((GLfloat) color->ClearIndex);
- _mesa_ClearColor(color->ClearColor[0],
- color->ClearColor[1],
- color->ClearColor[2],
- color->ClearColor[3]);
+ _mesa_ClearColor(color->ClearColorUnclamped[0],
+ color->ClearColorUnclamped[1],
+ color->ClearColorUnclamped[2],
+ color->ClearColorUnclamped[3]);
_mesa_IndexMask(color->IndexMask);
if (!ctx->Extensions.EXT_draw_buffers2) {
_mesa_ColorMask((GLboolean) (color->ColorMask[0][0] != 0),
@@ -930,7 +930,7 @@ _mesa_PopAttrib(void)
_mesa_DrawBuffer(color->DrawBuffer[0]);
}
_mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled);
- _mesa_AlphaFunc(color->AlphaFunc, color->AlphaRef);
+ _mesa_AlphaFunc(color->AlphaFunc, color->AlphaRefUnclamped);
if (ctx->Color.BlendEnabled != color->BlendEnabled) {
if (ctx->Extensions.EXT_draw_buffers2) {
GLuint i;
@@ -976,16 +976,18 @@ _mesa_PopAttrib(void)
color->Blend[0].EquationA);
}
}
- _mesa_BlendColor(color->BlendColor[0],
- color->BlendColor[1],
- color->BlendColor[2],
- color->BlendColor[3]);
+ _mesa_BlendColor(color->BlendColorUnclamped[0],
+ color->BlendColorUnclamped[1],
+ color->BlendColorUnclamped[2],
+ color->BlendColorUnclamped[3]);
_mesa_LogicOp(color->LogicOp);
_mesa_set_enable(ctx, GL_COLOR_LOGIC_OP,
color->ColorLogicOpEnabled);
_mesa_set_enable(ctx, GL_INDEX_LOGIC_OP,
color->IndexLogicOpEnabled);
_mesa_set_enable(ctx, GL_DITHER, color->DitherFlag);
+ _mesa_ClampColorARB(GL_CLAMP_FRAGMENT_COLOR_ARB, color->ClampFragmentColor);
+ _mesa_ClampColorARB(GL_CLAMP_READ_COLOR_ARB, color->ClampReadColor);
}
break;
case GL_CURRENT_BIT:
@@ -1108,6 +1110,7 @@ _mesa_PopAttrib(void)
/* materials */
memcpy(&ctx->Light.Material, &light->Material,
sizeof(struct gl_material));
+ _mesa_ClampColorARB(GL_CLAMP_VERTEX_COLOR_ARB, light->ClampVertexColor);
}
break;
case GL_LINE_BIT: