diff options
author | Timothy Arceri <[email protected]> | 2020-01-07 14:38:14 +1100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-21 01:57:34 +0000 |
commit | 95f555a93a8891ebba2a291eecd984eb2364d636 (patch) | |
tree | e23d864f888ba3892b04856871e82209085302d9 /src/mesa | |
parent | 0f79e0f7c62d4ac34e6a4a827b5433402cf7c223 (diff) |
st/glsl_to_nir: make use of nir linker for linking uniforms
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4395>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_nir.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 40560082873..cf27da7e0c7 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -661,18 +661,14 @@ st_link_nir(struct gl_context *ctx, stp->shader_program = shader_program; stp->state.type = PIPE_SHADER_IR_NIR; - if (shader_program->data->spirv) { - prog->Parameters = _mesa_new_parameter_list(); - /* Parameters will be filled during NIR linking. */ + /* Parameters will be filled during NIR linking. */ + prog->Parameters = _mesa_new_parameter_list(); + if (shader_program->data->spirv) { prog->nir = _mesa_spirv_to_nir(ctx, shader_program, shader->Stage, options); } else { validate_ir_tree(shader->ir); - prog->Parameters = _mesa_new_parameter_list(); - _mesa_generate_parameters_list_for_uniforms(ctx, shader_program, shader, - prog->Parameters); - if (ctx->_Shader->Flags & GLSL_DUMP) { _mesa_log("\n"); _mesa_log("GLSL IR for linked %s program %d:\n", @@ -682,9 +678,6 @@ st_link_nir(struct gl_context *ctx, _mesa_log("\n\n"); } - prog->ExternalSamplersUsed = gl_external_samplers(prog); - _mesa_update_shader_textures_used(shader_program, prog); - prog->nir = glsl_to_nir(st->ctx, shader_program, shader->Stage, options); st_nir_preprocess(st, prog, shader_program, shader->Stage); } @@ -738,6 +731,12 @@ st_link_nir(struct gl_context *ctx, if (!gl_nir_link_glsl(ctx, shader_program)) return GL_FALSE; + for (unsigned i = 0; i < num_shaders; i++) { + struct gl_program *prog = linked_shader[i]->Program; + prog->ExternalSamplersUsed = gl_external_samplers(prog); + _mesa_update_shader_textures_used(shader_program, prog); + } + nir_build_program_resource_list(ctx, shader_program, false); } |