-
Notifications
You must be signed in to change notification settings - Fork 62
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
Implement geometry cache #1515
Implement geometry cache #1515
Conversation
299a185
to
07571fd
Compare
d58bd41
to
60407b8
Compare
The geometry cache represents 3 buffers: a VBO, IBO, and inputVBO. These buffers will replace the old separate input VBOs and IBOs when enabled. This allows binding only a VAO before rendering, rather than setting up vertex pointers with the correct offset and formats every time. Additionally, it means that there's no need to switch between different VBOs/IBOs. The `inputVBO` is currently unused, but it will be needed to make models work with the geometry cache (model animations and world transform will be processed in a compute shader). Currently this is only used by the material system, but it should be possible to make the core renderer use it as well.
60407b8
to
c2c8487
Compare
@@ -288,7 +285,10 @@ enum class BufferBind { | |||
COMMAND_COUNTERS_ATOMIC = 0, | |||
COMMAND_COUNTERS_STORAGE = 4, // Avoid needlessly rebinding buffers | |||
PORTAL_SURFACES = 5, | |||
DEBUG = 10 | |||
GEOMETRY_CACHE_INPUT_VBO = 6, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if they are supposed to be unique but there are two 6's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now it will work fine since buffers are still always being bound before the draws/dispatches, and later I'll probably add something to avoid rebinding both old and new-style buffers.
493091d
to
4c359fc
Compare
4c359fc
to
635926f
Compare
LGTM |
Requires #1511, #1513, and #1514.
The geometry cache represents 3 buffers: a VBO, IBO, and inputVBO. These buffers will replace the old separate input VBOs and IBOs when enabled. This allows binding only a VAO before rendering, rather than setting up vertex pointers with the correct offset and formats every time. Additionally, it means that there's no need to switch between different VBOs/IBOs. The
inputVBO
is currently unused, but it will be needed to make models work with the geometry cache (model animations and world transform will be processed in a compute shader).This further improves performance and removes the VBO/IBO check for materials.
Currently this is only used by the material system, but it should be possible to make the core renderer use it as well.
This will also be required to support entities with material system.