diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-05-16 01:51:41 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-07-05 12:34:01 +0200 |
commit | b1d98e6d544a7120a2d27d5217acf6472c9fb077 (patch) | |
tree | daaf4c8bf5d2557cd02c65c9214f8bc30b5d7457 | |
parent | 95ee7e0cfef3c6891baf8526f1acf9b063859435 (diff) |
radeonsi: enable R600_DEBUG=nir for vertex and fragment shadersnir-v2
Also, disable geometry and tessellation shaders. Mixing and matching NIR
and TGSI shaders should work (and I've tested it for the VS/PS interface),
but geometry and tessellation requires VS-as-ES/LS, which isn't implemented
yet for NIR.
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 6 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index fd67d9ae1b..7a2a54b66c 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -730,6 +730,7 @@ void r600_common_context_cleanup(struct r600_common_context *rctx) static const struct debug_named_value common_debug_options[] = { /* logging */ { "tex", DBG_TEX, "Print texture info" }, + { "nir", DBG_NIR, "Enable experimental NIR shaders" }, { "compute", DBG_COMPUTE, "Print compute info" }, { "vm", DBG_VM, "Print virtual addresses when creating resources" }, { "info", DBG_INFO, "Print driver information" }, diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index b22a3a75cb..64588eb963 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -67,7 +67,7 @@ /* Debug flags. */ /* logging */ #define DBG_TEX (1 << 0) -/* gap - reuse */ +#define DBG_NIR (1 << 1) #define DBG_COMPUTE (1 << 2) #define DBG_VM (1 << 3) /* gap - reuse */ diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index beadb88c68..2c2e66b644 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -551,6 +551,8 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param) return 4; case PIPE_CAP_GLSL_FEATURE_LEVEL: + if (sscreen->b.debug_flags & DBG_NIR) + return 140; /* no geometry and tessellation shaders yet */ if (si_have_tgsi_compute(sscreen)) return 450; return 420; @@ -753,6 +755,10 @@ static int si_get_shader_param(struct pipe_screen* pscreen, case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: return 32; case PIPE_SHADER_CAP_PREFERRED_IR: + if (sscreen->b.debug_flags & DBG_NIR && + (shader == PIPE_SHADER_VERTEX || + shader == PIPE_SHADER_FRAGMENT)) + return PIPE_SHADER_IR_NIR; return PIPE_SHADER_IR_TGSI; case PIPE_SHADER_CAP_LOWER_IF_THRESHOLD: return 3; |