I had a bunch of trouble figuring out how to set up an array of textures in a vulkan shader, so even though the reality of it is very easy, I made a quick blog post in case anyone else gets stuck
@Gohla Something like a sampler2Darray (or the like)? It's my understanding that you need all your images to be the same size with those (let me know if I'm wrong),
with an array of textures, each texture can be whatever size it wants to be
@Gohla Would be interesting to see a perf comparison between the two (both using a uniformly sized texture set).
For a "bind all the textures at once" approach, the need for all textures to be the same size is rather inconvenient. Although probably do-able if the performance gains are sizeable enough.
@khalladay I expect a small/no difference in performance, but you can never be sure with this stuff, so an actual comparison would be interesting indeed :)
Currently working on the functionality of my game though, optimization comes later when rendering becomes a bottleneck.
@Gohla would be interesting to test it on NVidia, AMD, Android hardware. I'm sure there's at least one platform where the performance difference is large enough to care.
I have...one of those three platforms haha... shit maybe I need to buy an android phone.
Game development! Discussions about game development and related fields, and/or by game developers and related professions.