From f71e93db0ab2d00602fe5235fad6583887ffd754 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 1 Nov 2019 22:09:23 -0400 Subject: [PATCH] st/mesa: initialize affected_states and uniform storage earlier in deserialize This matches the uncached codepath. affected_states was used before initialization, which was technically a bug, but probably not reproducible due to _NEW_PROGRAM rebinding everything. Acked-by: Pierre-Eric Pelloux-Prayer --- src/mesa/state_tracker/st_shader_cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c index 1d544470a94..5cd969f3fe5 100644 --- a/src/mesa/state_tracker/st_shader_cache.c +++ b/src/mesa/state_tracker/st_shader_cache.c @@ -182,6 +182,9 @@ st_deserialise_ir_program(struct gl_context *ctx, const struct nir_shader_compiler_options *options = ctx->Const.ShaderCompilerOptions[prog->info.stage].NirOptions; + st_set_prog_affected_state_flags(prog); + _mesa_associate_uniform_storage(ctx, shProg, prog); + assert(prog->driver_cache_blob && prog->driver_cache_blob_size > 0); struct blob_reader blob_reader; @@ -267,9 +270,6 @@ st_deserialise_ir_program(struct gl_context *ctx, } } - st_set_prog_affected_state_flags(prog); - _mesa_associate_uniform_storage(ctx, shProg, prog); - st_finalize_program(st, prog); } -- 2.30.2