Skip to content

Improve VBO rendering efficiency - #1207

Open
SpexGuy wants to merge 1 commit into
daid:SteamEnginefrom
SpexGuy:SteamEngine
Open

Improve VBO rendering efficiency#1207
SpexGuy wants to merge 1 commit into
daid:SteamEnginefrom
SpexGuy:SteamEngine

Conversation

@SpexGuy

@SpexGuy SpexGuy commented Apr 5, 2015

Copy link
Copy Markdown
Contributor

by removing unnecessarily repeated driver calls

@daid

daid commented Apr 5, 2015

Copy link
Copy Markdown
Owner

How is this more efficient?

@SpexGuy

SpexGuy commented Apr 6, 2015

Copy link
Copy Markdown
Contributor Author

The major efficiency change is on line -210/+211, where the call to glBindBuffer(GL_ARRAY_BUFFER, 0) is moved out of the loop. This removes just under half the calls to bind to GL_ARRAY_BUFFER.
For clarity, the calls to glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ...) have been moved out of the loop. But since the loop only executes once in this case, this is not an efficiency improvement.
The calls to glEnableClientState(GL_NORMAL_ARRAY) have been moved to the top, so as to be in the same scope as glDisableClientState(GL_NORMAL_ARRAY). Again this doesn't improve efficiency, but I would argue that it does improve readability, and make the symmetry of the code more obvious.

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

Successfully merging this pull request may close these issues.

2 participants