freedreno: Add tess_state support

Add support for setting default tess params, used by passthrough TCS.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19259>
This commit is contained in:
Rob Clark 2022-10-22 12:28:02 -07:00 committed by Marge Bot
parent 38c747ce3d
commit 18b02cbc25
2 changed files with 25 additions and 1 deletions

View file

@ -251,7 +251,9 @@ struct fd_context {
struct list_head acc_active_queries dt;
/*@}*/
uint8_t patch_vertices;
float default_outer_level[4] dt;
float default_inner_level[2] dt;
uint8_t patch_vertices dt;
/* Whether we need to recheck the active_queries list next
* fd_batch_update_queries().

View file

@ -43,6 +43,27 @@ update_bound_stage(struct fd_context *ctx, enum pipe_shader_type shader,
}
}
static void
fd_set_tess_state(struct pipe_context *pctx,
const float default_outer_level[4],
const float default_inner_level[2])
in_dt
{
struct fd_context *ctx = fd_context(pctx);
/* These turn into driver-params where are emitted on every draw if
* needed by the shader (they will only be needed by pass-through
* TCS shader)
*/
memcpy(ctx->default_outer_level,
default_outer_level,
sizeof(ctx->default_outer_level));
memcpy(ctx->default_inner_level,
default_inner_level,
sizeof(ctx->default_inner_level));
}
static void
fd_set_patch_vertices(struct pipe_context *pctx, uint8_t patch_vertices) in_dt
{
@ -212,6 +233,7 @@ fd_prog_init(struct pipe_context *pctx)
pctx->bind_tes_state = fd_tes_state_bind;
pctx->bind_gs_state = fd_gs_state_bind;
pctx->bind_fs_state = fd_fs_state_bind;
pctx->set_tess_state = fd_set_tess_state;
pctx->set_patch_vertices = fd_set_patch_vertices;
if (ctx->flags & PIPE_CONTEXT_COMPUTE_ONLY)