Texture views take dimension from texture dimension

This commit is contained in:
Jarrod Doyle 2023-04-18 10:42:11 +01:00
parent e13aab1808
commit 7d29cdf86a
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 7 additions and 2 deletions

View File

@ -135,7 +135,12 @@ impl Texture {
..Default::default() ..Default::default()
}); });
// TODO: support texture view dimension configuration let view_dimension = match attributes.dimension {
wgpu::TextureDimension::D1 => wgpu::TextureViewDimension::D1,
wgpu::TextureDimension::D2 => wgpu::TextureViewDimension::D2,
wgpu::TextureDimension::D3 => wgpu::TextureViewDimension::D3,
};
let bind_group_layout = let bind_group_layout =
context context
.device .device
@ -147,7 +152,7 @@ impl Texture {
visibility: attributes.shader_visibility, visibility: attributes.shader_visibility,
ty: wgpu::BindingType::Texture { ty: wgpu::BindingType::Texture {
sample_type: wgpu::TextureSampleType::Float { filterable: true }, sample_type: wgpu::TextureSampleType::Float { filterable: true },
view_dimension: wgpu::TextureViewDimension::D2, view_dimension: view_dimension,
multisampled: false, multisampled: false,
}, },
count: None, count: None,