Sampler cleanup

master
Mark 2023-12-25 18:24:55 -08:00
parent fdce0a7d3b
commit 74e8fed1b6
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
3 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ fn vertex_main(
fn fragment_main(in: VertexOutput) -> @location(0) vec4<f32> { fn fragment_main(in: VertexOutput) -> @location(0) vec4<f32> {
return textureSampleLevel( return textureSampleLevel(
texture_array[in.index], texture_array[in.index],
sampler_array[in.index], sampler_array[0],
in.texture_coords, in.texture_coords,
0.0 0.0
).rgba; ).rgba;

View File

@ -135,7 +135,7 @@ fn fragment_main(in: VertexOutput) -> @location(0) vec4<f32> {
return textureSampleLevel( return textureSampleLevel(
texture_array[global.starfield_texture.x], texture_array[global.starfield_texture.x],
sampler_array[global.starfield_texture.x], sampler_array[0],
in.texture_coords, in.texture_coords,
0.0 0.0
).rgba * vec4<f32>( ).rgba * vec4<f32>(

View File

@ -63,7 +63,7 @@ impl TextureArray {
binding: 1, binding: 1,
visibility: wgpu::ShaderStages::FRAGMENT, visibility: wgpu::ShaderStages::FRAGMENT,
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering), ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),
count: NonZeroU32::new(loader.texture_data.len() as u32), count: NonZeroU32::new(1),
}, },
], ],
}); });
@ -80,7 +80,7 @@ impl TextureArray {
}, },
wgpu::BindGroupEntry { wgpu::BindGroupEntry {
binding: 1, binding: 1,
resource: wgpu::BindingResource::SamplerArray(&[&sampler].repeat(views.len())), resource: wgpu::BindingResource::SamplerArray(&[&sampler]),
}, },
], ],
}); });