I am working on a rendering engine in wgpu-rs. I have a system which "batches" rendering, splitting large amounts of vertices and textures into separate draw calls. However, I need to find out what the limit for textures is. For example, when using OpenGL, I would call glGetIntegerv(GL_MAX_TEXTURE_IMAGE_VIEWS)
, and use that as the max textures. But I cannot find an equivalent in wgpu-rs.
I've already searched the internet, and haven't found anything specifically. The closest I have gotten is with the limits struct. However, the values that seem relevant, like 'max_sampled_textures_per_shader_stage' and 'max_samplers_per_shader_stage' are all set to the number 1048576, which is 1024 * 1024. This is way too large to represent the amount of textures, which should be 16, 32 or 64 (maybe 128), but is way too small to represent how much memory in bytes is allocated, being only 1MB.
How can I get the maximum number of TextureViews I can pass into one BindGroup to give to a shader?