[Mesa-dev] [PATCH 19/19] mesa/tests: Sanity check the ES2 dispatch table

Paul Berry stereotype441 at gmail.com
Wed Oct 3 14:45:20 PDT 2012


On 1 October 2012 17:07, Oliver McFadden <oliver.mcfadden at linux.intel.com>wrote:

> On Fri, Sep 28, 2012 at 02:15:18PM -0700, Ian Romanick wrote:
> > On 09/28/2012 01:55 PM, Paul Berry wrote:
> > > On 5 September 2012 15:09, Ian Romanick <idr at freedesktop.org
> > > <mailto:idr at freedesktop.org>> wrote:
> > >
> > >     From: Ian Romanick <ian.d.romanick at intel.com
> > >     <mailto:ian.d.romanick at intel.com>>
> > >
> > >     This test is only built when shared-glapi is used.  Because of
> changes
> > >     elsewhere in the tree that were necessary to make shared-glapi work
> > >     correct with GLX, it's not feasible to make the test function both
> ways.
> > >
> > >     Signed-off-by: Ian Romanick <ian.d.romanick at intel.com
> > >     <mailto:ian.d.romanick at intel.com>>
> > >
> > >
> > > This test is failing on my system when I run "make check":
> > >
> > > [----------] 1 test from DispatchSanity_test
> > > [ RUN      ] DispatchSanity_test.GLES2
> > > Mesa warning: couldn't open libtxc_dxtn.so, software DXTn
> > > compression/decompression unavailable
> > > dispatch_sanity.cpp:122: Failure
> > > Value of: table[i]
> > >    Actual: 0x4de54e
> > > Expected: (_glapi_proc) _mesa_generic_nop
> > > Which is: 0x41af72
> > > i = 321
> > > [  FAILED  ] DispatchSanity_test.GLES2 (4 ms)
> > > [----------] 1 test from DispatchSanity_test (4 ms total)
> > >
> > > Is anybody else getting this problem?
> >
> > Can you put the following in the SET_by_offset macro
> > (src/mesa/main/dispatch.h in your build directory):
> >
> >      if (offset == 321) abort(); \
> >
> > then backtrace to see what API function is at fault?
>
> [----------] 1 test from DispatchSanity_test
> [ RUN      ] DispatchSanity_test.GLES2
> [SET_VertexPointer:5719] SET_by_offset(0x1aa7960, 321, fn)!
> /bin/sh: line 5:  8122 Aborted                 ${dir}$tst
> FAIL: main-test
>
> If it helps... I didn't actually run this in GDB, just added the
> printf()/abort() debugging which was already there but commented out.
>

Thanks, Oliver.  Based on suggestions I got from Ian on Monday, I was able
to fix my debugging issues and confirm that glVertexPointer is the function
that's failing for me too.

It looks like the test caught a real bug: we're only excluding
glVertexPointer from the dispatch table when the API is API_OPENGL_CORE.
>From src/mesa/main/api_exec.c:

   if (ctx->API != API_OPENGL_CORE) {
      SET_VertexPointer(exec, _mesa_VertexPointer);
   }

This is incorrect--we should also exclude it when the API is API_OPENGLES2,
like we do for other deprecated GLES1-only functions such as
glEdgeFlagPointer, glIndexPointer, and glNormalPointer.  I'll follow up
with a patch that fixes this.

What surprises me is that the test wasn't failing when Ian ran it.  Ian,
any clue why this might be the case?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121003/c93e5054/attachment.html>


More information about the mesa-dev mailing list