Create the material G-buffer (Rg8Unorm, surface size).
(device: &wgpu::Device, width: u32, height: u32)
| 126 | |
| 127 | /// Create the material G-buffer (Rg8Unorm, surface size). |
| 128 | pub(super) fn create_material_rt(device: &wgpu::Device, width: u32, height: u32) -> (wgpu::Texture, wgpu::TextureView) { |
| 129 | let texture = device.create_texture(&wgpu::TextureDescriptor { |
| 130 | label: Some("material_rt"), |
| 131 | size: wgpu::Extent3d { width, height, depth_or_array_layers: 1 }, |
| 132 | mip_level_count: 1, |
| 133 | sample_count: 1, |
| 134 | dimension: wgpu::TextureDimension::D2, |
| 135 | format: MATERIAL_FORMAT, |
| 136 | usage: wgpu::TextureUsages::RENDER_ATTACHMENT |
| 137 | | wgpu::TextureUsages::TEXTURE_BINDING, |
| 138 | view_formats: &[], |
| 139 | }); |
| 140 | let view = texture.create_view(&wgpu::TextureViewDescriptor::default()); |
| 141 | (texture, view) |
| 142 | } |
| 143 | |
| 144 | /// Create the albedo G-buffer (Rgba8Unorm, surface size). Written by |
| 145 | /// the scene pass so post-passes can modulate bounce light by the |