diff options
author | Mathias Fröhlich <[email protected]> | 2014-09-21 18:09:22 +0200 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2014-10-24 19:21:21 +0200 |
commit | 34a3c97fe6d273d68d2ee80386791832824f3211 (patch) | |
tree | e81d1cc8c1f5107e223ff2ea350c3889e8ef52eb /src/mesa/main/state.c | |
parent | 6340e609a354770e04192b9b44e91fb06aab0159 (diff) |
mesa: Implement ARB_clip_control.
Implement the mesa parts of ARB_clip_control.
So far no driver enables this.
v3:
Restrict getting clip control state to the availability
of ARB_clip_control.
Move to transformation state.
Handle clip control state with the GL_TRANSFORM_BIT.
Move _FrontBit update into state.c.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Mathias Froehlich <[email protected]>
Diffstat (limited to 'src/mesa/main/state.c')
-rw-r--r-- | src/mesa/main/state.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 3dbbfaac76c..45bce78fd4a 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -292,6 +292,19 @@ update_viewport_matrix(struct gl_context *ctx) /** + * Update the ctx->Polygon._FrontBit flag. + */ +static void +update_frontbit(struct gl_context *ctx) +{ + if (ctx->Transform.ClipOrigin == GL_LOWER_LEFT) + ctx->Polygon._FrontBit = (ctx->Polygon.FrontFace == GL_CW); + else + ctx->Polygon._FrontBit = (ctx->Polygon.FrontFace == GL_CCW); +} + + +/** * Update derived multisample state. */ static void @@ -373,6 +386,9 @@ _mesa_update_state_locked( struct gl_context *ctx ) if (new_state & (_NEW_PROGRAM|_NEW_TEXTURE|_NEW_TEXTURE_MATRIX)) _mesa_update_texture( ctx, new_state ); + if (new_state & _NEW_POLYGON) + update_frontbit( ctx ); + if (new_state & _NEW_BUFFERS) _mesa_update_framebuffer(ctx); |