check_resources(ctx, prog);
check_subroutine_resources(prog);
check_image_resources(ctx, prog);
- link_assign_atomic_counter_resources(ctx, prog);
- link_check_atomic_counter_resources(ctx, prog);
+
+ if (!ctx->Const.UseNIRGLSLLinker) {
+ link_assign_atomic_counter_resources(ctx, prog);
+ link_check_atomic_counter_resources(ctx, prog);
+ }
}
static bool
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;
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];