summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-08-22 11:23:51 -0700
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-09-10 14:36:46 -0700
commit1a12b0fe36fa50d8591c998723e25bdfbdea8b9e (patch)
tree9c9b20527c981b5ea6df8a508d80f5beee77d61f /src/mesa
parentb4b39d9859f96ea18fa14001b96b9fb865ba9576 (diff)
mesa/st: Don't expect prog->nir to already exist
There's no such case, if we load prog->nir from the shader cache, we shouldn't hit this path. Suggested-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index fead0ccc625..39203435515 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -633,6 +633,8 @@ st_link_nir(struct gl_context *ctx,
struct gl_program *prog = shader->Program;
_mesa_copy_linked_program_data(shader_program, shader);
+ assert(!prog->nir);
+
if (shader_program->data->spirv) {
const nir_shader_compiler_options *options =
st->ctx->Const.ShaderCompilerOptions[shader->Stage].NirOptions;
@@ -640,7 +642,6 @@ st_link_nir(struct gl_context *ctx,
prog->Parameters = _mesa_new_parameter_list();
/* Parameters will be filled during NIR linking. */
- /* TODO: Properly handle or dismiss `if (prog->nir)` case. */
prog->nir = _mesa_spirv_to_nir(ctx, shader_program, shader->Stage, options);
set_st_program(prog, shader_program, prog->nir);
} else {
@@ -670,11 +671,9 @@ st_link_nir(struct gl_context *ctx,
st->ctx->Const.ShaderCompilerOptions[prog->info.stage].NirOptions;
assert(options);
- if (!prog->nir) {
- prog->nir = glsl_to_nir(st->ctx, shader_program, shader->Stage, options);
- set_st_program(prog, shader_program, prog->nir);
- st_nir_preprocess(st, prog, shader_program, shader->Stage);
- }
+ prog->nir = glsl_to_nir(st->ctx, shader_program, shader->Stage, options);
+ set_st_program(prog, shader_program, prog->nir);
+ st_nir_preprocess(st, prog, shader_program, shader->Stage);
}
last_stage = i;