#include "compiler/glsl/glsl_to_nir.h"
#include "compiler/glsl/gl_nir.h"
#include "compiler/glsl/ir.h"
+#include "compiler/glsl/ir_optimization.h"
#include "compiler/glsl/string_to_uint_map.h"
struct gl_linked_shader *shader)
{
struct st_context *st = st_context(ctx);
+ struct pipe_screen *pscreen = ctx->st->pipe->screen;
struct gl_program *prog;
validate_ir_tree(shader->ir);
_mesa_generate_parameters_list_for_uniforms(ctx, shader_program, shader,
prog->Parameters);
+ /* Remove reads from output registers. */
+ if (!pscreen->get_param(pscreen, PIPE_CAP_TGSI_CAN_READ_OUTPUTS))
+ lower_output_reads(shader->Stage, shader->ir);
+
if (ctx->_Shader->Flags & GLSL_DUMP) {
_mesa_log("\n");
_mesa_log("GLSL IR for linked %s program %d:\n",