Sampler cleanup
parent
fdce0a7d3b
commit
74e8fed1b6
|
@ -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;
|
||||||
|
|
|
@ -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>(
|
||||||
|
|
|
@ -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]),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue