radeonsi: bypass the shader cache for NIR shaders
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 19 May 2017 15:28:54 +0000 (17:28 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 31 Jul 2017 12:55:33 +0000 (14:55 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 07c6d43b759213b0beee25197d89dba5dd926929..5a0ead1313a55614c6b69d1fc04920283929b344 100644 (file)
@@ -1800,7 +1800,7 @@ void si_init_shader_selector_async(void *job, int thread_index)
         */
        if (!sscreen->use_monolithic_shaders) {
                struct si_shader *shader = CALLOC_STRUCT(si_shader);
-               void *tgsi_binary;
+               void *tgsi_binary = NULL;
 
                if (!shader) {
                        fprintf(stderr, "radeonsi: can't allocate a main shader part\n");
@@ -1810,7 +1810,8 @@ void si_init_shader_selector_async(void *job, int thread_index)
                shader->selector = sel;
                si_parse_next_shader_property(&sel->info, &shader->key);
 
-               tgsi_binary = si_get_tgsi_binary(sel);
+               if (sel->tokens)
+                       tgsi_binary = si_get_tgsi_binary(sel);
 
                /* Try to load the shader from the shader cache. */
                mtx_lock(&sscreen->shader_cache_mutex);