Swoorup / wgsl-bindgen

Generate typesafe Rust bindings for wgsl shaders in wgpu
https://crates.io/crates/wgsl_bindgen
MIT License
33 stars 6 forks source link

Allow overriding texture sample type. #28

Open Swoorup opened 3 months ago

Swoorup commented 3 months ago

On some occasion, instead of the default option which makes all texture binding to be filterable for texture_2d<f32>, we might not want them to filterable in some odd cases.

wgpu::BindGroupLayoutEntry {
    binding: 0,
    visibility: wgpu::ShaderStages::VERTEX_FRAGMENT,
    ty: wgpu::BindingType::Texture {
        sample_type: wgpu::TextureSampleType::Float {
            filterable: false,
        },
        view_dimension: wgpu::TextureViewDimension::D2,
        multisampled: false,
    },
    count: None,
},