[Mesa-dev] [PATCH 2/8] glsl: move block validation outside function that validates members
Emil Velikov
emil.l.velikov at gmail.com
Tue Nov 17 10:01:09 PST 2015
On 13 November 2015 at 01:13, Timothy Arceri <t_arceri at yahoo.com.au> wrote:
> From: Timothy Arceri <timothy.arceri at collabora.com>
>
> ---
> src/glsl/ast_to_hir.cpp | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index f4c53b4..60f415d 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -5816,14 +5816,6 @@ ast_process_structure_or_interface_block(exec_list *instructions,
> {
> unsigned decl_count = 0;
>
> - /* For blocks that accept memory qualifiers (i.e. shader storage), verify
> - * that we don't have incompatible qualifiers
> - */
> - if (layout && layout->flags.q.read_only && layout->flags.q.write_only) {
> - _mesa_glsl_error(&loc, state,
> - "Interface block sets both readonly and writeonly");
> - }
> -
> /* Make an initial pass over the list of fields to determine how
> * many there are. Each element in this list is an ast_declarator_list.
> * This means that we actually need to count the number of elements in the
> @@ -6239,6 +6231,14 @@ ast_interface_block::hir(exec_list *instructions,
> */
> state->struct_specifier_depth++;
>
> + /* For blocks that accept memory qualifiers (i.e. shader storage), verify
> + * that we don't have incompatible qualifiers
> + */
> + if (this->layout.flags.q.read_only && this->layout.flags.q.write_only) {
> + _mesa_glsl_error(&loc, state,
When I was looking in this area I've noticed that loc isn't properly
initialised (seems to contain 0s). Obviously not part of this patch
yet mildly related.
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
-Emil
More information about the mesa-dev
mailing list