[Mesa-dev] [PATCH 18/25] intel/blorp: Add capability to use pre-baked binding tables
Jason Ekstrand
jason at jlekstrand.net
Sat Oct 22 17:50:49 UTC 2016
When a pre-baked binding table is requested, no binding table is created,
instead the binding table offset (relative to surface state base address)
provided by the user is used verbatim.
---
src/intel/blorp/blorp_genX_exec.h | 44 +++++++++++++++++++++------------------
src/intel/blorp/blorp_priv.h | 3 +++
2 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h
index 47267e5..d17c661 100644
--- a/src/intel/blorp/blorp_genX_exec.h
+++ b/src/intel/blorp/blorp_genX_exec.h
@@ -1107,28 +1107,32 @@ blorp_emit_surface_states(struct blorp_batch *batch,
uint32_t bind_offset, surface_offsets[2];
void *surface_maps[2];
- unsigned num_surfaces = 1 + params->src.enabled;
- blorp_alloc_binding_table(batch, num_surfaces,
- isl_dev->ss.size, isl_dev->ss.align,
- &bind_offset, surface_offsets, surface_maps);
-
- if (params->dst.enabled) {
- blorp_emit_surface_state(batch, ¶ms->dst,
- surface_maps[BLORP_RENDERBUFFER_BT_INDEX],
- surface_offsets[BLORP_RENDERBUFFER_BT_INDEX],
- true);
+ if (params->use_pre_baked_binding_table) {
+ bind_offset = params->pre_baked_binding_table_offset;
} else {
- assert(params->depth.enabled || params->stencil.enabled);
- const struct brw_blorp_surface_info *surface =
- params->depth.enabled ? ¶ms->depth : ¶ms->stencil;
- blorp_emit_null_surface_state(batch, surface,
- surface_maps[BLORP_RENDERBUFFER_BT_INDEX]);
- }
+ unsigned num_surfaces = 1 + params->src.enabled;
+ blorp_alloc_binding_table(batch, num_surfaces,
+ isl_dev->ss.size, isl_dev->ss.align,
+ &bind_offset, surface_offsets, surface_maps);
+
+ if (params->dst.enabled) {
+ blorp_emit_surface_state(batch, ¶ms->dst,
+ surface_maps[BLORP_RENDERBUFFER_BT_INDEX],
+ surface_offsets[BLORP_RENDERBUFFER_BT_INDEX],
+ true);
+ } else {
+ assert(params->depth.enabled || params->stencil.enabled);
+ const struct brw_blorp_surface_info *surface =
+ params->depth.enabled ? ¶ms->depth : ¶ms->stencil;
+ blorp_emit_null_surface_state(batch, surface,
+ surface_maps[BLORP_RENDERBUFFER_BT_INDEX]);
+ }
- if (params->src.enabled) {
- blorp_emit_surface_state(batch, ¶ms->src,
- surface_maps[BLORP_TEXTURE_BT_INDEX],
- surface_offsets[BLORP_TEXTURE_BT_INDEX], false);
+ if (params->src.enabled) {
+ blorp_emit_surface_state(batch, ¶ms->src,
+ surface_maps[BLORP_TEXTURE_BT_INDEX],
+ surface_offsets[BLORP_TEXTURE_BT_INDEX], false);
+ }
}
#if GEN_GEN >= 7
diff --git a/src/intel/blorp/blorp_priv.h b/src/intel/blorp/blorp_priv.h
index e364fe3..31e7aae 100644
--- a/src/intel/blorp/blorp_priv.h
+++ b/src/intel/blorp/blorp_priv.h
@@ -222,6 +222,9 @@ struct blorp_params
struct brw_vs_prog_data *vs_prog_data;
uint32_t wm_prog_kernel;
struct brw_blorp_prog_data *wm_prog_data;
+
+ bool use_pre_baked_binding_table;
+ uint32_t pre_baked_binding_table_offset;
};
void blorp_params_init(struct blorp_params *params);
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list