mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Remove the depth buffer from the Third drawer
This commit is contained in:
parent
268b8e6327
commit
4be44a53b7
@ -27,16 +27,10 @@ uniform texture2D t_src_color;
|
|||||||
layout(set = 1, binding = 1)
|
layout(set = 1, binding = 1)
|
||||||
uniform sampler s_src_color;
|
uniform sampler s_src_color;
|
||||||
|
|
||||||
// TODO: unused
|
|
||||||
layout(set = 1, binding = 2)
|
|
||||||
uniform texture2D t_src_depth;
|
|
||||||
layout(set = 1, binding = 3)
|
|
||||||
uniform sampler s_src_depth;
|
|
||||||
|
|
||||||
|
|
||||||
layout(location = 0) in vec2 f_pos;
|
layout(location = 0) in vec2 f_pos;
|
||||||
|
|
||||||
layout (std140, set = 1, binding = 4)
|
layout (std140, set = 1, binding = 2)
|
||||||
uniform u_locals {
|
uniform u_locals {
|
||||||
mat4 proj_mat_inv;
|
mat4 proj_mat_inv;
|
||||||
mat4 view_mat_inv;
|
mat4 view_mat_inv;
|
||||||
|
@ -92,27 +92,9 @@ impl PostProcessLayout {
|
|||||||
ty: wgpu::BindingType::Sampler { filtering: true, comparison: false },
|
ty: wgpu::BindingType::Sampler { filtering: true, comparison: false },
|
||||||
count: None,
|
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::Texture {
|
|
||||||
sample_type: wgpu::TextureSampleType::Float { filterable: true },
|
|
||||||
view_dimension: wgpu::TextureViewDimension::D2,
|
|
||||||
multisampled: false,
|
|
||||||
},
|
|
||||||
count: None,
|
|
||||||
},
|
|
||||||
wgpu::BindGroupLayoutEntry {
|
|
||||||
binding: 3,
|
|
||||||
visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
|
|
||||||
ty: wgpu::BindingType::Sampler { filtering: true, comparison: false },
|
|
||||||
count: None,
|
|
||||||
},
|
|
||||||
// Locals
|
// Locals
|
||||||
wgpu::BindGroupLayoutEntry {
|
wgpu::BindGroupLayoutEntry {
|
||||||
binding: 4,
|
binding: 2,
|
||||||
visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
|
visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
|
||||||
ty: wgpu::BindingType::Buffer {
|
ty: wgpu::BindingType::Buffer {
|
||||||
ty: wgpu::BufferBindingType::Uniform,
|
ty: wgpu::BufferBindingType::Uniform,
|
||||||
@ -130,7 +112,6 @@ impl PostProcessLayout {
|
|||||||
&self,
|
&self,
|
||||||
device: &wgpu::Device,
|
device: &wgpu::Device,
|
||||||
src_color: &wgpu::TextureView,
|
src_color: &wgpu::TextureView,
|
||||||
src_depth: &wgpu::TextureView,
|
|
||||||
sampler: &wgpu::Sampler,
|
sampler: &wgpu::Sampler,
|
||||||
locals: &Consts<Locals>,
|
locals: &Consts<Locals>,
|
||||||
) -> BindGroup {
|
) -> BindGroup {
|
||||||
@ -148,14 +129,6 @@ impl PostProcessLayout {
|
|||||||
},
|
},
|
||||||
wgpu::BindGroupEntry {
|
wgpu::BindGroupEntry {
|
||||||
binding: 2,
|
binding: 2,
|
||||||
resource: wgpu::BindingResource::TextureView(src_depth),
|
|
||||||
},
|
|
||||||
wgpu::BindGroupEntry {
|
|
||||||
binding: 3,
|
|
||||||
resource: wgpu::BindingResource::Sampler(sampler),
|
|
||||||
},
|
|
||||||
wgpu::BindGroupEntry {
|
|
||||||
binding: 4,
|
|
||||||
resource: locals.buf().as_entire_binding(),
|
resource: locals.buf().as_entire_binding(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -222,17 +195,7 @@ impl PostProcessPipeline {
|
|||||||
alpha_blend: wgpu::BlendDescriptor::REPLACE,
|
alpha_blend: wgpu::BlendDescriptor::REPLACE,
|
||||||
write_mask: wgpu::ColorWrite::ALL,
|
write_mask: wgpu::ColorWrite::ALL,
|
||||||
}],
|
}],
|
||||||
depth_stencil_state: Some(wgpu::DepthStencilStateDescriptor {
|
depth_stencil_state: None,
|
||||||
format: wgpu::TextureFormat::Depth24Plus,
|
|
||||||
depth_write_enabled: false,
|
|
||||||
depth_compare: wgpu::CompareFunction::Always,
|
|
||||||
stencil: wgpu::StencilStateDescriptor {
|
|
||||||
front: wgpu::StencilStateFaceDescriptor::IGNORE,
|
|
||||||
back: wgpu::StencilStateFaceDescriptor::IGNORE,
|
|
||||||
read_mask: !0,
|
|
||||||
write_mask: !0,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
vertex_state: wgpu::VertexStateDescriptor {
|
vertex_state: wgpu::VertexStateDescriptor {
|
||||||
index_format: None,
|
index_format: None,
|
||||||
vertex_buffers: &[/*Vertex::desc()*/],
|
vertex_buffers: &[/*Vertex::desc()*/],
|
||||||
|
@ -238,17 +238,7 @@ impl UiPipeline {
|
|||||||
},
|
},
|
||||||
write_mask: wgpu::ColorWrite::ALL,
|
write_mask: wgpu::ColorWrite::ALL,
|
||||||
}],
|
}],
|
||||||
depth_stencil_state: Some(wgpu::DepthStencilStateDescriptor {
|
depth_stencil_state: None,
|
||||||
format: wgpu::TextureFormat::Depth24Plus,
|
|
||||||
depth_write_enabled: false,
|
|
||||||
depth_compare: wgpu::CompareFunction::LessEqual,
|
|
||||||
stencil: wgpu::StencilStateDescriptor {
|
|
||||||
front: wgpu::StencilStateFaceDescriptor::IGNORE,
|
|
||||||
back: wgpu::StencilStateFaceDescriptor::IGNORE,
|
|
||||||
read_mask: !0,
|
|
||||||
write_mask: !0,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
vertex_state: wgpu::VertexStateDescriptor {
|
vertex_state: wgpu::VertexStateDescriptor {
|
||||||
index_format: None,
|
index_format: None,
|
||||||
vertex_buffers: &[Vertex::desc()],
|
vertex_buffers: &[Vertex::desc()],
|
||||||
|
@ -176,7 +176,6 @@ impl Locals {
|
|||||||
let postprocess_bind = layouts.postprocess.bind(
|
let postprocess_bind = layouts.postprocess.bind(
|
||||||
device,
|
device,
|
||||||
tgt_color_pp_view,
|
tgt_color_pp_view,
|
||||||
tgt_depth_view,
|
|
||||||
sampler,
|
sampler,
|
||||||
&postprocess_locals,
|
&postprocess_locals,
|
||||||
);
|
);
|
||||||
@ -208,7 +207,6 @@ impl Locals {
|
|||||||
self.postprocess_bind = layouts.postprocess.bind(
|
self.postprocess_bind = layouts.postprocess.bind(
|
||||||
device,
|
device,
|
||||||
tgt_color_pp_view,
|
tgt_color_pp_view,
|
||||||
tgt_depth_view,
|
|
||||||
sampler,
|
sampler,
|
||||||
&self.postprocess,
|
&self.postprocess,
|
||||||
);
|
);
|
||||||
|
@ -111,16 +111,7 @@ impl<'a> Drawer<'a> {
|
|||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
// TODO: do we need this?
|
// TODO: do we need this?
|
||||||
depth_stencil_attachment: Some(
|
depth_stencil_attachment: None
|
||||||
wgpu::RenderPassDepthStencilAttachmentDescriptor {
|
|
||||||
attachment: &self.renderer.win_depth_view,
|
|
||||||
depth_ops: Some(wgpu::Operations {
|
|
||||||
load: wgpu::LoadOp::Clear(1.0),
|
|
||||||
store: true,
|
|
||||||
}),
|
|
||||||
stencil_ops: None,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
render_pass.set_bind_group(0, &self.globals.bind_group, &[]);
|
render_pass.set_bind_group(0, &self.globals.bind_group, &[]);
|
||||||
|
Loading…
Reference in New Issue
Block a user