[Mesa-dev] [PATCH] glsl: Remove open coded version of ir_variable::interpolation_string().

Matt Turner mattst88 at gmail.com
Thu Jul 19 08:26:29 PDT 2012


On Thu, Jul 19, 2012 at 1:46 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> Presumably the function didn't exist when we wrote this code.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/glsl/ast_to_hir.cpp | 16 +---------------
>  1 file changed, 1 insertion(+), 15 deletions(-)
>
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index bbe8f05..5ad754c 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -2010,24 +2010,10 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
>     if (var->interpolation != INTERP_QUALIFIER_NONE &&
>         !(state->target == vertex_shader && var->mode == ir_var_out) &&
>         !(state->target == fragment_shader && var->mode == ir_var_in)) {
> -      const char *qual_string = NULL;
> -      switch (var->interpolation) {
> -      case INTERP_QUALIFIER_FLAT:
> -        qual_string = "flat";
> -        break;
> -      case INTERP_QUALIFIER_NOPERSPECTIVE:
> -        qual_string = "noperspective";
> -        break;
> -      case INTERP_QUALIFIER_SMOOTH:
> -        qual_string = "smooth";
> -        break;
> -      }
> -
>        _mesa_glsl_error(loc, state,
>                        "interpolation qualifier `%s' can only be applied to "
>                        "vertex shader outputs and fragment shader inputs.",
> -                      qual_string);
> -
> +                      var->interpolation_string());
>     }
>
>     var->pixel_center_integer = qual->flags.q.pixel_center_integer;
> --
> 1.7.11.2

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list