[Mesa-dev] [PATCH 1/2] glsl: prohibit lowp, mediump precision on atomic_uint

Kenneth Graunke kenneth at whitecape.org
Fri Oct 7 08:09:02 UTC 2016


On Friday, October 7, 2016 11:05:30 AM PDT Tapani Pälli wrote:
> 
> On 10/07/2016 10:46 AM, Kenneth Graunke wrote:
> > On Friday, October 7, 2016 8:52:18 AM PDT Tapani Pälli wrote:
> >> Fixes following dEQP tests:
> >>
> >>    dEQP-GLES31.functional.debug.negative_coverage.callbacks.atomic_counter.atomic_precision
> >>    dEQP-GLES31.functional.debug.negative_coverage.get_error.atomic_counter.atomic_precision
> >>    dEQP-GLES31.functional.debug.negative_coverage.log.atomic_counter.atomic_precision
> >>
> >> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98131
> >> ---
> >>  src/compiler/glsl/ast_to_hir.cpp | 14 ++++++++++++++
> >>  1 file changed, 14 insertions(+)
> >>
> >> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> >> index 8cdb917..c3c8cef 100644
> >> --- a/src/compiler/glsl/ast_to_hir.cpp
> >> +++ b/src/compiler/glsl/ast_to_hir.cpp
> >> @@ -2585,6 +2585,20 @@ select_gles_precision(unsigned qual_precision,
> >>                            type->name);
> >>        }
> >>     }
> >> +
> >> +
> >> +   /* Section 4.1.7.3 (Atomic Counters) of the GLSL ES 3.10 spec says:
> >> +    *
> >> +    *    "The default precision of all atomic types is highp. It is an error to
> >> +    *    declare an atomic type with a different precision or to specify the
> >> +    *    default precision for an atomic type to be lowp or mediump."
> >> +    */
> >> +   if (type->base_type == GLSL_TYPE_ATOMIC_UINT &&
> >> +       precision != ast_precision_high) {
> >> +      _mesa_glsl_error(loc, state,
> >> +                       "atomic_uint can only have highp precision qualifier");
> >> +   }
> >> +
> >>     return precision;
> >>  }
> >>
> >>
> >
> > Hrm, wouldn't this break for precision == ast_precision_none?
> 
> IMO this condition should not happen since for atomic_uint there's 
> always default precision qualifier high which gets selected if no 
> precision was given.
> 
> > --Ken
> >
> 
> // Tapani

Right, good call.  Thanks for taking care of these!

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161007/aa3a27d0/attachment.sig>


More information about the mesa-dev mailing list