[Mesa-dev] [PATCH 1/2] glsl: use without_array() rather than get_scalar_type()

Alejandro Piñeiro apinheiro at igalia.com
Wed Apr 26 06:37:12 UTC 2017


On 26/04/17 05:56, Timothy Arceri wrote:
> Here get_scalar_type() was just geing use to remove the array
> after that we converted it back to bast_type anyway so just

Typo: base_type (instead of bast_type)

> use the without_array() helper.

Makes sense, assuming no test regression:
Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>

> ---
>  src/compiler/glsl/ast_to_hir.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> index aeb223d..0ae87cb 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -3851,21 +3851,21 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
>         *     "Fragment inputs can only be signed and unsigned integers and
>         *     integer vectors, float, floating-point vectors, matrices, or
>         *     arrays of these. Structures cannot be input.
>         *
>         * Similar text exists in the section on vertex shader outputs.
>         *
>         * Similar text exists in the GLSL ES 3.00 spec, except that the GLSL ES
>         * 3.00 spec allows structs as well.  Varying structs are also allowed
>         * in GLSL 1.50.
>         */
> -      switch (var->type->get_scalar_type()->base_type) {
> +      switch (var->type->without_array()->base_type) {
>        case GLSL_TYPE_FLOAT:
>           /* Ok in all GLSL versions */
>           break;
>        case GLSL_TYPE_UINT:
>        case GLSL_TYPE_INT:
>           if (state->is_version(130, 300))
>              break;
>           _mesa_glsl_error(loc, state,
>                            "varying variables must be of base type float in %s",
>                            state->get_version_string());




More information about the mesa-dev mailing list