freedreno/a6xx: Handle driver-params in GS/DS
Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
This commit is contained in:
@@ -293,22 +293,48 @@ fd6_build_user_consts(struct fd6_emit *emit)
|
||||
}
|
||||
|
||||
struct fd_ringbuffer *
|
||||
fd6_build_vs_driver_params(struct fd6_emit *emit)
|
||||
fd6_build_driver_params(struct fd6_emit *emit)
|
||||
{
|
||||
struct fd_context *ctx = emit->ctx;
|
||||
struct fd6_context *fd6_ctx = fd6_context(ctx);
|
||||
const struct ir3_shader_variant *vs = emit->vs;
|
||||
unsigned num_dp = 0;
|
||||
|
||||
if (vs->need_driver_params) {
|
||||
struct fd_ringbuffer *dpconstobj = fd_submit_new_ringbuffer(
|
||||
ctx->batch->submit, (4 + IR3_DP_VS_COUNT) * 4, FD_RINGBUFFER_STREAMING);
|
||||
ir3_emit_driver_params(vs, dpconstobj, ctx, emit->info, emit->indirect, emit->draw);
|
||||
fd6_ctx->has_dp_state = true;
|
||||
return dpconstobj;
|
||||
if (emit->vs->need_driver_params)
|
||||
num_dp++;
|
||||
|
||||
if (emit->gs && emit->gs->need_driver_params)
|
||||
num_dp++;
|
||||
|
||||
if (emit->ds && emit->ds->need_driver_params)
|
||||
num_dp++;
|
||||
|
||||
if (!num_dp) {
|
||||
fd6_ctx->has_dp_state = false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fd6_ctx->has_dp_state = false;
|
||||
return NULL;
|
||||
unsigned size_dwords = num_dp * (4 + IR3_DP_VS_COUNT); /* 4dw PKT7 header */
|
||||
struct fd_ringbuffer *dpconstobj = fd_submit_new_ringbuffer(
|
||||
ctx->batch->submit, size_dwords * 4, FD_RINGBUFFER_STREAMING);
|
||||
|
||||
if (emit->vs->need_driver_params) {
|
||||
ir3_emit_driver_params(emit->vs, dpconstobj, ctx, emit->info,
|
||||
emit->indirect, emit->draw);
|
||||
}
|
||||
|
||||
if (emit->gs && emit->gs->need_driver_params) {
|
||||
ir3_emit_driver_params(emit->gs, dpconstobj, ctx, emit->info,
|
||||
emit->indirect, emit->draw);
|
||||
}
|
||||
|
||||
if (emit->ds && emit->ds->need_driver_params) {
|
||||
ir3_emit_driver_params(emit->ds, dpconstobj, ctx, emit->info,
|
||||
emit->indirect, emit->draw);
|
||||
}
|
||||
|
||||
fd6_ctx->has_dp_state = true;
|
||||
|
||||
return dpconstobj;
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -30,7 +30,7 @@
|
||||
struct fd_ringbuffer *fd6_build_tess_consts(struct fd6_emit *emit) assert_dt;
|
||||
struct fd_ringbuffer *fd6_build_user_consts(struct fd6_emit *emit) assert_dt;
|
||||
struct fd_ringbuffer *
|
||||
fd6_build_vs_driver_params(struct fd6_emit *emit) assert_dt;
|
||||
fd6_build_driver_params(struct fd6_emit *emit) assert_dt;
|
||||
|
||||
void fd6_emit_cs_consts(const struct ir3_shader_variant *v,
|
||||
struct fd_ringbuffer *ring, struct fd_context *ctx,
|
||||
|
@@ -220,7 +220,11 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
|
||||
emit.fs = fd6_emit_get_prog(&emit)->fs;
|
||||
|
||||
if (emit.vs->need_driver_params || fd6_ctx->has_dp_state)
|
||||
emit.dirty_groups |= BIT(FD6_GROUP_VS_DRIVER_PARAMS);
|
||||
emit.dirty_groups |= BIT(FD6_GROUP_DRIVER_PARAMS);
|
||||
else if (emit.gs && emit.gs->need_driver_params)
|
||||
emit.dirty_groups |= BIT(FD6_GROUP_DRIVER_PARAMS);
|
||||
else if (emit.ds && emit.ds->need_driver_params)
|
||||
emit.dirty_groups |= BIT(FD6_GROUP_DRIVER_PARAMS);
|
||||
|
||||
/* If we are doing xfb, we need to emit the xfb state on every draw: */
|
||||
if (emit.prog->stream_output)
|
||||
|
@@ -1100,8 +1100,8 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit)
|
||||
case FD6_GROUP_CONST:
|
||||
state = fd6_build_user_consts(emit);
|
||||
break;
|
||||
case FD6_GROUP_VS_DRIVER_PARAMS:
|
||||
state = fd6_build_vs_driver_params(emit);
|
||||
case FD6_GROUP_DRIVER_PARAMS:
|
||||
state = fd6_build_driver_params(emit);
|
||||
break;
|
||||
case FD6_GROUP_PRIMITIVE_PARAMS:
|
||||
state = fd6_build_tess_consts(emit);
|
||||
|
@@ -53,7 +53,7 @@ enum fd6_state_id {
|
||||
FD6_GROUP_VTXSTATE,
|
||||
FD6_GROUP_VBO,
|
||||
FD6_GROUP_CONST,
|
||||
FD6_GROUP_VS_DRIVER_PARAMS,
|
||||
FD6_GROUP_DRIVER_PARAMS,
|
||||
FD6_GROUP_PRIMITIVE_PARAMS,
|
||||
FD6_GROUP_VS_TEX,
|
||||
FD6_GROUP_HS_TEX,
|
||||
|
Reference in New Issue
Block a user