diff --git a/voxygen/src/render/pipelines/clouds.rs b/voxygen/src/render/pipelines/clouds.rs index 942e8093bd..87944f0298 100644 --- a/voxygen/src/render/pipelines/clouds.rs +++ b/voxygen/src/render/pipelines/clouds.rs @@ -145,7 +145,6 @@ impl CloudsPipeline { vs_module: &wgpu::ShaderModule, fs_module: &wgpu::ShaderModule, global_layout: &GlobalsLayouts, - sc_desc: &wgpu::SwapChainDescriptor, layout: &CloudsLayout, aa_mode: AaMode, ) -> Self { @@ -196,7 +195,7 @@ impl CloudsPipeline { module: fs_module, entry_point: "main", targets: &[wgpu::ColorTargetState { - format: sc_desc.format, + format: wgpu::TextureFormat::Rgba16Float, blend: None, write_mask: wgpu::ColorWrite::ALL, }], diff --git a/voxygen/src/render/pipelines/figure.rs b/voxygen/src/render/pipelines/figure.rs index 4e1e104adb..afa461b165 100644 --- a/voxygen/src/render/pipelines/figure.rs +++ b/voxygen/src/render/pipelines/figure.rs @@ -173,7 +173,6 @@ impl FigurePipeline { device: &wgpu::Device, vs_module: &wgpu::ShaderModule, fs_module: &wgpu::ShaderModule, - sc_desc: &wgpu::SwapChainDescriptor, global_layout: &GlobalsLayouts, layout: &FigureLayout, aa_mode: AaMode, @@ -241,7 +240,7 @@ impl FigurePipeline { module: fs_module, entry_point: "main", targets: &[wgpu::ColorTargetState { - format: sc_desc.format, + format: wgpu::TextureFormat::Rgba16Float, blend: None, write_mask: wgpu::ColorWrite::ALL, }], diff --git a/voxygen/src/render/pipelines/fluid.rs b/voxygen/src/render/pipelines/fluid.rs index 344d269983..b246daef64 100644 --- a/voxygen/src/render/pipelines/fluid.rs +++ b/voxygen/src/render/pipelines/fluid.rs @@ -115,7 +115,6 @@ impl FluidPipeline { device: &wgpu::Device, vs_module: &wgpu::ShaderModule, fs_module: &wgpu::ShaderModule, - sc_desc: &wgpu::SwapChainDescriptor, global_layout: &GlobalsLayouts, layout: &FluidLayout, terrain_layout: &TerrainLayout, @@ -184,7 +183,7 @@ impl FluidPipeline { module: fs_module, entry_point: "main", targets: &[wgpu::ColorTargetState { - format: sc_desc.format, + format: wgpu::TextureFormat::Rgba16Float, blend: Some(wgpu::BlendState { color: wgpu::BlendComponent { src_factor: wgpu::BlendFactor::SrcAlpha, diff --git a/voxygen/src/render/pipelines/lod_terrain.rs b/voxygen/src/render/pipelines/lod_terrain.rs index 0ed722cf23..c21bdee0f0 100644 --- a/voxygen/src/render/pipelines/lod_terrain.rs +++ b/voxygen/src/render/pipelines/lod_terrain.rs @@ -152,7 +152,6 @@ impl LodTerrainPipeline { device: &wgpu::Device, vs_module: &wgpu::ShaderModule, fs_module: &wgpu::ShaderModule, - sc_desc: &wgpu::SwapChainDescriptor, global_layout: &GlobalsLayouts, aa_mode: AaMode, ) -> Self { @@ -213,7 +212,7 @@ impl LodTerrainPipeline { module: fs_module, entry_point: "main", targets: &[wgpu::ColorTargetState { - format: sc_desc.format, + format: wgpu::TextureFormat::Rgba16Float, blend: None, write_mask: wgpu::ColorWrite::ALL, }], diff --git a/voxygen/src/render/pipelines/particle.rs b/voxygen/src/render/pipelines/particle.rs index bf8f8b6499..5e1870ce4c 100644 --- a/voxygen/src/render/pipelines/particle.rs +++ b/voxygen/src/render/pipelines/particle.rs @@ -178,7 +178,6 @@ impl ParticlePipeline { device: &wgpu::Device, vs_module: &wgpu::ShaderModule, fs_module: &wgpu::ShaderModule, - sc_desc: &wgpu::SwapChainDescriptor, global_layout: &GlobalsLayouts, aa_mode: AaMode, ) -> Self { @@ -240,7 +239,8 @@ impl ParticlePipeline { module: fs_module, entry_point: "main", targets: &[wgpu::ColorTargetState { - format: sc_desc.format, + // TODO: use a constant and/or pass in this format on pipeline construction + format: wgpu::TextureFormat::Rgba16Float, blend: Some(wgpu::BlendState { color: wgpu::BlendComponent { src_factor: wgpu::BlendFactor::SrcAlpha, diff --git a/voxygen/src/render/pipelines/skybox.rs b/voxygen/src/render/pipelines/skybox.rs index 450b85b6f0..9c468d858e 100644 --- a/voxygen/src/render/pipelines/skybox.rs +++ b/voxygen/src/render/pipelines/skybox.rs @@ -27,6 +27,7 @@ impl VertexTrait for Vertex { const STRIDE: wgpu::BufferAddress = mem::size_of::() as wgpu::BufferAddress; } +// TODO: does skybox still do anything with new cloud shaders? pub struct SkyboxPipeline { pub pipeline: wgpu::RenderPipeline, } @@ -36,7 +37,6 @@ impl SkyboxPipeline { device: &wgpu::Device, vs_module: &wgpu::ShaderModule, fs_module: &wgpu::ShaderModule, - sc_desc: &wgpu::SwapChainDescriptor, layouts: &GlobalsLayouts, aa_mode: AaMode, ) -> Self { @@ -98,7 +98,7 @@ impl SkyboxPipeline { module: fs_module, entry_point: "main", targets: &[wgpu::ColorTargetState { - format: sc_desc.format, + format: wgpu::TextureFormat::Rgba16Float, blend: None, write_mask: wgpu::ColorWrite::ALL, }], diff --git a/voxygen/src/render/pipelines/sprite.rs b/voxygen/src/render/pipelines/sprite.rs index 7a0f0206a2..f994413c94 100644 --- a/voxygen/src/render/pipelines/sprite.rs +++ b/voxygen/src/render/pipelines/sprite.rs @@ -406,7 +406,6 @@ impl SpritePipeline { device: &wgpu::Device, vs_module: &wgpu::ShaderModule, fs_module: &wgpu::ShaderModule, - sc_desc: &wgpu::SwapChainDescriptor, global_layout: &GlobalsLayouts, layout: &SpriteLayout, terrain_layout: &TerrainLayout, @@ -477,7 +476,7 @@ impl SpritePipeline { module: fs_module, entry_point: "main", targets: &[wgpu::ColorTargetState { - format: sc_desc.format, + format: wgpu::TextureFormat::Rgba16Float, // TODO: can we remove sprite transparency? blend: Some(wgpu::BlendState { color: wgpu::BlendComponent { diff --git a/voxygen/src/render/pipelines/terrain.rs b/voxygen/src/render/pipelines/terrain.rs index 19e9b1743f..2cc3846c6b 100644 --- a/voxygen/src/render/pipelines/terrain.rs +++ b/voxygen/src/render/pipelines/terrain.rs @@ -210,7 +210,6 @@ impl TerrainPipeline { device: &wgpu::Device, vs_module: &wgpu::ShaderModule, fs_module: &wgpu::ShaderModule, - sc_desc: &wgpu::SwapChainDescriptor, global_layout: &GlobalsLayouts, layout: &TerrainLayout, aa_mode: AaMode, @@ -278,7 +277,7 @@ impl TerrainPipeline { module: fs_module, entry_point: "main", targets: &[wgpu::ColorTargetState { - format: sc_desc.format, + format: wgpu::TextureFormat::Rgba16Float, blend: None, write_mask: wgpu::ColorWrite::ALL, }], diff --git a/voxygen/src/render/renderer.rs b/voxygen/src/render/renderer.rs index afa0adcba3..3aedb7cf58 100644 --- a/voxygen/src/render/renderer.rs +++ b/voxygen/src/render/renderer.rs @@ -549,13 +549,13 @@ impl Renderer { mip_level_count: levels, sample_count, dimension: wgpu::TextureDimension::D2, - format: wgpu::TextureFormat::Bgra8UnormSrgb, + format: wgpu::TextureFormat::Rgba16Float, usage: wgpu::TextureUsage::SAMPLED | wgpu::TextureUsage::RENDER_ATTACHMENT, }); tex.create_view(&wgpu::TextureViewDescriptor { label: None, - format: Some(wgpu::TextureFormat::Bgra8UnormSrgb), + format: Some(wgpu::TextureFormat::Rgba16Float), dimension: Some(wgpu::TextureViewDimension::D2), // TODO: why is this not Color? aspect: wgpu::TextureAspect::All, @@ -2062,7 +2062,6 @@ fn create_pipelines( device, &create_shader("skybox-vert", ShaderKind::Vertex)?, &create_shader("skybox-frag", ShaderKind::Fragment)?, - sc_desc, &layouts.global, mode.aa, ); @@ -2072,7 +2071,6 @@ fn create_pipelines( device, &figure_vert_mod, &create_shader("figure-frag", ShaderKind::Fragment)?, - sc_desc, &layouts.global, &layouts.figure, mode.aa, @@ -2084,7 +2082,6 @@ fn create_pipelines( device, &terrain_vert, &create_shader("terrain-frag", ShaderKind::Fragment)?, - sc_desc, &layouts.global, &layouts.terrain, mode.aa, @@ -2100,7 +2097,6 @@ fn create_pipelines( device, &create_shader("fluid-vert", ShaderKind::Vertex)?, &create_shader(&selected_fluid_shader, ShaderKind::Fragment)?, - sc_desc, &layouts.global, &layouts.fluid, &layouts.terrain, @@ -2112,7 +2108,6 @@ fn create_pipelines( device, &create_shader("sprite-vert", ShaderKind::Vertex)?, &create_shader("sprite-frag", ShaderKind::Fragment)?, - sc_desc, &layouts.global, &layouts.sprite, &layouts.terrain, @@ -2124,7 +2119,6 @@ fn create_pipelines( device, &create_shader("particle-vert", ShaderKind::Vertex)?, &create_shader("particle-frag", ShaderKind::Fragment)?, - sc_desc, &layouts.global, mode.aa, ); @@ -2144,7 +2138,6 @@ fn create_pipelines( device, &create_shader("lod-terrain-vert", ShaderKind::Vertex)?, &create_shader("lod-terrain-frag", ShaderKind::Fragment)?, - sc_desc, &layouts.global, mode.aa, ); @@ -2156,7 +2149,6 @@ fn create_pipelines( &create_shader("clouds-frag", ShaderKind::Fragment)?, // TODO: pass in format of intermediate color buffer &layouts.global, - sc_desc, &layouts.clouds, mode.aa, );