* 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);
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);
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)
{
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);
}
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;
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;
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);