pub(crate) const fn sample_type(format: wgpu::TextureFormat) -> wgpu::TextureSampleType {
    // Sample Types
    const UINT: wgpu::TextureSampleType = wgpu::TextureSampleType::Uint;
    const SINT: wgpu::TextureSampleType = wgpu::TextureSampleType::Sint;
    const NEAREST: wgpu::TextureSampleType = wgpu::TextureSampleType::Float { filterable: false };
    const FLOAT: wgpu::TextureSampleType = wgpu::TextureSampleType::Float { filterable: true };
    const DEPTH: wgpu::TextureSampleType = wgpu::TextureSampleType::Depth;

    match format {
        // Normal 8 bit textures
        wgpu::TextureFormat::R8Unorm => FLOAT,
        wgpu::TextureFormat::R8Snorm => FLOAT,
        wgpu::TextureFormat::R8Uint => UINT,
        wgpu::TextureFormat::R8Sint => SINT,

        // Normal 16 bit textures
        wgpu::TextureFormat::R16Uint => UINT,
        wgpu::TextureFormat::R16Sint => SINT,
        wgpu::TextureFormat::R16Float => FLOAT,
        wgpu::TextureFormat::Rg8Unorm => FLOAT,
        wgpu::TextureFormat::Rg8Snorm => FLOAT,
        wgpu::TextureFormat::Rg8Uint => UINT,
        wgpu::TextureFormat::Rg8Sint => SINT,

        // Normal 32 bit textures
        wgpu::TextureFormat::R32Uint => UINT,
        wgpu::TextureFormat::R32Sint => SINT,
        wgpu::TextureFormat::R32Float => NEAREST,
        wgpu::TextureFormat::Rg16Uint => UINT,
        wgpu::TextureFormat::Rg16Sint => SINT,
        wgpu::TextureFormat::Rg16Float => FLOAT,
        wgpu::TextureFormat::Rgba8Unorm => FLOAT,
        wgpu::TextureFormat::Rgba8UnormSrgb => FLOAT,
        wgpu::TextureFormat::Rgba8Snorm => FLOAT,
        wgpu::TextureFormat::Rgba8Uint => UINT,
        wgpu::TextureFormat::Rgba8Sint => SINT,
        wgpu::TextureFormat::Bgra8Unorm => FLOAT,
        wgpu::TextureFormat::Bgra8UnormSrgb => FLOAT,

        // Packed 32 bit textures
        wgpu::TextureFormat::Rgb10a2Unorm => FLOAT,
        wgpu::TextureFormat::Rg11b10Float => FLOAT,

        // Packed 32 bit textures
        wgpu::TextureFormat::Rg32Uint => UINT,
        wgpu::TextureFormat::Rg32Sint => SINT,
        wgpu::TextureFormat::Rg32Float => NEAREST,
        wgpu::TextureFormat::Rgba16Uint => UINT,
        wgpu::TextureFormat::Rgba16Sint => SINT,
        wgpu::TextureFormat::Rgba16Float => FLOAT,

        // Packed 32 bit textures
        wgpu::TextureFormat::Rgba32Uint => UINT,
        wgpu::TextureFormat::Rgba32Sint => SINT,
        wgpu::TextureFormat::Rgba32Float => NEAREST,

        // Depth-stencil textures
        wgpu::TextureFormat::Depth32Float => DEPTH,
        wgpu::TextureFormat::Depth24Plus => DEPTH,
        wgpu::TextureFormat::Depth24PlusStencil8 => DEPTH,

        // Packed uncompressed
        wgpu::TextureFormat::Rgb9e5Ufloat => FLOAT,

        // BCn compressed textures
        wgpu::TextureFormat::Bc1RgbaUnorm
        | wgpu::TextureFormat::Bc1RgbaUnormSrgb
        | wgpu::TextureFormat::Bc2RgbaUnorm
        | wgpu::TextureFormat::Bc2RgbaUnormSrgb
        | wgpu::TextureFormat::Bc3RgbaUnorm
        | wgpu::TextureFormat::Bc3RgbaUnormSrgb
        | wgpu::TextureFormat::Bc4RUnorm
        | wgpu::TextureFormat::Bc4RSnorm
        | wgpu::TextureFormat::Bc5RgUnorm
        | wgpu::TextureFormat::Bc5RgSnorm
        | wgpu::TextureFormat::Bc6hRgbUfloat
        | wgpu::TextureFormat::Bc6hRgbSfloat
        | wgpu::TextureFormat::Bc7RgbaUnorm
        | wgpu::TextureFormat::Bc7RgbaUnormSrgb => FLOAT,

        // ETC compressed textures
        wgpu::TextureFormat::Etc2Rgb8Unorm
        | wgpu::TextureFormat::Etc2Rgb8UnormSrgb
        | wgpu::TextureFormat::Etc2Rgb8A1Unorm
        | wgpu::TextureFormat::Etc2Rgb8A1UnormSrgb
        | wgpu::TextureFormat::Etc2Rgba8Unorm
        | wgpu::TextureFormat::Etc2Rgba8UnormSrgb
        | wgpu::TextureFormat::EacR11Unorm
        | wgpu::TextureFormat::EacR11Snorm
        | wgpu::TextureFormat::EacRg11Unorm
        | wgpu::TextureFormat::EacRg11Snorm => FLOAT,

        // ASTC compressed textures
        wgpu::TextureFormat::Astc4x4RgbaUnorm
        | wgpu::TextureFormat::Astc4x4RgbaUnormSrgb
        | wgpu::TextureFormat::Astc5x4RgbaUnorm
        | wgpu::TextureFormat::Astc5x4RgbaUnormSrgb
        | wgpu::TextureFormat::Astc5x5RgbaUnorm
        | wgpu::TextureFormat::Astc5x5RgbaUnormSrgb
        | wgpu::TextureFormat::Astc6x5RgbaUnorm
        | wgpu::TextureFormat::Astc6x5RgbaUnormSrgb
        | wgpu::TextureFormat::Astc6x6RgbaUnorm
        | wgpu::TextureFormat::Astc6x6RgbaUnormSrgb
        | wgpu::TextureFormat::Astc8x5RgbaUnorm
        | wgpu::TextureFormat::Astc8x5RgbaUnormSrgb
        | wgpu::TextureFormat::Astc8x6RgbaUnorm
        | wgpu::TextureFormat::Astc8x6RgbaUnormSrgb
        | wgpu::TextureFormat::Astc10x5RgbaUnorm
        | wgpu::TextureFormat::Astc10x5RgbaUnormSrgb
        | wgpu::TextureFormat::Astc10x6RgbaUnorm
        | wgpu::TextureFormat::Astc10x6RgbaUnormSrgb
        | wgpu::TextureFormat::Astc8x8RgbaUnorm
        | wgpu::TextureFormat::Astc8x8RgbaUnormSrgb
        | wgpu::TextureFormat::Astc10x8RgbaUnorm
        | wgpu::TextureFormat::Astc10x8RgbaUnormSrgb
        | wgpu::TextureFormat::Astc10x10RgbaUnorm
        | wgpu::TextureFormat::Astc10x10RgbaUnormSrgb
        | wgpu::TextureFormat::Astc12x10RgbaUnorm
        | wgpu::TextureFormat::Astc12x10RgbaUnormSrgb
        | wgpu::TextureFormat::Astc12x12RgbaUnorm
        | wgpu::TextureFormat::Astc12x12RgbaUnormSrgb => FLOAT,

        // Optional normalized 16-bit-per-channel formats
        wgpu::TextureFormat::R16Unorm
        | wgpu::TextureFormat::R16Snorm
        | wgpu::TextureFormat::Rg16Unorm
        | wgpu::TextureFormat::Rg16Snorm
        | wgpu::TextureFormat::Rgba16Unorm
        | wgpu::TextureFormat::Rgba16Snorm => FLOAT,
    }
}
/// Returns the binding sample type for a texture format.
Returns the binding sample type for a texture format.
Returns the binding sample type for a texture format .
pub(crate) const fn sample_type(format: wgpu::TextureFormat) -> wgpu::TextureSampleType {
    // Sample Types
    const UINT: wgpu::TextureSampleType = wgpu::TextureSampleType::Uint;
    const SINT: wgpu::TextureSampleType = wgpu::TextureSampleType::Sint;
    const NEAREST: wgpu::TextureSampleType = wgpu::TextureSampleType::Float { filterable: false };
    const FLOAT: wgpu::TextureSampleType = wgpu::TextureSampleType::Float { filterable: true };
    const DEPTH: wgpu::TextureSampleType = wgpu::TextureSampleType::Depth;
    match format {
        // Normal 8 bit textures
        wgpu::TextureFormat::R8Unorm => FLOAT,
        wgpu::TextureFormat::R8Snorm => FLOAT,
        wgpu::TextureFormat::R8Uint => UINT,
        wgpu::TextureFormat::R8Sint => SINT,
        // Normal 16 bit textures
        wgpu::TextureFormat::R16Uint => UINT,
        wgpu::TextureFormat::R16Sint => SINT,
        wgpu::TextureFormat::R16Float => FLOAT,
        wgpu::TextureFormat::Rg8Unorm => FLOAT,
        wgpu::TextureFormat::Rg8Snorm => FLOAT,
        wgpu::TextureFormat::Rg8Uint => UINT,
        wgpu::TextureFormat::Rg8Sint => SINT,
        // Normal 32 bit textures
        wgpu::TextureFormat::R32Uint => UINT,
        wgpu::TextureFormat::R32Sint => SINT,
        wgpu::TextureFormat::R32Float => NEAREST,
        wgpu::TextureFormat::Rg16Uint => UINT,
        wgpu::TextureFormat::Rg16Sint => SINT,
        wgpu::TextureFormat::Rg16Float => FLOAT,
        wgpu::TextureFormat::Rgba8Unorm => FLOAT,
        wgpu::TextureFormat::Rgba8UnormSrgb => FLOAT,
        wgpu::TextureFormat::Rgba8Snorm => FLOAT,
        wgpu::TextureFormat::Rgba8Uint => UINT,
        wgpu::TextureFormat::Rgba8Sint => SINT,
        wgpu::TextureFormat::Bgra8Unorm => FLOAT,
        wgpu::TextureFormat::Bgra8UnormSrgb => FLOAT,
        // Packed 32 bit textures
        wgpu::TextureFormat::Rgb10a2Unorm => FLOAT,
        wgpu::TextureFormat::Rg11b10Float => FLOAT,
        // Packed 32 bit textures
        wgpu::TextureFormat::Rg32Uint => UINT,
        wgpu::TextureFormat::Rg32Sint => SINT,
        wgpu::TextureFormat::Rg32Float => NEAREST,
        wgpu::TextureFormat::Rgba16Uint => UINT,
        wgpu::TextureFormat::Rgba16Sint => SINT,
        wgpu::TextureFormat::Rgba16Float => FLOAT,
        // Packed 32 bit textures
        wgpu::TextureFormat::Rgba32Uint => UINT,
        wgpu::TextureFormat::Rgba32Sint => SINT,
        wgpu::TextureFormat::Rgba32Float => NEAREST,
        // Depth-stencil textures
        wgpu::TextureFormat::Depth32Float => DEPTH,
        wgpu::TextureFormat::Depth24Plus => DEPTH,
        wgpu::TextureFormat::Depth24PlusStencil8 => DEPTH,
        // Packed uncompressed
        wgpu::TextureFormat::Rgb9e5Ufloat => FLOAT,
        // BCn compressed textures
        wgpu::TextureFormat::Bc1RgbaUnorm
        | wgpu::TextureFormat::Bc1RgbaUnormSrgb
        | wgpu::TextureFormat::Bc2RgbaUnorm
        | wgpu::TextureFormat::Bc2RgbaUnormSrgb
        | wgpu::TextureFormat::Bc3RgbaUnorm
        | wgpu::TextureFormat::Bc3RgbaUnormSrgb
        | wgpu::TextureFormat::Bc4RUnorm
        | wgpu::TextureFormat::Bc4RSnorm
        | wgpu::TextureFormat::Bc5RgUnorm
        | wgpu::TextureFormat::Bc5RgSnorm
        | wgpu::TextureFormat::Bc6hRgbUfloat
        | wgpu::TextureFormat::Bc6hRgbSfloat
        | wgpu::TextureFormat::Bc7RgbaUnorm
        | wgpu::TextureFormat::Bc7RgbaUnormSrgb => FLOAT,
        // ETC compressed textures
        wgpu::TextureFormat::Etc2Rgb8Unorm
        | wgpu::TextureFormat::Etc2Rgb8UnormSrgb
        | wgpu::TextureFormat::Etc2Rgb8A1Unorm
        | wgpu::TextureFormat::Etc2Rgb8A1UnormSrgb
        | wgpu::TextureFormat::Etc2Rgba8Unorm
        | wgpu::TextureFormat::Etc2Rgba8UnormSrgb
        | wgpu::TextureFormat::EacR11Unorm
        | wgpu::TextureFormat::EacR11Snorm
        | wgpu::TextureFormat::EacRg11Unorm
        | wgpu::TextureFormat::EacRg11Snorm => FLOAT,
        // ASTC compressed textures
        wgpu::TextureFormat::Astc4x4RgbaUnorm
        | wgpu::TextureFormat::Astc4x4RgbaUnormSrgb
        | wgpu::TextureFormat::Astc5x4RgbaUnorm
        | wgpu::TextureFormat::Astc5x4RgbaUnormSrgb
        | wgpu::TextureFormat::Astc5x5RgbaUnorm
        | wgpu::TextureFormat::Astc5x5RgbaUnormSrgb
        | wgpu::TextureFormat::Astc6x5RgbaUnorm
        | wgpu::TextureFormat::Astc6x5RgbaUnormSrgb
        | wgpu::TextureFormat::Astc6x6RgbaUnorm
        | wgpu::TextureFormat::Astc6x6RgbaUnormSrgb
        | wgpu::TextureFormat::Astc8x5RgbaUnorm
        | wgpu::TextureFormat::Astc8x5RgbaUnormSrgb
        | wgpu::TextureFormat::Astc8x6RgbaUnorm
        | wgpu::TextureFormat::Astc8x6RgbaUnormSrgb
        | wgpu::TextureFormat::Astc10x5RgbaUnorm
        | wgpu::TextureFormat::Astc10x5RgbaUnormSrgb
        | wgpu::TextureFormat::Astc10x6RgbaUnorm
        | wgpu::TextureFormat::Astc10x6RgbaUnormSrgb
        | wgpu::TextureFormat::Astc8x8RgbaUnorm
        | wgpu::TextureFormat::Astc8x8RgbaUnormSrgb
        | wgpu::TextureFormat::Astc10x8RgbaUnorm
        | wgpu::TextureFormat::Astc10x8RgbaUnormSrgb
        | wgpu::TextureFormat::Astc10x10RgbaUnorm
        | wgpu::TextureFormat::Astc10x10RgbaUnormSrgb
        | wgpu::TextureFormat::Astc12x10RgbaUnorm
        | wgpu::TextureFormat::Astc12x10RgbaUnormSrgb
        | wgpu::TextureFormat::Astc12x12RgbaUnorm
        | wgpu::TextureFormat::Astc12x12RgbaUnormSrgb => FLOAT,
        // Optional normalized 16-bit-per-channel formats
        wgpu::TextureFormat::R16Unorm
        | wgpu::TextureFormat::R16Snorm
        | wgpu::TextureFormat::Rg16Unorm
        | wgpu::TextureFormat::Rg16Snorm
        | wgpu::TextureFormat::Rgba16Unorm
        | wgpu::TextureFormat::Rgba16Snorm => FLOAT,
    }
}
pub ( crate ) const fn sample_type ( format : wgpu :: TextureFormat ) -> wgpu :: TextureSampleType { // Sample Types const UINT : wgpu :: TextureSampleType = wgpu :: TextureSampleType :: Uint ; const SINT : wgpu :: TextureSampleType = wgpu :: TextureSampleType :: Sint ; const NEAREST : wgpu :: TextureSampleType = wgpu :: TextureSampleType :: Float { filterable : false } ; const FLOAT : wgpu :: TextureSampleType = wgpu :: TextureSampleType :: Float { filterable : true } ; const DEPTH : wgpu :: TextureSampleType = wgpu :: TextureSampleType :: Depth ; match format { // Normal 8 bit textures wgpu :: TextureFormat :: R8Unorm => FLOAT , wgpu :: TextureFormat :: R8Snorm => FLOAT , wgpu :: TextureFormat :: R8Uint => UINT , wgpu :: TextureFormat :: R8Sint => SINT , // Normal 16 bit textures wgpu :: TextureFormat :: R16Uint => UINT , wgpu :: TextureFormat :: R16Sint => SINT , wgpu :: TextureFormat :: R16Float => FLOAT , wgpu :: TextureFormat :: Rg8Unorm => FLOAT , wgpu :: TextureFormat :: Rg8Snorm => FLOAT , wgpu :: TextureFormat :: Rg8Uint => UINT , wgpu :: TextureFormat :: Rg8Sint => SINT , // Normal 32 bit textures wgpu :: TextureFormat :: R32Uint => UINT , wgpu :: TextureFormat :: R32Sint => SINT , wgpu :: TextureFormat :: R32Float => NEAREST , wgpu :: TextureFormat :: Rg16Uint => UINT , wgpu :: TextureFormat :: Rg16Sint => SINT , wgpu :: TextureFormat :: Rg16Float => FLOAT , wgpu :: TextureFormat :: Rgba8Unorm => FLOAT , wgpu :: TextureFormat :: Rgba8UnormSrgb => FLOAT , wgpu :: TextureFormat :: Rgba8Snorm => FLOAT , wgpu :: TextureFormat :: Rgba8Uint => UINT , wgpu :: TextureFormat :: Rgba8Sint => SINT , wgpu :: TextureFormat :: Bgra8Unorm => FLOAT , wgpu :: TextureFormat :: Bgra8UnormSrgb => FLOAT , // Packed 32 bit textures wgpu :: TextureFormat :: Rgb10a2Unorm => FLOAT , wgpu :: TextureFormat :: Rg11b10Float => FLOAT , // Packed 32 bit textures wgpu :: TextureFormat :: Rg32Uint => UINT , wgpu :: TextureFormat :: Rg32Sint => SINT , wgpu :: TextureFormat :: Rg32Float => NEAREST , wgpu :: TextureFormat :: Rgba16Uint => UINT , wgpu :: TextureFormat :: Rgba16Sint => SINT , wgpu :: TextureFormat :: Rgba16Float => FLOAT , // Packed 32 bit textures wgpu :: TextureFormat :: Rgba32Uint => UINT , wgpu :: TextureFormat :: Rgba32Sint => SINT , wgpu :: TextureFormat :: Rgba32Float => NEAREST , // Depth-stencil textures wgpu :: TextureFormat :: Depth32Float => DEPTH , wgpu :: TextureFormat :: Depth24Plus => DEPTH , wgpu :: TextureFormat :: Depth24PlusStencil8 => DEPTH , // Packed uncompressed wgpu :: TextureFormat :: Rgb9e5Ufloat => FLOAT , // BCn compressed textures wgpu :: TextureFormat :: Bc1RgbaUnorm | wgpu :: TextureFormat :: Bc1RgbaUnormSrgb | wgpu :: TextureFormat :: Bc2RgbaUnorm | wgpu :: TextureFormat :: Bc2RgbaUnormSrgb | wgpu :: TextureFormat :: Bc3RgbaUnorm | wgpu :: TextureFormat :: Bc3RgbaUnormSrgb | wgpu :: TextureFormat :: Bc4RUnorm | wgpu :: TextureFormat :: Bc4RSnorm | wgpu :: TextureFormat :: Bc5RgUnorm | wgpu :: TextureFormat :: Bc5RgSnorm | wgpu :: TextureFormat :: Bc6hRgbUfloat | wgpu :: TextureFormat :: Bc6hRgbSfloat | wgpu :: TextureFormat :: Bc7RgbaUnorm | wgpu :: TextureFormat :: Bc7RgbaUnormSrgb => FLOAT , // ETC compressed textures wgpu :: TextureFormat :: Etc2Rgb8Unorm | wgpu :: TextureFormat :: Etc2Rgb8UnormSrgb | wgpu :: TextureFormat :: Etc2Rgb8A1Unorm | wgpu :: TextureFormat :: Etc2Rgb8A1UnormSrgb | wgpu :: TextureFormat :: Etc2Rgba8Unorm | wgpu :: TextureFormat :: Etc2Rgba8UnormSrgb | wgpu :: TextureFormat :: EacR11Unorm | wgpu :: TextureFormat :: EacR11Snorm | wgpu :: TextureFormat :: EacRg11Unorm | wgpu :: TextureFormat :: EacRg11Snorm => FLOAT , // ASTC compressed textures wgpu :: TextureFormat :: Astc4x4RgbaUnorm | wgpu :: TextureFormat :: Astc4x4RgbaUnormSrgb | wgpu :: TextureFormat :: Astc5x4RgbaUnorm | wgpu :: TextureFormat :: Astc5x4RgbaUnormSrgb | wgpu :: TextureFormat :: Astc5x5RgbaUnorm | wgpu :: TextureFormat :: Astc5x5RgbaUnormSrgb | wgpu :: TextureFormat :: Astc6x5RgbaUnorm | wgpu :: TextureFormat :: Astc6x5RgbaUnormSrgb | wgpu :: TextureFormat :: Astc6x6RgbaUnorm | wgpu :: TextureFormat :: Astc6x6RgbaUnormSrgb | wgpu :: TextureFormat :: Astc8x5RgbaUnorm | wgpu :: TextureFormat :: Astc8x5RgbaUnormSrgb | wgpu :: TextureFormat :: Astc8x6RgbaUnorm | wgpu :: TextureFormat :: Astc8x6RgbaUnormSrgb | wgpu :: TextureFormat :: Astc10x5RgbaUnorm | wgpu :: TextureFormat :: Astc10x5RgbaUnormSrgb | wgpu :: TextureFormat :: Astc10x6RgbaUnorm | wgpu :: TextureFormat :: Astc10x6RgbaUnormSrgb | wgpu :: TextureFormat :: Astc8x8RgbaUnorm | wgpu :: TextureFormat :: Astc8x8RgbaUnormSrgb | wgpu :: TextureFormat :: Astc10x8RgbaUnorm | wgpu :: TextureFormat :: Astc10x8RgbaUnormSrgb | wgpu :: TextureFormat :: Astc10x10RgbaUnorm | wgpu :: TextureFormat :: Astc10x10RgbaUnormSrgb | wgpu :: TextureFormat :: Astc12x10RgbaUnorm | wgpu :: TextureFormat :: Astc12x10RgbaUnormSrgb | wgpu :: TextureFormat :: Astc12x12RgbaUnorm | wgpu :: TextureFormat :: Astc12x12RgbaUnormSrgb => FLOAT , // Optional normalized 16-bit-per-channel formats wgpu :: TextureFormat :: R16Unorm | wgpu :: TextureFormat :: R16Snorm | wgpu :: TextureFormat :: Rg16Unorm | wgpu :: TextureFormat :: Rg16Snorm | wgpu :: TextureFormat :: Rgba16Unorm | wgpu :: TextureFormat :: Rgba16Snorm => FLOAT , } }
Returns the binding sample type for a texture format.
Returns the binding sample type for a texture format .
format
wgpu::TextureFormat
format
wgpu::TextureFormat