blorp,anv,iris: refactor blorp functions into something more generic
Refactor some of the blorp code into something more generic that we can reuse for functionality needed post 3DPRIMITIVE emission. Signed-off-by: Rohan Garg <rohan.garg@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25039>
This commit is contained in:
@@ -417,13 +417,13 @@ blorp_measure_end(struct blorp_batch *blorp_batch,
|
||||
}
|
||||
|
||||
static void
|
||||
blorp_emit_breakpoint_pre_draw(struct blorp_batch *batch)
|
||||
blorp_emit_pre_draw(struct blorp_batch *batch, const struct blorp_params *params)
|
||||
{
|
||||
/* "Not implemented" */
|
||||
}
|
||||
|
||||
static void
|
||||
blorp_emit_breakpoint_post_draw(struct blorp_batch *batch)
|
||||
blorp_emit_post_draw(struct blorp_batch *batch, const struct blorp_params *params)
|
||||
{
|
||||
/* "Not implemented" */
|
||||
}
|
||||
|
@@ -504,15 +504,17 @@ genX(init_blorp)(struct iris_context *ice)
|
||||
}
|
||||
|
||||
static void
|
||||
blorp_emit_breakpoint_pre_draw(struct blorp_batch *blorp_batch)
|
||||
blorp_emit_pre_draw(struct blorp_batch *blorp_batch, const struct blorp_params *params)
|
||||
{
|
||||
struct iris_batch *batch = blorp_batch->driver_batch;
|
||||
blorp_measure_start(blorp_batch, params);
|
||||
genX(maybe_emit_breakpoint)(batch, true);
|
||||
}
|
||||
|
||||
static void
|
||||
blorp_emit_breakpoint_post_draw(struct blorp_batch *blorp_batch)
|
||||
blorp_emit_post_draw(struct blorp_batch *blorp_batch, const struct blorp_params *params)
|
||||
{
|
||||
struct iris_batch *batch = blorp_batch->driver_batch;
|
||||
genX(maybe_emit_breakpoint)(batch, false);
|
||||
blorp_measure_end(blorp_batch, params);
|
||||
}
|
||||
|
@@ -124,9 +124,11 @@ blorp_emit_pipeline(struct blorp_batch *batch,
|
||||
const struct blorp_params *params);
|
||||
|
||||
static void
|
||||
blorp_emit_breakpoint_pre_draw(struct blorp_batch *batch);
|
||||
blorp_emit_pre_draw(struct blorp_batch *batch,
|
||||
const struct blorp_params *params);
|
||||
static void
|
||||
blorp_emit_breakpoint_post_draw(struct blorp_batch *batch);
|
||||
blorp_emit_post_draw(struct blorp_batch *batch,
|
||||
const struct blorp_params *params);
|
||||
|
||||
/***** BEGIN blorp_exec implementation ******/
|
||||
|
||||
@@ -2036,8 +2038,6 @@ blorp_exec_3d(struct blorp_batch *batch, const struct blorp_params *params)
|
||||
}
|
||||
#endif
|
||||
|
||||
blorp_measure_start(batch, params);
|
||||
|
||||
blorp_emit_vertex_buffers(batch, params);
|
||||
blorp_emit_vertex_elements(batch, params);
|
||||
|
||||
@@ -2049,8 +2049,7 @@ blorp_exec_3d(struct blorp_batch *batch, const struct blorp_params *params)
|
||||
blorp_emit_depth_stencil_config(batch, params);
|
||||
|
||||
const UNUSED bool use_tbimr = false;
|
||||
|
||||
blorp_emit_breakpoint_pre_draw(batch);
|
||||
blorp_emit_pre_draw(batch, params);
|
||||
blorp_emit(batch, GENX(3DPRIMITIVE), prim) {
|
||||
prim.VertexAccessType = SEQUENTIAL;
|
||||
prim.PrimitiveTopologyType = _3DPRIM_RECTLIST;
|
||||
@@ -2063,8 +2062,7 @@ blorp_exec_3d(struct blorp_batch *batch, const struct blorp_params *params)
|
||||
prim.VertexCountPerInstance = 3;
|
||||
prim.InstanceCount = params->num_layers;
|
||||
}
|
||||
blorp_emit_breakpoint_post_draw(batch);
|
||||
blorp_measure_end(batch, params);
|
||||
blorp_emit_post_draw(batch, params);
|
||||
}
|
||||
|
||||
#if GFX_VER >= 7
|
||||
|
@@ -458,15 +458,17 @@ genX(blorp_exec)(struct blorp_batch *batch,
|
||||
}
|
||||
|
||||
static void
|
||||
blorp_emit_breakpoint_pre_draw(struct blorp_batch *batch)
|
||||
blorp_emit_pre_draw(struct blorp_batch *batch, const struct blorp_params *params)
|
||||
{
|
||||
struct anv_cmd_buffer *cmd_buffer = batch->driver_batch;
|
||||
blorp_measure_start(batch, params);
|
||||
genX(emit_breakpoint)(&cmd_buffer->batch, cmd_buffer->device, true);
|
||||
}
|
||||
|
||||
static void
|
||||
blorp_emit_breakpoint_post_draw(struct blorp_batch *batch)
|
||||
blorp_emit_post_draw(struct blorp_batch *batch, const struct blorp_params *params)
|
||||
{
|
||||
struct anv_cmd_buffer *cmd_buffer = batch->driver_batch;
|
||||
genX(emit_breakpoint)(&cmd_buffer->batch, cmd_buffer->device, false);
|
||||
blorp_measure_end(batch, params);
|
||||
}
|
||||
|
@@ -373,13 +373,13 @@ genX(blorp_exec)(struct blorp_batch *batch,
|
||||
}
|
||||
|
||||
static void
|
||||
blorp_emit_breakpoint_pre_draw(struct blorp_batch *batch)
|
||||
blorp_emit_pre_draw(struct blorp_batch *batch, const struct blorp_params *params)
|
||||
{
|
||||
/* "Not implemented" */
|
||||
}
|
||||
|
||||
static void
|
||||
blorp_emit_breakpoint_post_draw(struct blorp_batch *batch)
|
||||
blorp_emit_post_draw(struct blorp_batch *batch, const struct blorp_params *params)
|
||||
{
|
||||
/* "Not implemented" */
|
||||
}
|
||||
|
Reference in New Issue
Block a user