[Mesa-dev] [PATCH v2 30/31] glsl: disable tree grafting optimization for bindless images

Nicolai Hähnle nhaehnle at gmail.com
Wed Apr 26 08:05:03 UTC 2017


On 24.04.2017 12:36, Samuel Pitoiset wrote:
> Because the variable declaration holds more information than
> the dereference. Note that an image is considered bindless either
> if it has been declared in the default uniform block with the
> bindless_sampler layout qualifier, or when its storage is not
> uniform because this is not allowed without ARB_bindless_texture.

It seems unfortunate that we have to do this. Can you explain what goes 
wrong without this change?

Thanks,
Nicolai


>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/compiler/glsl/opt_tree_grafting.cpp | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/compiler/glsl/opt_tree_grafting.cpp b/src/compiler/glsl/opt_tree_grafting.cpp
> index 28b6e1856e..d4a1ec5675 100644
> --- a/src/compiler/glsl/opt_tree_grafting.cpp
> +++ b/src/compiler/glsl/opt_tree_grafting.cpp
> @@ -371,6 +371,15 @@ tree_grafting_basic_block(ir_instruction *bb_first,
>        if (lhs_var->data.precise)
>           continue;
>
> +      if (lhs_var->type->is_image() &&
> +          (lhs_var->data.bindless || lhs_var->data.mode != ir_var_uniform)) {
> +         /* Disable tree grafting optimization for bindless image types because
> +          * the variable declaration holds more information than the
> +          * dereference.
> +          */
> +         continue;
> +      }
> +
>        ir_variable_refcount_entry *entry = info->refs->get_variable_entry(lhs_var);
>
>        if (!entry->declaration ||
>


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list