[Mesa-dev] [PATCH] glsl: mark uniform and input interface blocks as read only
Kenneth Graunke
kenneth at whitecape.org
Fri Mar 27 15:41:41 PDT 2015
On Saturday, March 28, 2015 12:16:25 AM Timothy Arceri wrote:
> ---
>
> Piglit tests:
>
> http://lists.freedesktop.org/archives/piglit/2015-March/015369.html
>
> 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 d9ce6c9..49bddc4 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -5775,6 +5775,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);
>
> @@ -5815,6 +5818,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;
>
Looks good to me as well,
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150327/694f6e41/attachment.sig>
More information about the mesa-dev
mailing list