Mesa (master): glsl: add new gl_nir_link_glsl() helper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 6 23:11:26 UTC 2020


Module: Mesa
Branch: master
Commit: ed325ac4dd5dbe5ea17cec09ed89e4bf903e5a1d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ed325ac4dd5dbe5ea17cec09ed89e4bf903e5a1d

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Mon Dec 23 11:03:35 2019 +1100

glsl: add new gl_nir_link_glsl() helper

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 <apinheiro at igalia.com>

---

 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);




More information about the mesa-commit mailing list