Module: Mesa Branch: staging/20.0 Commit: 7eb4b33a9af7086701884975927209bfb93636b6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7eb4b33a9af7086701884975927209bfb93636b6
Author: Jason Ekstrand <[email protected]> Date: Tue Mar 17 13:36:40 2020 -0500 intel/blorp: Add support for swizzling fast-clear colors Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4218> (cherry picked from commit 3fb8f1948167c77f05f89b3a0933cbe2a1280b8d) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_clear.c | 1 + src/intel/blorp/blorp.h | 3 ++- src/intel/blorp/blorp_clear.c | 9 ++++++++- src/intel/vulkan/anv_blorp.c | 4 ++-- src/mesa/drivers/dri/i965/brw_blorp.c | 1 + 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d2238b7cfc3..a6c32821524 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -328,7 +328,7 @@ "description": "intel/blorp: Add support for swizzling fast-clear colors", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c index a27dc30d69c..3b4099df796 100644 --- a/src/gallium/drivers/iris/iris_clear.c +++ b/src/gallium/drivers/iris/iris_clear.c @@ -315,6 +315,7 @@ fast_clear_color(struct iris_context *ice, * conversion in convert_fast_clear_color(). */ blorp_fast_clear(&blorp_batch, &surf, isl_format_srgb_to_linear(format), + ISL_SWIZZLE_IDENTITY, level, box->z, box->depth, box->x, box->y, box->x + box->width, box->y + box->height); diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h index afee0a96a8c..da2a96a8589 100644 --- a/src/intel/blorp/blorp.h +++ b/src/intel/blorp/blorp.h @@ -165,7 +165,8 @@ swizzle_color_value(union isl_color_value src, struct isl_swizzle swizzle); void blorp_fast_clear(struct blorp_batch *batch, - const struct blorp_surf *surf, enum isl_format format, + const struct blorp_surf *surf, + enum isl_format format, struct isl_swizzle swizzle, uint32_t level, uint32_t start_layer, uint32_t num_layers, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1); diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c index b8a68ffdbec..1e48958a2b4 100644 --- a/src/intel/blorp/blorp_clear.c +++ b/src/intel/blorp/blorp_clear.c @@ -332,7 +332,8 @@ get_fast_clear_rect(const struct isl_device *dev, void blorp_fast_clear(struct blorp_batch *batch, - const struct blorp_surf *surf, enum isl_format format, + const struct blorp_surf *surf, + enum isl_format format, struct isl_swizzle swizzle, uint32_t level, uint32_t start_layer, uint32_t num_layers, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1) { @@ -358,6 +359,12 @@ blorp_fast_clear(struct blorp_batch *batch, start_layer, format, true); params.num_samples = params.dst.surf.samples; + /* If a swizzle was provided, we need to swizzle the clear color so that + * the hardware color format conversion will work properly. + */ + params.dst.clear_color = swizzle_color_value(params.dst.clear_color, + swizzle); + batch->blorp->exec(batch, ¶ms); } diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index c2fed12aa1d..db15743e97c 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -1782,7 +1782,7 @@ anv_image_mcs_op(struct anv_cmd_buffer *cmd_buffer, switch (mcs_op) { case ISL_AUX_OP_FAST_CLEAR: - blorp_fast_clear(&batch, &surf, format, + blorp_fast_clear(&batch, &surf, format, ISL_SWIZZLE_IDENTITY, 0, base_layer, layer_count, 0, 0, image->extent.width, image->extent.height); break; @@ -1863,7 +1863,7 @@ anv_image_ccs_op(struct anv_cmd_buffer *cmd_buffer, switch (ccs_op) { case ISL_AUX_OP_FAST_CLEAR: - blorp_fast_clear(&batch, &surf, format, + blorp_fast_clear(&batch, &surf, format, ISL_SWIZZLE_IDENTITY, level, base_layer, layer_count, 0, 0, level_width, level_height); break; diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c index 33729430638..7ca0e8f0bb1 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.c +++ b/src/mesa/drivers/dri/i965/brw_blorp.c @@ -1307,6 +1307,7 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb, struct blorp_batch batch; blorp_batch_init(&brw->blorp, &batch, brw, 0); blorp_fast_clear(&batch, &surf, isl_format_srgb_to_linear(isl_format), + ISL_SWIZZLE_IDENTITY, level, irb->mt_layer, num_layers, x0, y0, x1, y1); blorp_batch_finish(&batch); _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
