[Mesa-dev] [PATCH 1/2] glsl: use without_array() rather than get_scalar_type()
Samuel Pitoiset
samuel.pitoiset at gmail.com
Wed Apr 26 07:29:59 UTC 2017
On 04/26/2017 05:56 AM, 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
> use the without_array() helper.
Type: geing -> being
I think we can just get rid of get_scalar_type() everywhere because it's
similar to without_array().
> ---
> 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