summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2017-06-09 22:19:33 +0200
committerMarek Olšák <marek.olsak@amd.com>2017-06-22 01:51:02 +0200
commit585c5cf8a514783d9ed31dba3aa432797dd5f0e8 (patch)
tree498d2a9bf82c35ab7caf86fe09ab9b8a97fc0ecf /src/mesa/drivers/dri/i915
parentab784e0feeaa6af46afc5ee6ce3527324de29dea (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 <nicolai.haehnle@amd.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Diffstat (limited to 'src/mesa/drivers/dri/i915')
-rw-r--r--src/mesa/drivers/dri/i915/i915_context.c4
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index 4d89af182d5..4f6bdb74e7c 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -27,6 +27,7 @@
#include "i915_context.h"
#include "main/api_exec.h"
+#include "main/framebuffer.h"
#include "main/imports.h"
#include "main/macros.h"
#include "main/version.h"
@@ -62,6 +63,9 @@ i915InvalidateState(struct gl_context * ctx)
_tnl_invalidate_vertex_state(ctx, new_state);
intel_context(ctx)->NewGLState |= new_state;
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
/* Todo: gather state values under which tracked parameters become
* invalidated, add callbacks for things like
* ProgramLocalParameters, etc.
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 7f3924573f9..e0766a0e3f3 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -324,6 +324,9 @@ intelInvalidateState(struct gl_context * ctx)
intel->NewGLState |= new_state;
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
if (intel->vtbl.invalidate_state)
intel->vtbl.invalidate_state( intel, new_state );
}