[Mesa-dev] [PATCH] glsl/ast: subroutineTypes can't be returned from functions.

Chris Forbes chrisf at ijw.co.nz
Mon May 23 02:55:16 UTC 2016


Reviewed-by: Chris Forbes <chrisforbes at google.com>

On Mon, May 23, 2016 at 2:15 PM, Dave Airlie <airlied at gmail.com> wrote:

> From: Dave Airlie <airlied at redhat.com>
>
> These types can't be returned.
>
> This fixes:
>
> GL43-CTS.shader_subroutine.subroutines_not_allowed_as_variables_constructors_and_argument_or_return_types
> for the return type case.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/compiler/glsl/ast_to_hir.cpp | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/compiler/glsl/ast_to_hir.cpp
> b/src/compiler/glsl/ast_to_hir.cpp
> index aa8e810..0ec5b70 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -5402,6 +5402,15 @@ ast_function::hir(exec_list *instructions,
>                         name);
>     }
>
> +   /**/
> +   if (return_type->is_subroutine()) {
> +      YYLTYPE loc = this->get_location();
> +      _mesa_glsl_error(&loc, state,
> +                       "function `%s' return type can't be a subroutine
> type",
> +                       name);
> +   }
> +
> +
>     /* Create an ir_function if one doesn't already exist. */
>     f = state->symbols->get_function(name);
>     if (f == NULL) {
> --
> 2.5.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160523/abc79333/attachment-0001.html>


More information about the mesa-dev mailing list