[Mesa-dev] [PATCH] glsl: Make read_from_write_only_variable_visitor ignore .length().
Iago Toral
itoral at igalia.com
Tue Jan 12 02:33:47 PST 2016
Makes sense,
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
On Mon, 2016-01-11 at 16:15 -0800, Kenneth Graunke wrote:
> .length() on an unsized SSBO variable doesn't actually read any data
> from the SSBO, and is allowed on variables marked 'writeonly'.
>
> Fixes compute shader compilation in Shadow of Mordor.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
> src/glsl/ast_to_hir.cpp | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index f3966d7..13696a3 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -106,6 +106,15 @@ public:
> return found;
> }
>
> + virtual ir_visitor_status visit_enter(ir_expression *ir)
> + {
> + /* .length() doesn't actually read anything */
> + if (ir->operation == ir_unop_ssbo_unsized_array_length)
> + return visit_continue_with_parent;
> +
> + return visit_continue;
> + }
> +
> private:
> ir_variable *found;
> };
More information about the mesa-dev
mailing list