Skip to content

Commit

Permalink
hold view outside of render pass
Browse files Browse the repository at this point in the history
  • Loading branch information
schell committed Dec 23, 2024
1 parent f6e6fd0 commit e94d5d3
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions crates/renderling/src/light/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,23 +197,17 @@ impl ShadowMap {
renderlets: impl IntoIterator<Item = &'a Hybrid<Renderlet>>,
) {
let bindgroup = self.get_bindgroup(device, queue, slab_buffer);
let view = self
.texture
.create_view(&wgpu::TextureViewDescriptor::default());
let mut encoder =
device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: Self::LABEL });
{
let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
label: Self::LABEL,
color_attachments: &[],
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
view: &self.texture.create_view(&wgpu::TextureViewDescriptor {
label: Self::LABEL,
format: None,
dimension: None,
aspect: wgpu::TextureAspect::DepthOnly,
base_mip_level: 0,
mip_level_count: None,
base_array_layer: 0,
array_layer_count: None,
}),
view: &view,
depth_ops: Some(wgpu::Operations {
load: wgpu::LoadOp::Clear(1.0),
store: wgpu::StoreOp::Store,
Expand Down

0 comments on commit e94d5d3

Please sign in to comment.