Introduce integer vertex attributes#21146
Conversation
|
A future PR could make additional, more invasive, optimisations to reduce the vertex size further: Replace the two (float x, float y) texture coordinates with a single (uint xy) coordinate (saves 8 bytes). The color renderer could then use the first integer to encode the colour (it currently needs all 4 floats), which would allow mods that don't need the second sprite channel to save an additional 4 bytes. |
1dc4b42 to
fd728c0
Compare
|
Added some additional improvements. |
PunkPun
left a comment
There was a problem hiding this comment.
this PR is running ra shellmap at 3FPS, where as on bleed I'm getting 200+
|
RA shellmap is ~340 FPS for me, compared to ~340 FPS on bleed. Can you have a poke around and try to identify what is causing your perf regression? |
c210b88 to
a1fbd7e
Compare
|
Windowed or full screen? |
a1fbd7e to
9cf8fd7
Compare
|
@PunkPun can you please try again on the updated version? |
9cf8fd7 to
ae7e6bc
Compare
ae7e6bc to
19f625d
Compare
PunkPun
left a comment
There was a problem hiding this comment.
LGTM, this is a massive performance and shader readability improvement

With GL 2.1 out of the picture, we are finally able to use integers and bitwise operations in shaders. This PR replaces the legacy workaround simulating a bitfield with a float to a real bitfield. This allows us to use the full 32 bits of storage, which I use to pack the palette row (as a 16 bit int) to shave 4 bytes off the vertex size.
I expect this should give a minor performance boost, but the focus is on shader readability and maintability.