diff --git a/Cargo.toml b/Cargo.toml index f68dd5d321..db67efc3e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -110,8 +110,3 @@ nativeBuildInputs = ["pkg-config"] # macos CI fix isn't merged yet winit = { git = "https://gitlab.com/veloren/winit.git", branch = "macos-test-spiffed" } vek = { git = "https://gitlab.com/veloren/vek.git", branch = "fix_intrinsics2" } -# see https://github.com/rustwasm/wasm-bindgen/issues/2371 -wasm-bindgen = { git = "https://github.com/rustwasm/wasm-bindgen", rev = "316c5a70fdc4a052fb65ef82bf02d52107b5671b" } -wasm-bindgen-futures = { git = "https://github.com/rustwasm/wasm-bindgen", rev = "316c5a70fdc4a052fb65ef82bf02d52107b5671b" } -web-sys = { git = "https://github.com/rustwasm/wasm-bindgen", rev = "316c5a70fdc4a052fb65ef82bf02d52107b5671b" } -js-sys = { git = "https://github.com/rustwasm/wasm-bindgen", rev = "316c5a70fdc4a052fb65ef82bf02d52107b5671b" } diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 2e18b0ca1d..337dbf5d0f 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -45,7 +45,7 @@ i18n = {package = "veloren-i18n", path = "i18n"} # Graphics winit = {version = "0.24.0", features = ["serde"]} -wgpu = { git="https://github.com/Imberflur/wgpu-rs.git" } +wgpu = { git="https://github.com/gfx-rs/wgpu-rs.git", rev = "ab8b0e3766558d541206da2790dfd63f15b13bc4" } bytemuck = { version="1.4", features=["derive"] } shaderc = "0.6.2" diff --git a/voxygen/src/render/pipelines/clouds.rs b/voxygen/src/render/pipelines/clouds.rs index 62e82f9023..19905731d3 100644 --- a/voxygen/src/render/pipelines/clouds.rs +++ b/voxygen/src/render/pipelines/clouds.rs @@ -82,9 +82,9 @@ impl CloudsLayout { wgpu::BindGroupLayoutEntry { binding: 0, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -92,17 +92,16 @@ impl CloudsLayout { wgpu::BindGroupLayoutEntry { binding: 1, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { filtering: true, comparison: false }, count: None, }, // Depth source wgpu::BindGroupLayoutEntry { binding: 2, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - // TODO: is this float? - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -110,15 +109,16 @@ impl CloudsLayout { wgpu::BindGroupLayoutEntry { binding: 3, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { filtering: true, comparison: false }, count: None, }, // Locals wgpu::BindGroupLayoutEntry { binding: 4, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -226,7 +226,7 @@ impl CloudsPipeline { }], depth_stencil_state: None, vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[/*Vertex::desc()*/], }, sample_count: samples, diff --git a/voxygen/src/render/pipelines/figure.rs b/voxygen/src/render/pipelines/figure.rs index d7a098165d..fc148654e5 100644 --- a/voxygen/src/render/pipelines/figure.rs +++ b/voxygen/src/render/pipelines/figure.rs @@ -71,22 +71,6 @@ impl BoneData { normals_mat: normals_mat.into_col_arrays(), } } - - // TODO: delete? the one below is being used - fn layout(device: &wgpu::Device) -> wgpu::BindGroupLayout { - device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { - label: None, - entries: &[wgpu::BindGroupLayoutEntry { - binding: 0, - visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, - min_binding_size: None, - }, - count: None, - }], - }) - } } impl Default for BoneData { @@ -127,8 +111,9 @@ impl FigureLayout { wgpu::BindGroupLayoutEntry { binding: 0, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -137,8 +122,9 @@ impl FigureLayout { wgpu::BindGroupLayoutEntry { binding: 1, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -147,9 +133,9 @@ impl FigureLayout { wgpu::BindGroupLayoutEntry { binding: 2, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -157,7 +143,7 @@ impl FigureLayout { wgpu::BindGroupLayoutEntry { binding: 3, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { filtering: true, comparison: false }, count: None, }, ], @@ -243,7 +229,7 @@ impl FigurePipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[Vertex::desc()], }, sample_count: samples, diff --git a/voxygen/src/render/pipelines/fluid.rs b/voxygen/src/render/pipelines/fluid.rs index f81d0720e1..e5d2df4376 100644 --- a/voxygen/src/render/pipelines/fluid.rs +++ b/voxygen/src/render/pipelines/fluid.rs @@ -56,9 +56,9 @@ impl FluidLayout { wgpu::BindGroupLayoutEntry { binding: 0, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -66,7 +66,7 @@ impl FluidLayout { wgpu::BindGroupLayoutEntry { binding: 1, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { filtering: true, comparison: false }, count: None, }, ], @@ -157,7 +157,7 @@ impl FluidPipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[Vertex::desc()], }, sample_count: samples, diff --git a/voxygen/src/render/pipelines/lod_terrain.rs b/voxygen/src/render/pipelines/lod_terrain.rs index d3abbb0f07..ec67317049 100644 --- a/voxygen/src/render/pipelines/lod_terrain.rs +++ b/voxygen/src/render/pipelines/lod_terrain.rs @@ -225,7 +225,7 @@ impl LodTerrainPipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[Vertex::desc()], }, sample_count: samples, diff --git a/voxygen/src/render/pipelines/mod.rs b/voxygen/src/render/pipelines/mod.rs index ffa08b4eb1..10c1efcb7f 100644 --- a/voxygen/src/render/pipelines/mod.rs +++ b/voxygen/src/render/pipelines/mod.rs @@ -242,8 +242,9 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 0, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -252,9 +253,9 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 1, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - dimension: wgpu::TextureViewDimension::D2, - component_type: wgpu::TextureComponentType::Float, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -262,15 +263,19 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 2, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { + filtering: true, + comparison: false, + }, count: None, }, // Light uniform wgpu::BindGroupLayoutEntry { binding: 3, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -279,8 +284,9 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 4, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -289,9 +295,9 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 5, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Uint, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -299,16 +305,19 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 6, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { + filtering: true, + comparison: false, + }, count: None, }, // Horizon texture wgpu::BindGroupLayoutEntry { binding: 7, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -316,7 +325,10 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 8, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { + filtering: true, + comparison: false, + }, count: None, }, // light shadows (ie shadows from a light?) @@ -324,8 +336,9 @@ impl GlobalsLayouts { binding: 9, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, // TODO: is this relevant? - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -334,9 +347,9 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 10, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -344,16 +357,19 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 11, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { + filtering: true, + comparison: false, + }, count: None, }, // directed shadow maps wgpu::BindGroupLayoutEntry { binding: 12, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -361,16 +377,19 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 13, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { + filtering: true, + comparison: false, + }, count: None, }, // lod map (t_map) wgpu::BindGroupLayoutEntry { binding: 14, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -378,7 +397,10 @@ impl GlobalsLayouts { wgpu::BindGroupLayoutEntry { binding: 15, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { + filtering: true, + comparison: false, + }, count: None, }, ], diff --git a/voxygen/src/render/pipelines/particle.rs b/voxygen/src/render/pipelines/particle.rs index 8c9192f4f9..1da2a71ba6 100644 --- a/voxygen/src/render/pipelines/particle.rs +++ b/voxygen/src/render/pipelines/particle.rs @@ -241,7 +241,7 @@ impl ParticlePipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[Vertex::desc(), Instance::desc()], }, sample_count: samples, diff --git a/voxygen/src/render/pipelines/postprocess.rs b/voxygen/src/render/pipelines/postprocess.rs index f8a9f0dc19..6525ee0190 100644 --- a/voxygen/src/render/pipelines/postprocess.rs +++ b/voxygen/src/render/pipelines/postprocess.rs @@ -79,9 +79,9 @@ impl PostProcessLayout { wgpu::BindGroupLayoutEntry { binding: 0, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -89,16 +89,17 @@ impl PostProcessLayout { wgpu::BindGroupLayoutEntry { binding: 1, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { filtering: true, comparison: false }, count: None, }, // src depth + // TODO: THIS IS UNUSED IN THE SHADER wgpu::BindGroupLayoutEntry { binding: 2, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -106,15 +107,16 @@ impl PostProcessLayout { wgpu::BindGroupLayoutEntry { binding: 3, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { filtering: true, comparison: false }, count: None, }, // Locals wgpu::BindGroupLayoutEntry { binding: 4, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -232,7 +234,7 @@ impl PostProcessPipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[/*Vertex::desc()*/], }, sample_count: samples, diff --git a/voxygen/src/render/pipelines/shadow.rs b/voxygen/src/render/pipelines/shadow.rs index c073f42991..ecbb95cd3c 100644 --- a/voxygen/src/render/pipelines/shadow.rs +++ b/voxygen/src/render/pipelines/shadow.rs @@ -28,8 +28,9 @@ impl Locals { entries: &[wgpu::BindGroupLayoutEntry { binding: 0, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -169,7 +170,7 @@ impl ShadowFigurePipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[TerrainVertex::desc()], }, sample_count: samples, @@ -251,7 +252,7 @@ impl ShadowPipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[TerrainVertex::desc()], }, sample_count: samples, diff --git a/voxygen/src/render/pipelines/skybox.rs b/voxygen/src/render/pipelines/skybox.rs index c19b5493df..ed0edd4258 100644 --- a/voxygen/src/render/pipelines/skybox.rs +++ b/voxygen/src/render/pipelines/skybox.rs @@ -90,7 +90,7 @@ impl SkyboxPipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[Vertex::desc()], }, sample_count: samples, diff --git a/voxygen/src/render/pipelines/sprite.rs b/voxygen/src/render/pipelines/sprite.rs index c9424bb6e9..2688c092d2 100644 --- a/voxygen/src/render/pipelines/sprite.rs +++ b/voxygen/src/render/pipelines/sprite.rs @@ -147,22 +147,6 @@ impl Locals { offs: [offs.x, offs.y, offs.z, 0.0], } } - - // TODO: unused? - fn layout(device: &wgpu::Device) -> wgpu::BindGroupLayout { - device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { - label: None, - entries: &[wgpu::BindGroupLayoutEntry { - binding: 0, - visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, - min_binding_size: None, - }, - count: None, - }], - }) - } } pub struct SpriteLayout { @@ -179,8 +163,9 @@ impl SpriteLayout { wgpu::BindGroupLayoutEntry { binding: 0, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -189,9 +174,9 @@ impl SpriteLayout { wgpu::BindGroupLayoutEntry { binding: 1, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -199,7 +184,10 @@ impl SpriteLayout { wgpu::BindGroupLayoutEntry { binding: 2, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { + filtering: true, + comparison: false, + }, count: None, }, ], @@ -290,7 +278,7 @@ impl SpritePipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[Vertex::desc(), Instance::desc()], }, sample_count: samples, diff --git a/voxygen/src/render/pipelines/terrain.rs b/voxygen/src/render/pipelines/terrain.rs index 79f5631030..c64ce1b0b7 100644 --- a/voxygen/src/render/pipelines/terrain.rs +++ b/voxygen/src/render/pipelines/terrain.rs @@ -163,8 +163,9 @@ impl TerrainLayout { wgpu::BindGroupLayoutEntry { binding: 0, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -173,9 +174,9 @@ impl TerrainLayout { wgpu::BindGroupLayoutEntry { binding: 1, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -183,7 +184,10 @@ impl TerrainLayout { wgpu::BindGroupLayoutEntry { binding: 2, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { + filtering: true, + comparison: false, + }, count: None, }, ], @@ -261,7 +265,7 @@ impl TerrainPipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[Vertex::desc()], }, sample_count: samples, diff --git a/voxygen/src/render/pipelines/ui.rs b/voxygen/src/render/pipelines/ui.rs index 99cf389aad..2498612c4f 100644 --- a/voxygen/src/render/pipelines/ui.rs +++ b/voxygen/src/render/pipelines/ui.rs @@ -101,8 +101,9 @@ impl UiLayout { wgpu::BindGroupLayoutEntry { binding: 0, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::UniformBuffer { - dynamic: false, + ty: wgpu::BindingType::Buffer { + ty: wgpu::BufferBindingType::Uniform, + has_dynamic_offset: false, min_binding_size: None, }, count: None, @@ -116,9 +117,9 @@ impl UiLayout { wgpu::BindGroupLayoutEntry { binding: 0, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, multisampled: false, }, count: None, @@ -126,7 +127,10 @@ impl UiLayout { wgpu::BindGroupLayoutEntry { binding: 1, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, + ty: wgpu::BindingType::Sampler { + filtering: true, + comparison: false, + }, count: None, }, ], @@ -246,7 +250,7 @@ impl UiPipeline { }, }), vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, + index_format: None, vertex_buffers: &[Vertex::desc()], }, sample_count: samples, diff --git a/voxygen/src/render/renderer.rs b/voxygen/src/render/renderer.rs index 10cd2948f1..de5e4268ae 100644 --- a/voxygen/src/render/renderer.rs +++ b/voxygen/src/render/renderer.rs @@ -259,8 +259,6 @@ pub struct Renderer { // color/depth textures locals: Locals, - shader_reload_indicator: ReloadIndicator, - noise_tex: Texture, mode: RenderMode,