[Mesa-dev] [PATCH] slang: if precision qualifiers are allowed, always use default

Brian Paul brianp at vmware.com
Thu May 13 13:26:22 PDT 2010


Jesse Barnes wrote:
> Rather than erroring out, allow precision qualifiers.  Use the default
> type since we don't support anything else.  Since many (most?) GLES2
> shaders use precision qualifiers, doing something reasonable is
> important if our GLES2 builds are to be useful.
> ---
>  src/mesa/shader/slang/slang_compile.c |    8 +++-----
>  1 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
> index ad86676..5f2f3bc 100644
> --- a/src/mesa/shader/slang/slang_compile.c
> +++ b/src/mesa/shader/slang/slang_compile.c
> @@ -1006,11 +1006,9 @@ parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O,
>     */
>  
>     if (O->allow_precision) {
> -      if (type->precision == SLANG_PREC_DEFAULT) {
> -         assert(type->specifier.type < TYPE_SPECIFIER_COUNT);
> -         /* use the default precision for this datatype */
> -         type->precision = O->default_precision[type->specifier.type];
> -      }
> +      assert(type->specifier.type < TYPE_SPECIFIER_COUNT);
> +      /* use the default precision for this datatype */
> +      type->precision = O->default_precision[type->specifier.type];
>     }
>     else {
>        /* only default is allowed */


I guess it's not obvious to me how this patch fixes the issue.

Which/what error are you seeing?

If the O->allow_precision field set to TRUE you shouldn't be getting 
any errors from shaders that have precision qualifiers.

-Brian


More information about the mesa-dev mailing list