#177 GL_ARB_draw_instanced initialization is incorrect

Future
open
nobody
None
6
2015-08-11
2011-11-04
Anonymous
No

Regarding glew 1.7.0 (and maybe earlier versions??):

The code that does the GetProcAddress lookup for glDrawArraysInstancedARB and glDrawElementsInstancedARB is misplaced in the _glewInit_GL_ARB_instanced_arrays() function.

So if GL_ARB_instanced_arrays is not supported by the GL, the glDrawArrays/ElementsARB function pointers are never initialized and
we crash when trying to call them.

The attached patch fixes the glew.c file which we have in piglit. You can easily adapt it for your glew tree. Is there a generator script for this file?

Discussion

  • Nigel Stewart

    Nigel Stewart - 2011-11-04

    Indeed. Seems off that these would be grouped into ARB_instanced_arrays rather than ARB_draw_instanced.

     
  • Nigel Stewart

    Nigel Stewart - 2012-02-12

    http://www.opengl.org/registry/specs/ARB/instanced_arrays.txt
    The instanced_arrays spec includes the following:

    If ARB_draw_instanced is not supported, all references to gl_InstanceIDARB
    should be removed from section 2.8.  This extension will introduce
    the following additional New Procedures and Functions:
    
        void DrawArraysInstancedARB(enum mode, int first, sizei count,
                sizei primcount);
        void DrawElementsInstancedARB(enum mode, sizei count, enum type,
                const void *indices, sizei primcount);
    

    So GLEW needs to initialize these two functions pointers iff GL_ARB_instanced_arrays or GL_ARB_draw_instanced is available.

     
  • Nigel Stewart

    Nigel Stewart - 2013-08-23
    • Group: --> 1.10.2
     
  • Nigel Stewart

    Nigel Stewart - 2014-08-12
    • Group: 1.10.2 --> 1.11.2
     
  • Nigel Stewart

    Nigel Stewart - 2015-08-11
    • Group: 1.12.1 --> Future
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks