radeonsi: move handling of DBG_NO_OPT_VARIANT into si_shader_selector_key
authorMarek Olšák <marek.olsak@amd.com>
Fri, 26 May 2017 23:22:25 +0000 (01:22 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Jun 2017 16:43:42 +0000 (18:43 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 5a22add0abc6a97650c40c121834a6c197f04781..55e881ca52957e0e7459e42f667d566154b1df13 100644 (file)
@@ -1438,6 +1438,9 @@ static inline void si_shader_selector_key(struct pipe_context *ctx,
        default:
                assert(0);
        }
+
+       if (unlikely(sctx->screen->b.debug_flags & DBG_NO_OPT_VARIANT))
+               memset(&key->opt, 0, sizeof(key->opt));
 }
 
 static void si_build_shader_variant(void *job, int thread_index)
@@ -1533,10 +1536,6 @@ static int si_shader_select_with_key(struct si_screen *sscreen,
        struct si_shader *current = state->current;
        struct si_shader *iter, *shader = NULL;
 
-       if (unlikely(sscreen->b.debug_flags & DBG_NO_OPT_VARIANT)) {
-               memset(&key->opt, 0, sizeof(key->opt));
-       }
-
 again:
        /* Check if we don't need to change anything.
         * This path is also used for most shaders that don't need multiple