benreid24 / BLIB

Small organized collection of common code I have accumulated over the years that has amassed into a proper 2d game engine
1 stars 0 forks source link

Create texture atlases at renderer level to minimize sampler requirements #179

Open benreid24 opened 1 year ago

benreid24 commented 1 year ago

Update TextureRef (or similar approach) to refer to a sub-allocation from a Texture that was created with max allowed size. Callers must compute texture coords through TextureRef which will renormalize them to the range in the atlas.

Utilize the sub-alloc feature on systems with low sampler counts, and prefer dedicated textures for systems with sufficiently large sampler limits. Compile shaders using max sampler count as a parameter for the texture pool descriptor.

Motivation: Providing bindless textures on systems (macos) with low sampler limits.