[Mesa-dev] [PATCH] i965/blorp: Add a format parameter to blorp_fast_clear

Jason Ekstrand jason at jlekstrand.net
Tue Aug 23 18:08:00 UTC 2016


We were inferring the format from the surface but that doesn't always work
as the surface format is the texture format and we want the render format
(which may be different on i965).

Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
Cc: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/blorp.h       | 2 +-
 src/mesa/drivers/dri/i965/blorp_clear.c | 4 ++--
 src/mesa/drivers/dri/i965/brw_blorp.c   | 4 +++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/blorp.h b/src/mesa/drivers/dri/i965/blorp.h
index c20e2be..22b5760 100644
--- a/src/mesa/drivers/dri/i965/blorp.h
+++ b/src/mesa/drivers/dri/i965/blorp.h
@@ -68,7 +68,7 @@ brw_blorp_blit(struct brw_context *brw,
 void
 blorp_fast_clear(struct brw_context *brw,
                  const struct brw_blorp_surf *surf,
-                 uint32_t level, uint32_t layer,
+                 uint32_t level, uint32_t layer, enum isl_format format,
                  uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1);
 
 void
diff --git a/src/mesa/drivers/dri/i965/blorp_clear.c b/src/mesa/drivers/dri/i965/blorp_clear.c
index 2da08f8..9e6b2a9 100644
--- a/src/mesa/drivers/dri/i965/blorp_clear.c
+++ b/src/mesa/drivers/dri/i965/blorp_clear.c
@@ -99,7 +99,7 @@ brw_blorp_params_get_clear_kernel(struct brw_context *brw,
 
 void
 blorp_fast_clear(struct brw_context *brw, const struct brw_blorp_surf *surf,
-                 uint32_t level, uint32_t layer,
+                 uint32_t level, uint32_t layer, enum isl_format format,
                  uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1)
 {
    struct brw_blorp_params params;
@@ -119,7 +119,7 @@ blorp_fast_clear(struct brw_context *brw, const struct brw_blorp_surf *surf,
    brw_blorp_params_get_clear_kernel(brw, &params, true);
 
    brw_blorp_surface_info_init(brw, &params.dst, surf, level, layer,
-                               surf->surf->format, true);
+                               format, true);
 
    brw_blorp_exec(brw, &params);
 }
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index f4c2740..b504861 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -647,7 +647,9 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
       DBG("%s (fast) to mt %p level %d layer %d\n", __FUNCTION__,
           irb->mt, irb->mt_level, irb->mt_layer);
 
-      blorp_fast_clear(brw, &surf, level, layer, x0, y0, x1, y1);
+      blorp_fast_clear(brw, &surf, level, layer,
+                       brw->render_target_format[format],
+                       x0, y0, x1, y1);
 
       /* Now that the fast clear has occurred, put the buffer in
        * INTEL_FAST_CLEAR_STATE_CLEAR so that we won't waste time doing
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list