[Mesa-dev] [PATCH v2 09/31] glsl: allow bindless samplers/images as function return

Timothy Arceri tarceri at itsqueeze.com
Wed Apr 26 02:34:24 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 24ad4b117c..b100ded836 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -5723,7 +5723,8 @@ ast_function::hir(exec_list *instructions,
>       *    "[Opaque types] can only be declared as function parameters
>       *     or uniform-qualified variables."
>       */

Please update the comment above. I don't think there is a spec quote but 
you can use the explanation Nicolai gave in his review to the V1 series 
about the entire section being replace etc.

> -   if (return_type->contains_opaque()) {
> +   if (return_type->contains_atomic() ||
> +       (!state->has_bindless() && return_type->contains_opaque())) {
>         YYLTYPE loc = this->get_location();
>         _mesa_glsl_error(&loc, state,
>                          "function `%s' return type can't contain an opaque type",

I think you should change the error message here and in the previous 2 
patch to something like:

  _mesa_glsl_error(&loc, state,
                   "function `%s' return type can't contain an %s type", 
.., state->has_bindless() ? "atomic" : "opaque");


With these changes:

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


More information about the mesa-dev mailing list