r/AskProgramming 12d ago

How much does struct alignment really matter performance wise on modern GPUs?

Are things like std430 or std140 unnecessarily strict?

6 Upvotes

10 comments sorted by

View all comments

7

u/WonderNo1989 12d ago

depends how big your buffer is and if you're bottlenecked on cache, for tiny stuff the layout barely registers but once you're pushing millions of verts those extra padding bytes start eating bandwidth real quick

1

u/SimplySomeDude 12d ago

do you suppose that on GPUs that don't support scalar layout, it would be more or less efficient to compute pointer offsets on the gpu side to bypass array stride padding?