Skip to content

Support for arrays of textures #106

@cloudhead

Description

@cloudhead

Hey, I'm trying to build a sprite renderer on top of wgpu, and one issue I'm running into is how to easily switch between textures on a per-frame basis. Ideally I don't want to have to create a BindGroup for each texture, and 2D textures aren't ideal either as the textures are not all the same size. One option that is interesting is to create an array of texture descriptors that I can index with a uniform. Something like this:

layout(set = 0, binding = 1) uniform texture2D textures[1024];

but this doesn't seem to be supported by wgpu - looking through the code I found: https://github.com/gfx-rs/wgpu/blob/master/wgpu-native/src/device.rs#L840 - which suggests that the descriptorCount cannot be configured.

Is this something in the works, or is there a better way I haven't considered?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs informationFurther information is requestedtype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions