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 | 5fc0e11053a57d0559f30c28399ba8a8403f12a9 (patch) | |
tree | c9e6de688b397746c54631d91faac1b96bc28d48 /src/mesa/state_tracker/st_atom_rasterizer.c | |
parent | 56088131d066ee29a15e8111bfce40ce45b42687 (diff) |
gallium: Enable ARB_clip_control for gallium drivers.
Gallium should be prepared fine for ARB_clip_control.
So enable this and mention it in the release notes.
v2:
Only enable for drivers announcing the freshly introduced
PIPE_CAP_CLIP_HALFZ capability.
v3:
Use extension enable infrastructure to connect PIPE_CAP_CLIP_HALFZ
with ARB_clip_control.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Mathias Froehlich <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_atom_rasterizer.c')
-rw-r--r-- | src/mesa/state_tracker/st_atom_rasterizer.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index dfa728b19ec..50209788bcd 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -72,6 +72,11 @@ static void update_raster_state( struct st_context *st ) { raster->front_ccw = (ctx->Polygon.FrontFace == GL_CCW); + /* _NEW_VIEWPORT */ + if (ctx->Transform.ClipOrigin == GL_UPPER_LEFT) { + raster->front_ccw ^= 1; + } + /* * Gallium's surfaces are Y=0=TOP orientation. OpenGL is the * opposite. Window system surfaces are Y=0=TOP. Mesa's FBOs @@ -241,6 +246,12 @@ static void update_raster_state( struct st_context *st ) raster->half_pixel_center = 1; if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) raster->bottom_edge_rule = 1; + /* _NEW_VIEWPORT */ + if (ctx->Transform.ClipOrigin == GL_UPPER_LEFT) + raster->bottom_edge_rule ^= 1; + + /* _NEW_VIEWPORT */ + raster->clip_halfz = (ctx->Transform.ClipDepthMode == GL_ZERO_TO_ONE); /* ST_NEW_RASTERIZER */ raster->rasterizer_discard = ctx->RasterDiscard; @@ -272,7 +283,8 @@ const struct st_tracked_state st_update_rasterizer = { _NEW_PROGRAM | _NEW_SCISSOR | _NEW_FRAG_CLAMP | - _NEW_TRANSFORM), /* mesa state dependencies*/ + _NEW_TRANSFORM | + _NEW_VIEWPORT), /* mesa state dependencies*/ (ST_NEW_VERTEX_PROGRAM | ST_NEW_RASTERIZER), /* state tracker dependencies */ }, |