mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Remove unused shadow bind group from the cloud pipeline
This commit is contained in:
parent
d032563780
commit
5b3dbca297
@ -22,19 +22,19 @@
|
|||||||
#include <srgb.glsl>
|
#include <srgb.glsl>
|
||||||
#include <cloud.glsl>
|
#include <cloud.glsl>
|
||||||
|
|
||||||
layout(set = 2, binding = 0)
|
layout(set = 1, binding = 0)
|
||||||
uniform texture2D t_src_color;
|
uniform texture2D t_src_color;
|
||||||
layout(set = 2, binding = 1)
|
layout(set = 1, binding = 1)
|
||||||
uniform sampler s_src_color;
|
uniform sampler s_src_color;
|
||||||
|
|
||||||
layout(set = 2, binding = 2)
|
layout(set = 1, binding = 2)
|
||||||
uniform texture2D t_src_depth;
|
uniform texture2D t_src_depth;
|
||||||
layout(set = 2, binding = 3)
|
layout(set = 1, binding = 3)
|
||||||
uniform sampler s_src_depth;
|
uniform sampler s_src_depth;
|
||||||
|
|
||||||
layout(location = 0) in vec2 uv;
|
layout(location = 0) in vec2 uv;
|
||||||
|
|
||||||
layout (std140, set = 2, binding = 4)
|
layout (std140, set = 1, binding = 4)
|
||||||
uniform u_locals {
|
uniform u_locals {
|
||||||
mat4 proj_mat_inv;
|
mat4 proj_mat_inv;
|
||||||
mat4 view_mat_inv;
|
mat4 view_mat_inv;
|
||||||
|
@ -42,7 +42,7 @@ impl CloudsLayout {
|
|||||||
// Color source
|
// Color source
|
||||||
wgpu::BindGroupLayoutEntry {
|
wgpu::BindGroupLayoutEntry {
|
||||||
binding: 0,
|
binding: 0,
|
||||||
visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
|
visibility: wgpu::ShaderStage::FRAGMENT,
|
||||||
ty: wgpu::BindingType::Texture {
|
ty: wgpu::BindingType::Texture {
|
||||||
sample_type: wgpu::TextureSampleType::Float { filterable: true },
|
sample_type: wgpu::TextureSampleType::Float { filterable: true },
|
||||||
view_dimension: wgpu::TextureViewDimension::D2,
|
view_dimension: wgpu::TextureViewDimension::D2,
|
||||||
@ -52,7 +52,7 @@ impl CloudsLayout {
|
|||||||
},
|
},
|
||||||
wgpu::BindGroupLayoutEntry {
|
wgpu::BindGroupLayoutEntry {
|
||||||
binding: 1,
|
binding: 1,
|
||||||
visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
|
visibility: wgpu::ShaderStage::FRAGMENT,
|
||||||
ty: wgpu::BindingType::Sampler {
|
ty: wgpu::BindingType::Sampler {
|
||||||
filtering: true,
|
filtering: true,
|
||||||
comparison: false,
|
comparison: false,
|
||||||
@ -62,7 +62,7 @@ impl CloudsLayout {
|
|||||||
// Depth source
|
// Depth source
|
||||||
wgpu::BindGroupLayoutEntry {
|
wgpu::BindGroupLayoutEntry {
|
||||||
binding: 2,
|
binding: 2,
|
||||||
visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
|
visibility: wgpu::ShaderStage::FRAGMENT,
|
||||||
ty: wgpu::BindingType::Texture {
|
ty: wgpu::BindingType::Texture {
|
||||||
sample_type: wgpu::TextureSampleType::Float { filterable: true },
|
sample_type: wgpu::TextureSampleType::Float { filterable: true },
|
||||||
view_dimension: wgpu::TextureViewDimension::D2,
|
view_dimension: wgpu::TextureViewDimension::D2,
|
||||||
@ -72,7 +72,7 @@ impl CloudsLayout {
|
|||||||
},
|
},
|
||||||
wgpu::BindGroupLayoutEntry {
|
wgpu::BindGroupLayoutEntry {
|
||||||
binding: 3,
|
binding: 3,
|
||||||
visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
|
visibility: wgpu::ShaderStage::FRAGMENT,
|
||||||
ty: wgpu::BindingType::Sampler {
|
ty: wgpu::BindingType::Sampler {
|
||||||
filtering: true,
|
filtering: true,
|
||||||
comparison: false,
|
comparison: false,
|
||||||
@ -82,7 +82,7 @@ impl CloudsLayout {
|
|||||||
// Locals
|
// Locals
|
||||||
wgpu::BindGroupLayoutEntry {
|
wgpu::BindGroupLayoutEntry {
|
||||||
binding: 4,
|
binding: 4,
|
||||||
visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
|
visibility: wgpu::ShaderStage::FRAGMENT,
|
||||||
ty: wgpu::BindingType::Buffer {
|
ty: wgpu::BindingType::Buffer {
|
||||||
ty: wgpu::BufferBindingType::Uniform,
|
ty: wgpu::BufferBindingType::Uniform,
|
||||||
has_dynamic_offset: false,
|
has_dynamic_offset: false,
|
||||||
@ -153,11 +153,7 @@ impl CloudsPipeline {
|
|||||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||||
label: Some("Clouds pipeline layout"),
|
label: Some("Clouds pipeline layout"),
|
||||||
push_constant_ranges: &[],
|
push_constant_ranges: &[],
|
||||||
bind_group_layouts: &[
|
bind_group_layouts: &[&global_layout.globals, &layout.layout],
|
||||||
&global_layout.globals,
|
|
||||||
&global_layout.shadow_textures,
|
|
||||||
&layout.layout,
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let samples = match aa_mode {
|
let samples = match aa_mode {
|
||||||
|
@ -202,9 +202,6 @@ impl<'frame> Drawer<'frame> {
|
|||||||
/// Returns None if the clouds pipeline is not available
|
/// Returns None if the clouds pipeline is not available
|
||||||
pub fn second_pass(&mut self) -> Option<SecondPassDrawer> {
|
pub fn second_pass(&mut self) -> Option<SecondPassDrawer> {
|
||||||
let pipeline = &self.borrow.pipelines.all()?.clouds;
|
let pipeline = &self.borrow.pipelines.all()?.clouds;
|
||||||
// Note: this becomes Some once pipeline creation is complete even if shadows
|
|
||||||
// are not enabled
|
|
||||||
let shadow = self.borrow.shadow?;
|
|
||||||
|
|
||||||
let encoder = self.encoder.as_mut().unwrap();
|
let encoder = self.encoder.as_mut().unwrap();
|
||||||
let device = self.borrow.device;
|
let device = self.borrow.device;
|
||||||
@ -223,8 +220,6 @@ impl<'frame> Drawer<'frame> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
render_pass.set_bind_group(0, &self.globals.bind_group, &[]);
|
render_pass.set_bind_group(0, &self.globals.bind_group, &[]);
|
||||||
// TODO: what are shadows used for here????
|
|
||||||
render_pass.set_bind_group(1, &shadow.bind.bind_group, &[]);
|
|
||||||
|
|
||||||
Some(SecondPassDrawer {
|
Some(SecondPassDrawer {
|
||||||
render_pass,
|
render_pass,
|
||||||
@ -743,7 +738,7 @@ impl<'pass> SecondPassDrawer<'pass> {
|
|||||||
pub fn draw_clouds(&mut self) {
|
pub fn draw_clouds(&mut self) {
|
||||||
self.render_pass.set_pipeline(&self.pipeline.pipeline);
|
self.render_pass.set_pipeline(&self.pipeline.pipeline);
|
||||||
self.render_pass
|
self.render_pass
|
||||||
.set_bind_group(2, &self.borrow.locals.clouds_bind.bind_group, &[]);
|
.set_bind_group(1, &self.borrow.locals.clouds_bind.bind_group, &[]);
|
||||||
self.render_pass.draw(0..3, 0..1);
|
self.render_pass.draw(0..3, 0..1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user