[Mesa-dev] [PATCH v2 08/31] glsl: allow bindless samplers/images as out and inout parameters

Timothy Arceri tarceri at itsqueeze.com
Wed Apr 26 02:25:57 UTC 2017


On 24/04/17 20:35, Samuel Pitoiset wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>   src/compiler/glsl/ast_to_hir.cpp | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> index e4b076f700..24ad4b117c 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -5548,7 +5548,8 @@ ast_parameter_declarator::hir(exec_list *instructions,
>       *    assigned into."
>       */

Please update to comment above.

 From the ARB_bindless_texture spec:

    "Samplers can be used as l-values, so can be assigned into and used
    as "out" and "inout" function parameters.

    ...

    Images can be used as l-values, so can be assigned into and used as
    "out" and "inout" function parameters."

With that:

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>


>      if ((var->data.mode == ir_var_function_inout || var->data.mode == ir_var_function_out)
> -       && type->contains_opaque()) {
> +       && (type->contains_atomic() ||
> +           (!state->has_bindless() && type->contains_opaque()))) {
>         _mesa_glsl_error(&loc, state, "out and inout parameters cannot "
>                          "contain opaque variables");
>         type = glsl_type::error_type;
> 


More information about the mesa-dev mailing list