glsl: add new gl_nir_link_glsl() helper
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 23 Dec 2019 00:03:35 +0000 (11:03 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 6 Jan 2020 21:39:16 +0000 (08:39 +1100)
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@igalia.com>
src/compiler/glsl/gl_nir_linker.c
src/compiler/glsl/gl_nir_linker.h

index 07aab9091db136cf59365af55c56e62708a09a55..65d3e162a3c52db7382bde4ca42f0350bdbdf7ca 100644 (file)
@@ -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;
+}
index ceb85785d4ad5c1767b38a0a7b588dfa17b87c57..9dae03779b91a699afd500cb892733b6fce2b9ca 100644 (file)
@@ -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);