mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 04:00:10 +01:00
freedreno/a3xx/compiler: split out old compiler
For the time being, keep old compiler as fallback for things that the new compiler does not support yet. Split out as it's own commit to make the later new-compiler commits easier to follow. Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
parent
a418573c4d
commit
f0e2d7ab46
6 changed files with 1531 additions and 1 deletions
|
|
@ -31,6 +31,7 @@ a2xx_SOURCES := \
|
|||
a3xx_SOURCES := \
|
||||
a3xx/fd3_blend.c \
|
||||
a3xx/fd3_compiler.c \
|
||||
a3xx/fd3_compiler_old.c \
|
||||
a3xx/fd3_context.c \
|
||||
a3xx/fd3_draw.c \
|
||||
a3xx/fd3_emit.c \
|
||||
|
|
|
|||
|
|
@ -35,5 +35,7 @@
|
|||
|
||||
int fd3_compile_shader(struct fd3_shader_stateobj *so,
|
||||
const struct tgsi_token *tokens);
|
||||
int fd3_compile_shader_old(struct fd3_shader_stateobj *so,
|
||||
const struct tgsi_token *tokens);
|
||||
|
||||
#endif /* FD3_COMPILER_H_ */
|
||||
|
|
|
|||
1507
src/gallium/drivers/freedreno/a3xx/fd3_compiler_old.c
Normal file
1507
src/gallium/drivers/freedreno/a3xx/fd3_compiler_old.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -106,7 +106,25 @@ create_shader(struct pipe_context *pctx, const struct pipe_shader_state *cso,
|
|||
if ((type == SHADER_FRAGMENT) && (fd_mesa_debug & FD_DBG_FRAGHALF))
|
||||
so->half_precision = true;
|
||||
|
||||
ret = fd3_compile_shader(so, tokens);
|
||||
|
||||
if (fd_mesa_debug & FD_DBG_OPTIMIZE) {
|
||||
ret = fd3_compile_shader(so, tokens);
|
||||
if (ret) {
|
||||
debug_error("new compiler failed, trying fallback!");
|
||||
|
||||
so->inputs_count = 0;
|
||||
so->outputs_count = 0;
|
||||
so->total_in = 0;
|
||||
so->samplers_count = 0;
|
||||
so->immediates_count = 0;
|
||||
}
|
||||
} else {
|
||||
ret = -1; /* force fallback to old compiler */
|
||||
}
|
||||
|
||||
if (ret)
|
||||
ret = fd3_compile_shader_old(so, tokens);
|
||||
|
||||
if (ret) {
|
||||
debug_error("compile failed!");
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ static const struct debug_named_value debug_options[] = {
|
|||
{"fraghalf", FD_DBG_FRAGHALF, "Use half-precision in fragment shader"},
|
||||
{"binning", FD_DBG_BINNING, "Enable hw binning"},
|
||||
{"dbinning", FD_DBG_DBINNING, "Disable hw binning"},
|
||||
{"optimize", FD_DBG_OPTIMIZE, "Enable optimization passes in compiler"},
|
||||
DEBUG_NAMED_VALUE_END
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ enum adreno_stencil_op fd_stencil_op(unsigned op);
|
|||
#define FD_DBG_FRAGHALF 0x0080
|
||||
#define FD_DBG_BINNING 0x0100
|
||||
#define FD_DBG_DBINNING 0x0200
|
||||
#define FD_DBG_OPTIMIZE 0x0400
|
||||
|
||||
extern int fd_mesa_debug;
|
||||
extern bool fd_binning_enabled;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue