From 87214414fd584aac80bb88f337ba119cac5109f3 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 23 Aug 2016 17:13:07 -0700 Subject: [PATCH] intel/blorp: Add a format parameter to blorp_fast_clear This allows us to use the actual render format as opposed to the texture format. I don't know that the hardware actually cares in the case of fast clears, but it certainly seems more correct. Signed-off-by: Jason Ekstrand Reviewed-by: Topi Pohjolainen --- src/intel/blorp/blorp.h | 2 +- src/intel/blorp/blorp_clear.c | 4 ++-- src/mesa/drivers/dri/i965/brw_blorp.c | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h index a4fcfdfcf70..12f18332883 100644 --- a/src/intel/blorp/blorp.h +++ b/src/intel/blorp/blorp.h @@ -111,7 +111,7 @@ blorp_blit(struct blorp_batch *batch, void blorp_fast_clear(struct blorp_batch *batch, const struct 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/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c index a371dfd31ef..831c8ed0a6e 100644 --- a/src/intel/blorp/blorp_clear.c +++ b/src/intel/blorp/blorp_clear.c @@ -209,7 +209,7 @@ get_fast_clear_rect(const struct isl_device *dev, void blorp_fast_clear(struct blorp_batch *batch, const struct 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 blorp_params params; @@ -229,7 +229,7 @@ blorp_fast_clear(struct blorp_batch *batch, blorp_params_get_clear_kernel(batch->blorp, ¶ms, true); brw_blorp_surface_info_init(batch->blorp, ¶ms.dst, surf, level, layer, - surf->surf->format, true); + format, true); batch->blorp->exec(batch, ¶ms); } diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c index 905383b7a3c..c902f2e2ec4 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.c +++ b/src/mesa/drivers/dri/i965/brw_blorp.c @@ -733,7 +733,9 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb, struct blorp_batch batch; blorp_batch_init(&brw->blorp, &batch, brw); - blorp_fast_clear(&batch, &surf, level, layer, x0, y0, x1, y1); + blorp_fast_clear(&batch, &surf, level, layer, + (enum isl_format)brw->render_target_format[format], + x0, y0, x1, y1); blorp_batch_finish(&batch); /* Now that the fast clear has occurred, put the buffer in -- 2.30.2