intel/blorp: Add plumbing for setting color clear layer count

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Topi Pohjolainen
2016-08-26 18:44:18 +03:00
parent 514afdce95
commit a1c7de09dc
3 changed files with 15 additions and 13 deletions

View File

@@ -110,14 +110,14 @@ blorp_blit(struct blorp_batch *batch,
void void
blorp_fast_clear(struct blorp_batch *batch, blorp_fast_clear(struct blorp_batch *batch,
const struct blorp_surf *surf, const struct blorp_surf *surf, enum isl_format format,
uint32_t level, uint32_t layer, enum isl_format format, uint32_t level, uint32_t start_layer, uint32_t num_layers,
uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1); uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1);
void void
blorp_clear(struct blorp_batch *batch, blorp_clear(struct blorp_batch *batch,
const struct blorp_surf *surf, const struct blorp_surf *surf,
uint32_t level, uint32_t layer, uint32_t level, uint32_t start_layer, uint32_t num_layers,
uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1,
enum isl_format format, union isl_color_value clear_color, enum isl_format format, union isl_color_value clear_color,
bool color_write_disable[4]); bool color_write_disable[4]);

View File

@@ -208,12 +208,13 @@ get_fast_clear_rect(const struct isl_device *dev,
void void
blorp_fast_clear(struct blorp_batch *batch, blorp_fast_clear(struct blorp_batch *batch,
const struct blorp_surf *surf, const struct blorp_surf *surf, enum isl_format format,
uint32_t level, uint32_t layer, enum isl_format format, uint32_t level, uint32_t start_layer, uint32_t num_layers,
uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1) uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1)
{ {
struct blorp_params params; struct blorp_params params;
blorp_params_init(&params); blorp_params_init(&params);
params.num_layers = num_layers;
params.x0 = x0; params.x0 = x0;
params.y0 = y0; params.y0 = y0;
@@ -228,8 +229,8 @@ blorp_fast_clear(struct blorp_batch *batch,
blorp_params_get_clear_kernel(batch->blorp, &params, true); blorp_params_get_clear_kernel(batch->blorp, &params, true);
brw_blorp_surface_info_init(batch->blorp, &params.dst, surf, level, layer, brw_blorp_surface_info_init(batch->blorp, &params.dst, surf, level,
format, true); start_layer, format, true);
batch->blorp->exec(batch, &params); batch->blorp->exec(batch, &params);
} }
@@ -238,13 +239,14 @@ blorp_fast_clear(struct blorp_batch *batch,
void void
blorp_clear(struct blorp_batch *batch, blorp_clear(struct blorp_batch *batch,
const struct blorp_surf *surf, const struct blorp_surf *surf,
uint32_t level, uint32_t layer, uint32_t level, uint32_t start_layer, uint32_t num_layers,
uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1,
enum isl_format format, union isl_color_value clear_color, enum isl_format format, union isl_color_value clear_color,
bool color_write_disable[4]) bool color_write_disable[4])
{ {
struct blorp_params params; struct blorp_params params;
blorp_params_init(&params); blorp_params_init(&params);
params.num_layers = num_layers;
params.x0 = x0; params.x0 = x0;
params.y0 = y0; params.y0 = y0;
@@ -276,8 +278,8 @@ blorp_clear(struct blorp_batch *batch,
blorp_params_get_clear_kernel(batch->blorp, &params, blorp_params_get_clear_kernel(batch->blorp, &params,
use_simd16_replicated_data); use_simd16_replicated_data);
brw_blorp_surface_info_init(batch->blorp, &params.dst, surf, level, layer, brw_blorp_surface_info_init(batch->blorp, &params.dst, surf, level,
format, true); start_layer, format, true);
batch->blorp->exec(batch, &params); batch->blorp->exec(batch, &params);
} }

View File

@@ -735,9 +735,9 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
struct blorp_batch batch; struct blorp_batch batch;
blorp_batch_init(&brw->blorp, &batch, brw); blorp_batch_init(&brw->blorp, &batch, brw);
blorp_fast_clear(&batch, &surf, level, layer, blorp_fast_clear(&batch, &surf,
(enum isl_format)brw->render_target_format[format], (enum isl_format)brw->render_target_format[format],
x0, y0, x1, y1); level, layer, 1, x0, y0, x1, y1);
blorp_batch_finish(&batch); blorp_batch_finish(&batch);
/* Now that the fast clear has occurred, put the buffer in /* Now that the fast clear has occurred, put the buffer in
@@ -754,7 +754,7 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
struct blorp_batch batch; struct blorp_batch batch;
blorp_batch_init(&brw->blorp, &batch, brw); blorp_batch_init(&brw->blorp, &batch, brw);
blorp_clear(&batch, &surf, level, layer, x0, y0, x1, y1, blorp_clear(&batch, &surf, level, layer, 1, x0, y0, x1, y1,
(enum isl_format)brw->render_target_format[format], (enum isl_format)brw->render_target_format[format],
clear_color, color_write_disable); clear_color, color_write_disable);
blorp_batch_finish(&batch); blorp_batch_finish(&batch);