Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osg::createTexturedQuadGeometry uses DrawElementsUByte #987

Open
AnyOldName3 opened this issue Oct 3, 2020 · 0 comments
Open

osg::createTexturedQuadGeometry uses DrawElementsUByte #987

AnyOldName3 opened this issue Oct 3, 2020 · 0 comments

Comments

@AnyOldName3
Copy link
Contributor

When using GL_UNSIGNED_BYTE as the index type for glDrawElements on a modern AMD system with OpenGL debug messages enabled, the following message is emitted:

OpenGL PERFORMANCE [API]: glDrawElements uses element index type 'GL_UNSIGNED_BYTE' that is not optimal for the current hardware configuration; consider using 'GL_UNSIGNED_SHORT' instead

As the message implies, short indices should be faster on modern GPUs than byte ones. For that reason, and also to suppress the message, it's probably a good idea for osg::createTexturedQuadGeometry to use DrawElementsUShort instead.

I'm not sure of the relative performance impact on older and mobile GPUs, but if it's negligible, it's potentially worth accepting to suppress the message. As the driver generates the message for every call it's not happy with, it doesn't take many textured quad geometries to swamp more useful messages from calls generating errors or that take longer on account of having more vertices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant