From 2cb149c2894679c5c7af81b40277f77cc0fb099d Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Fri, 27 Mar 2015 23:03:40 +1100 Subject: [PATCH] glsl: mark uniform and input interface blocks as read only Reviewed-by: Mark Janes Reviewed-by: Kenneth Graunke --- src/glsl/ast_to_hir.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index d387b2e3565..036ec17dee7 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -5776,6 +5776,9 @@ ast_interface_block::hir(exec_list *instructions, var->data.matrix_layout = matrix_layout == GLSL_MATRIX_LAYOUT_INHERITED ? GLSL_MATRIX_LAYOUT_COLUMN_MAJOR : matrix_layout; + if (var_mode == ir_var_shader_in || var_mode == ir_var_uniform) + var->data.read_only = true; + if (state->stage == MESA_SHADER_GEOMETRY && var_mode == ir_var_shader_in) handle_geometry_shader_input_decl(state, loc, var); @@ -5816,6 +5819,9 @@ ast_interface_block::hir(exec_list *instructions, var->data.sample = fields[i].sample; var->init_interface_type(block_type); + if (var_mode == ir_var_shader_in || var_mode == ir_var_uniform) + var->data.read_only = true; + if (fields[i].matrix_layout == GLSL_MATRIX_LAYOUT_INHERITED) { var->data.matrix_layout = matrix_layout == GLSL_MATRIX_LAYOUT_INHERITED ? GLSL_MATRIX_LAYOUT_COLUMN_MAJOR : matrix_layout; -- 2.30.2