diff options
author | Jason Ekstrand <[email protected]> | 2020-03-17 13:36:40 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-18 21:05:07 +0000 |
commit | 3fb8f1948167c77f05f89b3a0933cbe2a1280b8d (patch) | |
tree | 63dcdb9b3388ffc49cc708e61a4b95f345acd1ce /src/intel | |
parent | bf2eb3e0eee39e79f5426dfa18d9d3b7f9dfbcb2 (diff) |
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>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/blorp/blorp.h | 3 | ||||
-rw-r--r-- | src/intel/blorp/blorp_clear.c | 9 | ||||
-rw-r--r-- | src/intel/vulkan/anv_blorp.c | 4 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h index 9ab537177fb..dd31ef2e2dc 100644 --- a/src/intel/blorp/blorp.h +++ b/src/intel/blorp/blorp.h @@ -166,7 +166,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 6999101c58e..e95f30b747d 100644 --- a/src/intel/blorp/blorp_clear.c +++ b/src/intel/blorp/blorp_clear.c @@ -334,7 +334,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) { @@ -360,6 +361,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 8cbe6aaaa89..0409ef099ea 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; |