<p dir="ltr"><br>
On Jan 21, 2016 10:30 AM, "Ian Romanick" <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>> wrote:<br>
><br>
> On 01/20/2016 08:29 PM, Jason Ekstrand wrote:<br>
> ><br>
> > On Jan 20, 2016 6:20 PM, "Ian Romanick" <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a><br>
> > <mailto:<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>>> wrote:<br>
> >><br>
> >> From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a><br>
> > <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>>><br>
> >><br>
> >> Add a big spec quotation justifying the error generated, which has<br>
> >> changed over the GL versions.<br>
> >><br>
> >> Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a><br>
> > <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>>><br>
> >> ---<br>
> >><br>
> >> I intended to send this out with the other four, but I selected the<br>
> >> wrong SHA from the list.<br>
> >><br>
> >>  src/mesa/main/texparam.c | 31 ++++++++++++++++++++++++-------<br>
> >>  1 file changed, 24 insertions(+), 7 deletions(-)<br>
> >><br>
> >> diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c<br>
> >> index 89f286c..ee50b5a 100644<br>
> >> --- a/src/mesa/main/texparam.c<br>
> >> +++ b/src/mesa/main/texparam.c<br>
> >> @@ -369,8 +369,31 @@ set_tex_parameteri(struct gl_context *ctx,<br>
> >>        if (texObj->BaseLevel == params[0])<br>
> >>           return GL_FALSE;<br>
> >><br>
> >> +      /* Section 8.10 (Texture Parameters) of the OpenGL 4.5 Core<br>
> > Profile spec<br>
> >> +       * says:<br>
> >> +       *<br>
> >> +       *     "An INVALID_OPERATION error is generated if the<br>
> > effective target<br>
> >> +       *     is either TEXTURE_2D_MULTISAMPLE or<br>
> > TEXTURE_2D_MULTISAMPLE_ARRAY,<br>
> >> +       *     and pname TEXTURE_BASE_LEVEL is set to a value other<br>
> > than zero.<br>
> >> +       *<br>
> >> +       *     ...<br>
> >> +       *<br>
> >> +       *     An INVALID_OPERATION error is generated if the effective<br>
> > target<br>
> >> +       *     is TEXTURE_RECTANGLE and pname TEXTURE_BASE_LEVEL is set<br>
> > to any<br>
> >> +       *     value other than zero."<br>
> ><br>
> > Do we really need the "pname"s?  IMHO, they make it harder to read.<br>
><br>
> I'm not sure what you mean.  The pnames in the spec quote or ... ?</p>
<p dir="ltr">Yes. Some versions of the spec have them and some don't.  The quote below, for instance, doesn't.</p>
<p dir="ltr">> > Other than that, the series looks good.<br>
> ><br>
> > Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a><br>
> > <mailto:<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>>><br>
> ><br>
> >> +       *<br>
> >> +       * Note that section 3.8.8 (Texture Parameters) of the OpenGL<br>
> > 3.3 Core<br>
> >> +       * Profile spec said:<br>
> >> +       *<br>
> >> +       *     "The error INVALID_VALUE is generated if<br>
> > TEXTURE_BASE_LEVEL is<br>
> >> +       *     set to any value other than zero."<br>
> >> +       *<br>
> >> +       * We take the 4.5 language as a correction to the 3.3, and we<br>
> > implement<br>
> >> +       * that on all GL versions.<br>
> >> +       */<br>
> >>        if ((texObj->Target == GL_TEXTURE_2D_MULTISAMPLE ||<br>
> >> -           texObj->Target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) &&<br>
> > params[0] != 0)<br>
> >> +           texObj->Target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY ||<br>
> >> +           texObj->Target == GL_TEXTURE_RECTANGLE) && params[0] != 0)<br>
> >>           goto invalid_operation;<br>
> >><br>
> >>        if (params[0] < 0) {<br>
> >> @@ -378,12 +401,6 @@ set_tex_parameteri(struct gl_context *ctx,<br>
> >>                       "glTex%sParameter(param=%d)", suffix, params[0]);<br>
> >>           return GL_FALSE;<br>
> >>        }<br>
> >> -      if (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0) {<br>
> >> -         _mesa_error(ctx, GL_INVALID_OPERATION,<br>
> >> -                     "glTex%sParameter(target=%s, param=%d)", suffix,<br>
> >> -                     _mesa_enum_to_string(texObj->Target), params[0]);<br>
> >> -         return GL_FALSE;<br>
> >> -      }<br>
> >>        incomplete(ctx, texObj);<br>
> >><br>
> >>        /** See note about ARB_texture_storage below */<br>
> >> --<br>
> >> 2.5.0<br>
> >><br>
> >> _______________________________________________<br>
> >> mesa-dev mailing list<br>
> >> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a> <mailto:<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a>><br>
> >> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
> ><br>
><br>
</p>