[Mesa-dev] [PATCH] slang: if precision qualifiers are allowed, always use default
Jesse Barnes
jbarnes at virtuousgeek.org
Thu May 13 13:29:34 PDT 2010
On Thu, 13 May 2010 14:26:22 -0600
Brian Paul <brianp at vmware.com> wrote:
> 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.
I should have caught that when I updated this patch; I'll double check
now. I was seeing "precision qualifiers not allowed" messages (the
else part) which means allow_precision wasn't set in my build. It
should be though, since I'm building with GLES2. If it's not I'll fix
that instead.
Thanks,
--
Jesse Barnes, Intel Open Source Technology Center
More information about the mesa-dev
mailing list