summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2019-12-23 11:37:57 +1100
committerTimothy Arceri <[email protected]>2020-01-07 09:50:57 +1100
commita853de0c95d5dce7aee983efd243377ffe3a6e91 (patch)
tree63a1c2f84b50aaf10e9425ea7fa23deda517f517 /src/mesa
parent8f2cab7767d2f0bcbb194f5c72bf89652f32e0f0 (diff)
glsl: use nir linker to link atomics
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_context.c5
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp6
2 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 992f9fe00c9..72e1a50bca3 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -765,6 +765,11 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].PositionAlwaysInvariant = options->vs_position_always_invariant;
+ enum pipe_shader_ir preferred_ir = (enum pipe_shader_ir)
+ screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
+ PIPE_SHADER_CAP_PREFERRED_IR);
+ ctx->Const.UseNIRGLSLLinker = preferred_ir == PIPE_SHADER_IR_NIR;
+
if (ctx->Const.GLSLVersion < 400) {
for (i = 0; i < MESA_SHADER_STAGES; i++)
ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectSampler = true;
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 11b6db490b9..c92b1c365a7 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -736,8 +736,12 @@ st_link_nir(struct gl_context *ctx,
if (num_shaders == 1)
st_nir_opts(linked_shader[0]->Program->nir);
- if (!shader_program->data->spirv)
+ if (!shader_program->data->spirv) {
+ if (!gl_nir_link_glsl(ctx, shader_program))
+ return GL_FALSE;
+
nir_build_program_resource_list(ctx, shader_program, false);
+ }
for (unsigned i = 0; i < num_shaders; i++) {
struct gl_linked_shader *shader = linked_shader[i];