diff options
author | Rob Clark <[email protected]> | 2014-01-15 08:08:18 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2014-02-01 11:50:10 -0500 |
commit | 0f2df4ff90b255456cfd45f5582016744fbfd0f7 (patch) | |
tree | 8c0643444b09947e41d618041fd020eb036e4b70 /src/gallium/drivers/freedreno/a3xx | |
parent | 752475619997ce1d596dd0073d0fa5785d8f2646 (diff) |
freedreno: add tgsi lowering pass
Currently lowers the following instructions:
DST, XPD, SCS, LRP, FRC, POW, LIT, EXP, LOG, DP4,
DP3, DPH, DP2
translating these into equivalent simpler TGSI instructions.
This probably should be moved to util so other drivers can use
it, but just adding under freedreno for now so that I can clear
out a lot of the lowering code in a3xx compiler before beginning
to add new compiler.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a3xx')
-rw-r--r-- | src/gallium/drivers/freedreno/a3xx/fd3_program.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_program.c b/src/gallium/drivers/freedreno/a3xx/fd3_program.c index 0886c495d89..ad76b66e663 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_program.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_program.c @@ -34,6 +34,8 @@ #include "tgsi/tgsi_dump.h" #include "tgsi/tgsi_parse.h" +#include "freedreno_lowering.h" + #include "fd3_program.h" #include "fd3_compiler.h" #include "fd3_emit.h" @@ -87,6 +89,7 @@ create_shader(struct pipe_context *pctx, const struct pipe_shader_state *cso, enum shader_t type) { struct fd3_shader_stateobj *so = CALLOC_STRUCT(fd3_shader_stateobj); + const struct tgsi_token *tokens = fd_transform_lowering(cso->tokens); int ret; if (!so) @@ -96,13 +99,13 @@ create_shader(struct pipe_context *pctx, const struct pipe_shader_state *cso, if (fd_mesa_debug & FD_DBG_DISASM) { DBG("dump tgsi: type=%d", so->type); - tgsi_dump(cso->tokens, 0); + tgsi_dump(tokens, 0); } if ((type == SHADER_FRAGMENT) && (fd_mesa_debug & FD_DBG_FRAGHALF)) so->half_precision = true; - ret = fd3_compile_shader(so, cso->tokens); + ret = fd3_compile_shader(so, tokens); if (ret) { debug_error("compile failed!"); goto fail; |