diff --git a/src/render/shaders/sprite.wgsl b/src/render/shaders/sprite.wgsl index a4fac1d..9a5b78a 100644 --- a/src/render/shaders/sprite.wgsl +++ b/src/render/shaders/sprite.wgsl @@ -84,7 +84,7 @@ fn vertex_main( fn fragment_main(in: VertexOutput) -> @location(0) vec4 { return textureSampleLevel( texture_array[in.index], - sampler_array[in.index], + sampler_array[0], in.texture_coords, 0.0 ).rgba; diff --git a/src/render/shaders/starfield.wgsl b/src/render/shaders/starfield.wgsl index 4d5b49a..7834782 100644 --- a/src/render/shaders/starfield.wgsl +++ b/src/render/shaders/starfield.wgsl @@ -135,7 +135,7 @@ fn fragment_main(in: VertexOutput) -> @location(0) vec4 { return textureSampleLevel( texture_array[global.starfield_texture.x], - sampler_array[global.starfield_texture.x], + sampler_array[0], in.texture_coords, 0.0 ).rgba * vec4( diff --git a/src/render/texturearray/array.rs b/src/render/texturearray/array.rs index 6c95b77..ef35a2f 100644 --- a/src/render/texturearray/array.rs +++ b/src/render/texturearray/array.rs @@ -63,7 +63,7 @@ impl TextureArray { binding: 1, visibility: wgpu::ShaderStages::FRAGMENT, 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 { binding: 1, - resource: wgpu::BindingResource::SamplerArray(&[&sampler].repeat(views.len())), + resource: wgpu::BindingResource::SamplerArray(&[&sampler]), }, ], });