summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_clear.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-03-19 12:40:10 -0700
committerEric Anholt <[email protected]>2013-04-30 11:59:23 -0700
commite56095dc2e40d6d1e37e123c694a609d16932b4a (patch)
tree00223e227895e5643b5a5e480964e90cafae9b8e /src/mesa/drivers/dri/i965/brw_clear.c
parente34c857639380303a43146a50cdd724774f59a2f (diff)
i965: Implement color clears using a simple shader in blorp.
The upside is less CPU overhead in fiddling with GL error handling, the ability to use the constant color write message in most cases, and no GLSL clear shaders appearing in MESA_GLSL=dump output. The downside is more batch flushing and a total recompute of GL state at the end of blorp. However, if we're ever going to use the fast color clear feature of CMS surfaces, we'll need this anyway since it requires very special state setup. This increases the fail rate of some the GLES3conform ARB_sync tests, because of the initial flush at the start of blorp. The tests already intermittently failed (because it's just a bad testing procedure), and we can return it to its previous fail rate by fixing the initial flush. Improves GLB2.7 performance 0.37% +/- 0.11% (n=71/70, outlier removed). v2: Rename the key member, use the core helper for sRGB, and use BRW_MASK_* enums, fix comment and indentation (review by Paul). v3: Rewrite a comment, drop a silly temporary variable (review by Ken) Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_clear.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_clear.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c
index c0ac69d1537..4ee456a3275 100644
--- a/src/mesa/drivers/dri/i965/brw_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_clear.c
@@ -41,6 +41,7 @@
#include "intel_regions.h"
#include "brw_context.h"
+#include "brw_blorp.h"
#define FILE_DEBUG_FLAG DEBUG_BLIT
@@ -243,6 +244,16 @@ brw_clear(struct gl_context *ctx, GLbitfield mask)
}
}
+ /* BLORP is currently only supported on Gen6+. */
+ if (intel->gen >= 6) {
+ if (mask & BUFFER_BITS_COLOR) {
+ if (brw_blorp_clear_color(intel, fb)) {
+ debug_mask("blorp color", mask & BUFFER_BITS_COLOR);
+ mask &= ~BUFFER_BITS_COLOR;
+ }
+ }
+ }
+
GLbitfield tri_mask = mask & (BUFFER_BITS_COLOR |
BUFFER_BIT_STENCIL |
BUFFER_BIT_DEPTH);