<div dir="ltr">I see, vrend_state.have_vertex_attrib_binding is indeed used in multiple other places.  However, we only seem to use the functionality available in GLES31.  This looks like the most sensible approach then.<div><br><div><div>Reviewed-by: Gurchetan Singh <<a href="mailto:gurchetansingh@chromium.org">gurchetansingh@chromium.org</a>></div></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, May 25, 2018 at 3:26 PM Gert Wollny <<a href="mailto:gert.wollny@collabora.com" target="_blank">gert.wollny@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am Freitag, den 25.05.2018, 09:02 -0700 schrieb Gurchetan Singh:<br>
> On Mon, May 21, 2018 at 8:46 AM Gert Wollny <<a href="mailto:gert.wollny@collabora.co" target="_blank">gert.wollny@collabora.co</a><br>
> m> wrote:<br>
> > On GLES >= 3.1 the functionality that is currently relevant for<br>
> > attribute <br>
> > binding in virglrenderer is available. by enabling this<br>
> > functionality the new <br>
> > code path vrend_draw_bind_vertex_binding is used.<br>
> > <br>
> > Fixes: <br>
> >   dEQP-GLES3.functional.clipping.point.wide_point_z_clip<br>
> >   dEQP-<br>
> > GLES3.functional.clipping.point.wide_point_z_clip_viewport_center<br>
> >   dEQP-<br>
> > GLES3.functional.clipping.point.wide_point_z_clip_viewport_corner<br>
> > <br>
> > On an Intel Kabylake host this also fixes:<br>
> > <br>
> >   dEQP-GLES3.functional.clipping.point.wide_point_clip<br>
> >   dEQP-<br>
> > GLES3.functional.clipping.point.wide_point_clip_viewport_center<br>
> >   dEQP-<br>
> > GLES3.functional.clipping.point.wide_point_clip_viewport_corner<br>
> > <br>
> > but it should be noted that these three tests expect that also<br>
> > points with a <br>
> > centre outside the clip volume will be partially drawn when they<br>
> > overlap with <br>
> > the clip volume because of being "wide". The OpenGL standard<br>
> > defines that these <br>
> > points should be clipped completely.<br>
> <br>
> Is this a test problem or a problem<br>
> with vrend_draw_bind_vertex_legacy?<br>
> Would the test pass if the points are completely clipped?<br>
<br>
Both, all tests don't pass with the legacy code path, but the latter<br>
three test are not written against the OpenGL standard, that expects<br>
the points to be clipped complitely (done, e.g. on r600). The test<br>
expects that the points are partially drawn, even if the center is<br>
outside (done on Intel and presumably also on the Nvidia blob). <br>
<br>
> > GLES 3.1 does not completely implement<br>
> > GL_ARB_vertex_attrib_binding, so it may <br>
> > become necessary to add another flag that would indicate that only<br>
> > GLES style <br>
> > vertex_attrib_binding is available if virglrenderer would want to<br>
> > use this<br>
> > additional functionality. Namely <br>
> >   VertexAttribLPointer<br>
> > is not available, and a few query constants are missing from GLES<br>
> > 3.1 with <br>
> > respect to the extension.<br>
> > <br>
> > Signed-off-by: Gert Wollny <<a href="mailto:gert.wollny@collabora.com" target="_blank">gert.wollny@collabora.com</a>><br>
> > ---<br>
> > PS: obviously the bug in vrend_draw_bind_vertex_legacy that made<br>
> > these tests fail is still there. If someone wants to investigate:<br>
> > The point size is not properly set.<br>
> >  src/vrend_renderer.c | 3 ++-<br>
> >  1 file changed, 2 insertions(+), 1 deletion(-)<br>
> > <br>
> > diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c<br>
> > index 8cd9109..464560e 100644<br>
> > --- a/src/vrend_renderer.c<br>
> > +++ b/src/vrend_renderer.c<br>
> > @@ -4203,7 +4203,8 @@ int vrend_renderer_init(struct vrend_if_cbs<br>
> > *cbs, uint32_t flags)<br>
> > <br>
> >     if (epoxy_has_gl_extension("GL_MESA_pack_invert"))<br>
> >        vrend_state.have_mesa_invert = true;<br>
> > -   if (gl_ver >= 43 ||<br>
> > epoxy_has_gl_extension("GL_ARB_vertex_attrib_binding"))<br>
> > +   if (gl_ver >= 43 || (gles && gl_ver >= 31) ||<br>
> > +       epoxy_has_gl_extension("GL_ARB_vertex_attrib_binding"))<br>
> <br>
> Since GLES31 doesn't fully implement this, we can not advertise<br>
> this.  You can also do<br>
The problem is there are more places in the code where GLES31<br>
functionality related to vertex_attrib_binding is used, and these code<br>
path are used when this flag is set. If we use the flag to advertise<br>
complete support for the extension, then you are of course right, but<br>
then my proposal would be to rename this flag to indidate that this is<br>
not the full extension, but only what GLES31 implements so that these<br>
code path are used when available. We could then add another flag when<br>
the additional functionality provided by the extension is actually<br>
needed. <br>
<br>
> <br>
>    if (vrend_state.have_vertex_attrib_binding ||<br>
> (vrend_state.use_gles && vrend_state.gl_major_ver >= 3 && <br>
> vrend_state.gl_minor_ver >= 1)<br>
>       vrend_draw_bind_vertex_binding(ctx, ctx->sub->ve);<br>
>    else <br>
>       vrend_draw_bind_vertex_legacy(ctx, ctx->sub->ve);<br>
> <br>
> It's a little more verbose, but also more correct.<br>
You forgot the possible future version gles 4.0 ;) <br>
<br>
<br>
Best, <br>
Gert <br>
<br>
>  <br>
> >        vrend_state.have_vertex_attrib_binding = true;<br>
> >     if (gl_ver >= 33 ||<br>
> > epoxy_has_gl_extension("GL_ARB_sampler_objects"))<br>
> >        vrend_state.have_samplers = true;<br>
> > _______________________________________________<br>
> > virglrenderer-devel mailing list<br>
> > <a href="mailto:virglrenderer-devel@lists.freedesktop.org" target="_blank">virglrenderer-devel@lists.freedesktop.org</a><br>
> > <a href="https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel</a><br>
</blockquote></div>