diff options
Diffstat (limited to 'src/mesa/main/attrib.c')
| -rw-r--r-- | src/mesa/main/attrib.c | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index ab99ca1c64..246c5521b7 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -57,6 +57,7 @@  #include "varray.h"  #include "viewport.h"  #include "mtypes.h" +#include "glapi/dispatch.h"  /** @@ -74,6 +75,7 @@ struct gl_enable_attrib     GLboolean Convolution2D;     GLboolean Separable2D;     GLboolean CullFace; +   GLboolean DepthClamp;     GLboolean DepthTest;     GLboolean Dither;     GLboolean Fog; @@ -173,6 +175,9 @@ struct texture_state  }; +#if FEATURE_attrib_stack + +  /**   * Allocate new attribute node of given type/kind.  Attach payload data.   * Insert it into the linked list named by 'head'. @@ -265,6 +270,7 @@ _mesa_PushAttrib(GLbitfield mask)        attr->Convolution2D = ctx->Pixel.Convolution2DEnabled;        attr->Separable2D = ctx->Pixel.Separable2DEnabled;        attr->CullFace = ctx->Polygon.CullFlag; +      attr->DepthClamp = ctx->Transform.DepthClamp;        attr->DepthTest = ctx->Depth.Test;        attr->Dither = ctx->Color.DitherFlag;        attr->Fog = ctx->Fog.Enabled; @@ -514,6 +520,8 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)                     enable->ColorTable[COLORTABLE_POSTCOLORMATRIX],                     GL_POST_COLOR_MATRIX_COLOR_TABLE);     TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE); +   TEST_AND_UPDATE(ctx->Transform.DepthClamp, enable->DepthClamp, +		   GL_DEPTH_CLAMP);     TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);     TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);     TEST_AND_UPDATE(ctx->Pixel.Convolution1DEnabled, enable->Convolution1D, @@ -1221,6 +1229,9 @@ _mesa_PopAttrib(void)                 if (xform->RescaleNormals != ctx->Transform.RescaleNormals)                    _mesa_set_enable(ctx, GL_RESCALE_NORMAL_EXT,                                     ctx->Transform.RescaleNormals); +               if (xform->DepthClamp != ctx->Transform.DepthClamp) +                  _mesa_set_enable(ctx, GL_DEPTH_CLAMP, +                                   ctx->Transform.DepthClamp);              }              break;           case GL_TEXTURE_BIT: @@ -1457,6 +1468,19 @@ _mesa_PopClientAttrib(void)  } +void +_mesa_init_attrib_dispatch(struct _glapi_table *disp) +{ +   SET_PopAttrib(disp, _mesa_PopAttrib); +   SET_PushAttrib(disp, _mesa_PushAttrib); +   SET_PopClientAttrib(disp, _mesa_PopClientAttrib); +   SET_PushClientAttrib(disp, _mesa_PushClientAttrib); +} + + +#endif /* FEATURE_attrib_stack */ + +  /**   * Free any attribute state data that might be attached to the context.   */ | 
