summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/viewport.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-10 02:39:06 +0200
committerMarek Olšák <[email protected]>2017-06-22 01:51:02 +0200
commit29db5c1dcc5940fd18e72d1a7295cbb9edb424d8 (patch)
tree86d13624db607744af3ae8d43b411cfcbcd93485 /src/mesa/main/viewport.c
parentc8363eb0276c863100a457b18fee5ef900cf6f74 (diff)
mesa: don't flag _NEW_VIEWPORT for st/mesa if possible
Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/viewport.c')
-rw-r--r--src/mesa/main/viewport.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index 6d3e57654cc..51ae6692f7b 100644
--- a/src/mesa/main/viewport.c
+++ b/src/mesa/main/viewport.c
@@ -40,7 +40,8 @@ set_viewport_no_notify(struct gl_context *ctx, unsigned idx,
GLfloat x, GLfloat y,
GLfloat width, GLfloat height)
{
- FLUSH_VERTICES(ctx, _NEW_VIEWPORT);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewViewport ? 0 : _NEW_VIEWPORT);
+ ctx->NewDriverState |= ctx->DriverFlags.NewViewport;
/* clamp width and height to the implementation dependent range */
width = MIN2(width, (GLfloat) ctx->Const.MaxViewportWidth);
@@ -241,7 +242,9 @@ set_depth_range_no_notify(struct gl_context *ctx, unsigned idx,
ctx->ViewportArray[idx].Far == farval)
return;
+ /* The depth range is needed by program state constants. */
FLUSH_VERTICES(ctx, _NEW_VIEWPORT);
+ ctx->NewDriverState |= ctx->DriverFlags.NewViewport;
ctx->ViewportArray[idx].Near = CLAMP(nearval, 0.0, 1.0);
ctx->ViewportArray[idx].Far = CLAMP(farval, 0.0, 1.0);
@@ -449,7 +452,9 @@ _mesa_ClipControl(GLenum origin, GLenum depth)
return;
/* Affects transform state and the viewport transform */
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM | _NEW_VIEWPORT);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewClipControl ? 0 :
+ _NEW_TRANSFORM | _NEW_VIEWPORT);
+ ctx->NewDriverState |= ctx->DriverFlags.NewClipControl;
if (ctx->Transform.ClipOrigin != origin) {
ctx->Transform.ClipOrigin = origin;