diff options
author | Rafael Antognolli <rafael.antognolli@intel.com> | 2017-12-07 08:47:38 -0800 |
---|---|---|
committer | Rafael Antognolli <rafael.antognolli@intel.com> | 2018-02-21 10:29:12 -0800 |
commit | 8b10aae0279108f082b474f3c7dbd0448510cb4e (patch) | |
tree | 1b6339ed524882a041c233ca81d454eeb5a294ab | |
parent | e46ced5c1a2e593fcf36c97b7b272599dd7722e2 (diff) |
intel/blorp: Add suport for fast clear address.
On gen10+, if surface->clear_color_addr is present, use it directly
intead of copying it to the surface state.
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
-rw-r--r-- | src/intel/blorp/blorp_genX_exec.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h index 737720a70c..122dccd7ca 100644 --- a/src/intel/blorp/blorp_genX_exec.h +++ b/src/intel/blorp/blorp_genX_exec.h @@ -1281,11 +1281,15 @@ blorp_emit_surface_state(struct blorp_batch *batch, write_disable_mask |= ISL_CHANNEL_ALPHA_BIT; } + const bool use_clear_address = + GEN_GEN >= 10 && (surface->clear_color_addr.buffer != NULL); + isl_surf_fill_state(batch->blorp->isl_dev, state, .surf = &surf, .view = &surface->view, .aux_surf = &surface->aux_surf, .aux_usage = aux_usage, .mocs = surface->addr.mocs, .clear_color = surface->clear_color, + .use_clear_address = use_clear_address, .write_disables = write_disable_mask); blorp_surface_reloc(batch, state_offset + isl_dev->ss.addr_offset, @@ -1305,9 +1309,11 @@ blorp_emit_surface_state(struct blorp_batch *batch, blorp_flush_range(batch, state, GENX(RENDER_SURFACE_STATE_length) * 4); if (surface->clear_color_addr.buffer) { -#if GEN_GEN > 10 - unreachable("Implement indirect clear support on gen11+"); -#elif GEN_GEN >= 7 && GEN_GEN <= 10 +#if GEN_GEN >= 10 + assert((surface->clear_color_addr.offset & 0x3f) == 0); + blorp_surface_reloc(batch, state_offset + isl_dev->ss.clear_value_offset, + surface->clear_color_addr, 0); +#elif GEN_GEN >= 7 && GEN_GEN < 10 struct blorp_address dst_addr = blorp_get_surface_base_address(batch); dst_addr.offset += state_offset + isl_dev->ss.clear_value_offset; blorp_emit_memcpy(batch, dst_addr, surface->clear_color_addr, |