radeonsi: initialize the per-context compiler on demand
[mesa.git] / src / gallium / drivers / radeonsi / si_compute_prim_discard.c
index 0bbaf4f306da1d2105d1d7a181f932d226d9f237..31c18e098e6df2365e63e436af315e0d84265bc1 100644 (file)
@@ -939,6 +939,9 @@ static bool si_shader_select_prim_discard_cs(struct si_context *sctx,
        sctx->cs_prim_discard_state.cso = sctx->vs_shader.cso;
        sctx->cs_prim_discard_state.current = NULL;
 
+       if (!sctx->compiler.passes)
+               si_init_compiler(sctx->screen, &sctx->compiler);
+
        struct si_compiler_ctx_state compiler_state;
        compiler_state.compiler = &sctx->compiler;
        compiler_state.debug = sctx->debug;