OpenGL core profile incredible slowdown on OS X

后端 未结 2 797
伪装坚强ぢ
伪装坚强ぢ 2020-12-16 06:36

I added a new GL renderer to my engine, which uses the core profile. While it runs fine on Windows and/or nvidia cards, it is like 10 times slower on OS X (

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 06:52

    Finally, I was able to reproduce the slowdown. This is just crazy... It is clearly caused by glBindAttribLocation being called on the "my_Position" attribute. Now I did some testing:

    • 1 is default (as returned by glGetAttribLocation)
    • if I set it to zero, theres no problem
    • if I set it to 1, the rendering becomes slow
    • if I set it to any larger number, it is slow again

    Obviously I relink the program (check code). It is not a problem in the implementation, I tested it with "normal" values too.

    Test program:

    https://www.dropbox.com/s/dgg48g1fwgyc5h0/SLOWDOWN_REPRO.zip

    How to repro:

    • open with XCode
    • open common/glext.h (don't be disturbed by the name)
    • modify the GLDECLUSAGE_POSITION constant from 0 to 1
    • compile and run => slow
    • changing back to zero => good

提交回复
热议问题