From ed325ac4dd5dbe5ea17cec09ed89e4bf903e5a1d Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 23 Dec 2019 11:03:35 +1100 Subject: [PATCH] glsl: add new gl_nir_link_glsl() helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This will allow us to do some linking in NIR that was previously done by the GLSL IR linker. To start with this just has calls for linking atomics. Reviewed-by: Alejandro Piñeiro --- src/compiler/glsl/gl_nir_linker.c | 12 ++++++++++++ src/compiler/glsl/gl_nir_linker.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index 07aab9091db..65d3e162a3c 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -581,3 +581,15 @@ gl_nir_link_spirv(struct gl_context *ctx, struct gl_shader_program *prog, return true; } + +bool +gl_nir_link_glsl(struct gl_context *ctx, struct gl_shader_program *prog) +{ + gl_nir_link_assign_atomic_counter_resources(ctx, prog); + gl_nir_link_check_atomic_counter_resources(ctx, prog); + + if (prog->data->LinkStatus == LINKING_FAILURE) + return false; + + return true; +} diff --git a/src/compiler/glsl/gl_nir_linker.h b/src/compiler/glsl/gl_nir_linker.h index ceb85785d4a..9dae03779b9 100644 --- a/src/compiler/glsl/gl_nir_linker.h +++ b/src/compiler/glsl/gl_nir_linker.h @@ -39,6 +39,8 @@ bool gl_nir_link_spirv(struct gl_context *ctx, struct gl_shader_program *prog, const struct gl_nir_linker_options *options); +bool gl_nir_link_glsl(struct gl_context *ctx, struct gl_shader_program *prog); + bool gl_nir_link_uniforms(struct gl_context *ctx, struct gl_shader_program *prog, bool fill_parameters); -- 2.30.2