diff options
author | Marek Olšák <[email protected]> | 2017-08-18 20:16:03 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-08-22 13:29:47 +0200 |
commit | a65afda768f64e2034e400cff5c0cc8dfef1c353 (patch) | |
tree | 5293c42d998e1ccea2e2236f15f083e765181a35 | |
parent | fdef2f0fd19ac6f2715a802d1e14b8ddfa094f11 (diff) |
radeonsi/gfx9: prevent shader-db crashes
- don't precompile LS and ES (they don't exist on GFX9), compile as VS instead
- don't precompile HS and GS (we don't have LS and ES parts)
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_shaders.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 968e231b8b8..45b321b0a61 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -1876,7 +1876,11 @@ void si_init_shader_selector_async(void *job, int thread_index) } /* Pre-compilation. */ - if (sscreen->b.debug_flags & DBG_PRECOMPILE) { + if (sscreen->b.debug_flags & DBG_PRECOMPILE && + /* GFX9 needs LS or ES for compilation, which we don't have here. */ + (sscreen->b.chip_class <= VI || + (sel->type != PIPE_SHADER_TESS_CTRL && + sel->type != PIPE_SHADER_GEOMETRY))) { struct si_shader_ctx_state state = {sel}; struct si_shader_key key; @@ -1885,6 +1889,12 @@ void si_init_shader_selector_async(void *job, int thread_index) sel->so.num_outputs != 0, &key); + /* GFX9 doesn't have LS and ES. */ + if (sscreen->b.chip_class >= GFX9) { + key.as_ls = 0; + key.as_es = 0; + } + /* Set reasonable defaults, so that the shader key doesn't * cause any code to be eliminated. */ |