summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/freedreno/freedreno_context.h
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2014-10-21 10:30:49 -0400
committerRob Clark <robclark@freedesktop.org>2014-10-21 20:08:49 -0400
commit01b757e2b0fb97a146b0ef278b449cecab0d15e8 (patch)
treea2b0089ba5f796a23ecb558f88ab72ba17daaede /src/gallium/drivers/freedreno/freedreno_context.h
parent1ab6543431b5a4eaf589cdabf2227088dd62ce6f (diff)
freedreno: clear vs scissor
The optimization of avoiding restore (mem2gmem) if there was a clear falls down a bit if you don't have a fullscreen scissor. We need to make the decision logic a bit more clever to keep track of *what* was cleared, so that we can (a) completely skip mem2gmem if entire buffer was cleared, or (b) skip mem2gmem on a per-tile basis for tiles that were completely cleared. Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_context.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_context.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h
index be2c2638a1..22d950c090 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.h
+++ b/src/gallium/drivers/freedreno/freedreno_context.h
@@ -182,6 +182,10 @@ struct fd_context {
* there was a glClear() that invalidated the entire previous buffer
* contents. Keep track of which buffer(s) are cleared, or needs
* restore. Masks of PIPE_CLEAR_*
+ *
+ * The 'cleared' bits will be set for buffers which are *entirely*
+ * cleared, and 'partial_cleared' bits will be set if you must
+ * check cleared_scissor.
*/
enum {
/* align bitmask values w/ PIPE_CLEAR_*.. since that is convenient.. */
@@ -189,7 +193,7 @@ struct fd_context {
FD_BUFFER_DEPTH = PIPE_CLEAR_DEPTH,
FD_BUFFER_STENCIL = PIPE_CLEAR_STENCIL,
FD_BUFFER_ALL = FD_BUFFER_COLOR | FD_BUFFER_DEPTH | FD_BUFFER_STENCIL,
- } cleared, restore, resolve;
+ } cleared, partial_cleared, restore, resolve;
bool needs_flush;
@@ -276,6 +280,14 @@ struct fd_context {
*/
struct pipe_scissor_state max_scissor;
+ /* Track the cleared scissor for color/depth/stencil, so we know
+ * which, if any, tiles need to be restored (mem2gmem). Only valid
+ * if the corresponding bit in ctx->cleared is set.
+ */
+ struct {
+ struct pipe_scissor_state color, depth, stencil;
+ } cleared_scissor;
+
/* Current gmem/tiling configuration.. gets updated on render_tiles()
* if out of date with current maximal-scissor/cpp:
*/