diff options
author | Marek Olšák <[email protected]> | 2017-06-09 22:19:33 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-06-22 01:51:02 +0200 |
commit | 585c5cf8a514783d9ed31dba3aa432797dd5f0e8 (patch) | |
tree | 498d2a9bf82c35ab7caf86fe09ab9b8a97fc0ecf /src/mesa/main | |
parent | ab784e0feeaa6af46afc5ee6ce3527324de29dea (diff) |
mesa: don't update draw buffer bounds in _mesa_update_state
st/mesa doesn't need the draw bounds for draw calls. I've added the call
where it's necessary in core Mesa and drivers, but I suspect that most
drivers can just move the call to the right places.
The core Mesa places aren't hot paths, so the call overhead doesn't matter
there.
For now, only st/mesa is made such that this function is invoked very
rarely.
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')
-rw-r--r-- | src/mesa/main/accum.c | 5 | ||||
-rw-r--r-- | src/mesa/main/state.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index c0a3e7ea72a..2b15b6ee0d3 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -28,6 +28,7 @@ #include "context.h" #include "format_unpack.h" #include "format_pack.h" +#include "framebuffer.h" #include "imports.h" #include "macros.h" #include "state.h" @@ -73,6 +74,8 @@ _mesa_clear_accum_buffer(struct gl_context *ctx) if (!accRb) return; /* missing accum buffer, not an error */ + _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer); + /* bounds, with scissor */ x = ctx->DrawBuffer->_Xmin; y = ctx->DrawBuffer->_Ymin; @@ -398,6 +401,8 @@ accum(struct gl_context *ctx, GLenum op, GLfloat value) if (!_mesa_check_conditional_render(ctx)) return; + _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer); + xpos = ctx->DrawBuffer->_Xmin; ypos = ctx->DrawBuffer->_Ymin; width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 79727983f1f..8df03f075fd 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -336,9 +336,6 @@ _mesa_update_state_locked( struct gl_context *ctx ) if (new_state & _NEW_BUFFERS) _mesa_update_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer); - if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT)) - _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer); - if (new_state & _NEW_LIGHT) _mesa_update_lighting( ctx ); |