summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2019-09-19 13:25:00 -0700
committerRob Clark <[email protected]>2019-09-25 21:39:08 +0000
commit00cbb6db096088e604fac57110036c0a889c8b44 (patch)
tree3c7443bf021b67e4915667359696a87917b2415a /src/gallium/drivers/freedreno
parent2dc4d6c6921ce21ff379696f151fb18434800fee (diff)
freedreno: Add state binding functions for HS/DS/GS
Signed-off-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_context.h2
-rw-r--r--src/gallium/drivers/freedreno/freedreno_program.c30
2 files changed, 31 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h
index f353b932b96..f17797a8d2a 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.h
+++ b/src/gallium/drivers/freedreno/freedreno_context.h
@@ -55,7 +55,7 @@ struct fd_texture_stateobj {
};
struct fd_program_stateobj {
- void *vs, *fs;
+ void *vs, *hs, *ds, *gs, *fs;
};
struct fd_constbuf_stateobj {
diff --git a/src/gallium/drivers/freedreno/freedreno_program.c b/src/gallium/drivers/freedreno/freedreno_program.c
index 62fd55b1ac2..8567883fb77 100644
--- a/src/gallium/drivers/freedreno/freedreno_program.c
+++ b/src/gallium/drivers/freedreno/freedreno_program.c
@@ -48,6 +48,33 @@ fd_vs_state_bind(struct pipe_context *pctx, void *hwcso)
ctx->dirty |= FD_DIRTY_PROG;
}
+static void
+fd_tcs_state_bind(struct pipe_context *pctx, void *hwcso)
+{
+ struct fd_context *ctx = fd_context(pctx);
+ ctx->prog.hs = hwcso;
+ ctx->dirty_shader[PIPE_SHADER_TESS_CTRL] |= FD_DIRTY_SHADER_PROG;
+ ctx->dirty |= FD_DIRTY_PROG;
+}
+
+static void
+fd_tes_state_bind(struct pipe_context *pctx, void *hwcso)
+{
+ struct fd_context *ctx = fd_context(pctx);
+ ctx->prog.ds = hwcso;
+ ctx->dirty_shader[PIPE_SHADER_TESS_EVAL] |= FD_DIRTY_SHADER_PROG;
+ ctx->dirty |= FD_DIRTY_PROG;
+}
+
+static void
+fd_gs_state_bind(struct pipe_context *pctx, void *hwcso)
+{
+ struct fd_context *ctx = fd_context(pctx);
+ ctx->prog.gs = hwcso;
+ ctx->dirty_shader[PIPE_SHADER_GEOMETRY] |= FD_DIRTY_SHADER_PROG;
+ ctx->dirty |= FD_DIRTY_PROG;
+}
+
static const char *solid_fs =
"FRAG \n"
"PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1 \n"
@@ -128,6 +155,9 @@ void fd_prog_init(struct pipe_context *pctx)
pctx->bind_vs_state = fd_vs_state_bind;
pctx->bind_fs_state = fd_fs_state_bind;
+ pctx->bind_tcs_state = fd_tcs_state_bind;
+ pctx->bind_tes_state = fd_tes_state_bind;
+ pctx->bind_gs_state = fd_gs_state_bind;
ctx->solid_prog.fs = assemble_tgsi(pctx, solid_fs, true);
ctx->solid_prog.vs = assemble_tgsi(pctx, solid_vs, false);