diff --git a/assets/voxygen/shaders/include/lod.glsl b/assets/voxygen/shaders/include/lod.glsl index 42a054fa36..2ca840337d 100644 --- a/assets/voxygen/shaders/include/lod.glsl +++ b/assets/voxygen/shaders/include/lod.glsl @@ -285,9 +285,9 @@ vec3 lod_pos(vec2 pos, vec2 focus_pos) { } #ifdef HAS_LOD_FULL_INFO -layout(set = 0, binding = 15) +layout(set = 0, binding = 14) uniform texture2D t_map; -layout(set = 0, binding = 16) +layout(set = 0, binding = 15) uniform sampler s_map; vec3 lod_col(vec2 pos) { diff --git a/assets/voxygen/shaders/include/random.glsl b/assets/voxygen/shaders/include/random.glsl index 388e1f19c4..07f52d1ba8 100644 --- a/assets/voxygen/shaders/include/random.glsl +++ b/assets/voxygen/shaders/include/random.glsl @@ -2,7 +2,7 @@ #define RANDOM_GLSL layout(set = 0, binding = 1) uniform texture2D t_noise; -layout(set = 0, binding = 1) uniform sampler s_noise; +layout(set = 0, binding = 2) uniform sampler s_noise; float hash(vec4 p) { p = fract(p * 0.3183099 + 0.1) - fract(p + 23.22121); diff --git a/assets/voxygen/shaders/include/shadows.glsl b/assets/voxygen/shaders/include/shadows.glsl index 9e4f64c2c8..a95110d5c3 100644 --- a/assets/voxygen/shaders/include/shadows.glsl +++ b/assets/voxygen/shaders/include/shadows.glsl @@ -15,18 +15,18 @@ uniform u_light_shadows { }; // Use with sampler2DShadow -layout(set = 0, binding = 13) +layout(set = 0, binding = 12) uniform texture2D t_directed_shadow_maps; -layout(set = 0, binding = 14) +layout(set = 0, binding = 13) uniform sampler s_directed_shadow_maps; // uniform sampler2DArrayShadow t_directed_shadow_maps; // uniform samplerCubeArrayShadow t_shadow_maps; // uniform samplerCubeArray t_shadow_maps; // Use with samplerCubeShadow -layout(set = 0, binding = 11) +layout(set = 0, binding = 10) uniform textureCube t_point_shadow_maps; -layout(set = 0, binding = 12) +layout(set = 0, binding = 11) uniform sampler s_point_shadow_maps; // uniform samplerCube t_shadow_maps; diff --git a/assets/voxygen/shaders/skybox-frag.glsl b/assets/voxygen/shaders/skybox-frag.glsl index 3dba60bb9f..afb2945845 100644 --- a/assets/voxygen/shaders/skybox-frag.glsl +++ b/assets/voxygen/shaders/skybox-frag.glsl @@ -16,7 +16,9 @@ #define LIGHTING_DISTRIBUTION LIGHTING_DISTRIBUTION_BECKMANN -#include // includes sky, globals +#include +#include +#include layout(location = 0) in vec3 f_pos; diff --git a/voxygen/src/render/pipelines/clouds.rs b/voxygen/src/render/pipelines/clouds.rs index 82c0feaed9..11fecc31dd 100644 --- a/voxygen/src/render/pipelines/clouds.rs +++ b/voxygen/src/render/pipelines/clouds.rs @@ -139,6 +139,7 @@ impl CloudsPipeline { layout: &CloudsLayout, aa_mode: AaMode, ) -> Self { + common::span!(_guard, "CloudsPipeline::new"); let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Clouds pipeline layout"), diff --git a/voxygen/src/render/pipelines/figure.rs b/voxygen/src/render/pipelines/figure.rs index 28ff649bf4..d9bb0ef422 100644 --- a/voxygen/src/render/pipelines/figure.rs +++ b/voxygen/src/render/pipelines/figure.rs @@ -179,6 +179,7 @@ impl FigurePipeline { layout: &FigureLayout, aa_mode: AaMode, ) -> Self { + common::span!(_guard, "FigurePipeline::new"); let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Figure pipeline layout"), diff --git a/voxygen/src/render/pipelines/fluid.rs b/voxygen/src/render/pipelines/fluid.rs index 8af8f18c94..05106513d7 100644 --- a/voxygen/src/render/pipelines/fluid.rs +++ b/voxygen/src/render/pipelines/fluid.rs @@ -90,6 +90,7 @@ impl FluidPipeline { terrain_layout: &TerrainLayout, aa_mode: AaMode, ) -> Self { + common::span!(_guard, "FluidPipeline::new"); let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Fluid pipeline layout"), diff --git a/voxygen/src/render/pipelines/mod.rs b/voxygen/src/render/pipelines/mod.rs index a81d4d7140..3686b67a51 100644 --- a/voxygen/src/render/pipelines/mod.rs +++ b/voxygen/src/render/pipelines/mod.rs @@ -316,26 +316,19 @@ impl GlobalsLayouts { count: None, }, // light shadows - // TODO: should this be a uniform? wgpu::BindGroupLayoutEntry { binding: 9, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::SampledTexture { - component_type: wgpu::TextureComponentType::Float, - dimension: wgpu::TextureViewDimension::D2, - multisampled: false, + // TODO: is this relevant? + ty: wgpu::BindingType::UniformBuffer { + dynamic: false, + min_binding_size: None, }, count: None, }, - wgpu::BindGroupLayoutEntry { - binding: 10, - visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, - ty: wgpu::BindingType::Sampler { comparison: false }, - count: None, - }, // point shadow_maps wgpu::BindGroupLayoutEntry { - binding: 11, + binding: 10, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::SampledTexture { component_type: wgpu::TextureComponentType::Float, @@ -345,14 +338,14 @@ impl GlobalsLayouts { count: None, }, wgpu::BindGroupLayoutEntry { - binding: 12, + binding: 11, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::Sampler { comparison: false }, count: None, }, // directed shadow maps wgpu::BindGroupLayoutEntry { - binding: 13, + binding: 12, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::SampledTexture { component_type: wgpu::TextureComponentType::Float, @@ -362,14 +355,14 @@ impl GlobalsLayouts { count: None, }, wgpu::BindGroupLayoutEntry { - binding: 14, + binding: 13, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::Sampler { comparison: false }, count: None, }, // lod map (t_map) wgpu::BindGroupLayoutEntry { - binding: 15, + binding: 14, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::SampledTexture { component_type: wgpu::TextureComponentType::Float, @@ -379,7 +372,7 @@ impl GlobalsLayouts { count: None, }, wgpu::BindGroupLayoutEntry { - binding: 16, + binding: 15, visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::Sampler { comparison: false }, count: None, diff --git a/voxygen/src/render/pipelines/particle.rs b/voxygen/src/render/pipelines/particle.rs index e8365e180d..b31133fb03 100644 --- a/voxygen/src/render/pipelines/particle.rs +++ b/voxygen/src/render/pipelines/particle.rs @@ -142,8 +142,7 @@ impl Instance { fn desc<'a>() -> wgpu::VertexBufferDescriptor<'a> { use std::mem; - const ATTRIBUTES: [wgpu::VertexAttributeDescriptor; 5] = - wgpu::vertex_attr_array![0 => Float, 1 => Float, 2 => Float, 3 => Int, 4 => Float3]; + const ATTRIBUTES: [wgpu::VertexAttributeDescriptor; 6] = wgpu::vertex_attr_array![2 => Float, 3 => Float, 4 => Float, 5 => Int, 6 => Float3, 7 => Float3]; wgpu::VertexBufferDescriptor { stride: mem::size_of::() as wgpu::BufferAddress, step_mode: wgpu::InputStepMode::Instance, @@ -169,6 +168,7 @@ impl ParticlePipeline { global_layout: &GlobalsLayouts, aa_mode: AaMode, ) -> Self { + common::span!(_guard, "ParticlePipeline::new"); let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Particle pipeline layout"), diff --git a/voxygen/src/render/pipelines/postprocess.rs b/voxygen/src/render/pipelines/postprocess.rs index 34de1a5963..1dd4f6a313 100644 --- a/voxygen/src/render/pipelines/postprocess.rs +++ b/voxygen/src/render/pipelines/postprocess.rs @@ -135,6 +135,7 @@ impl PostProcessPipeline { layout: &PostProcessLayout, aa_mode: AaMode, ) -> Self { + common::span!(_guard, "PostProcessPipeline::new"); let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Post process pipeline layout"), diff --git a/voxygen/src/render/pipelines/shadow.rs b/voxygen/src/render/pipelines/shadow.rs index 19ef6316a5..34778aa4b7 100644 --- a/voxygen/src/render/pipelines/shadow.rs +++ b/voxygen/src/render/pipelines/shadow.rs @@ -22,6 +22,7 @@ impl Locals { pub fn default() -> Self { Self::new(Mat4::identity(), Mat4::identity()) } + // TODO: unused? fn layout(device: &wgpu::Device) -> wgpu::BindGroupLayout { device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { label: None, @@ -114,6 +115,8 @@ impl ShadowFigurePipeline { layout: &ShadowLayout, aa_mode: AaMode, ) -> Self { + common::span!(_guard, "new"); + tracing::error!("test"); let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Shadow figure pipeline layout"), diff --git a/voxygen/src/render/pipelines/skybox.rs b/voxygen/src/render/pipelines/skybox.rs index 0e58c403ec..b5a1d36021 100644 --- a/voxygen/src/render/pipelines/skybox.rs +++ b/voxygen/src/render/pipelines/skybox.rs @@ -35,6 +35,7 @@ impl SkyboxPipeline { layouts: &GlobalsLayouts, aa_mode: AaMode, ) -> Self { + common::span!(_guard, "SkyboxPipeline::new"); let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Skybox pipeline layout"), diff --git a/voxygen/src/render/pipelines/sprite.rs b/voxygen/src/render/pipelines/sprite.rs index 5519bcd061..fc61aefc64 100644 --- a/voxygen/src/render/pipelines/sprite.rs +++ b/voxygen/src/render/pipelines/sprite.rs @@ -111,7 +111,7 @@ impl Instance { fn desc<'a>() -> wgpu::VertexBufferDescriptor<'a> { use std::mem; - const ATTRIBUTES: [wgpu::VertexAttributeDescriptor; 6] = wgpu::vertex_attr_array![0 => Uint, 1 => Float4,2 => Float4, 3 => Float4,4 => Float4, 5 => Float]; + const ATTRIBUTES: [wgpu::VertexAttributeDescriptor; 7] = wgpu::vertex_attr_array![3 => Uint, 4 => Float4, 5 => Float4, 6 => Float4,7 => Float4, 8 => Float4, 9 => Float]; wgpu::VertexBufferDescriptor { stride: mem::size_of::() as wgpu::BufferAddress, step_mode: wgpu::InputStepMode::Instance, @@ -224,6 +224,7 @@ impl SpritePipeline { terrain_layout: &TerrainLayout, aa_mode: AaMode, ) -> Self { + common::span!(_guard, "SpritePipeline::new"); let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Sprite pipeline layout"), diff --git a/voxygen/src/render/pipelines/terrain.rs b/voxygen/src/render/pipelines/terrain.rs index ae53306932..3688b49f26 100644 --- a/voxygen/src/render/pipelines/terrain.rs +++ b/voxygen/src/render/pipelines/terrain.rs @@ -190,6 +190,7 @@ impl TerrainPipeline { layout: &TerrainLayout, aa_mode: AaMode, ) -> Self { + common::span!(_guard, "TerrainPipeline::new"); let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Terrain pipeline layout"), diff --git a/voxygen/src/render/renderer.rs b/voxygen/src/render/renderer.rs index 974e87a3bf..b93eac9a9d 100644 --- a/voxygen/src/render/renderer.rs +++ b/voxygen/src/render/renderer.rs @@ -1948,7 +1948,7 @@ fn create_pipelines( .concat(); let fluid_pipeline = fluid::FluidPipeline::new( device, - &terrain_vert, + &create_shader("fluid-vert", ShaderKind::Vertex)?, &create_shader(&selected_fluid_shader, ShaderKind::Fragment)?, sc_desc, &layouts.global,