Create the SSAO bilateral-blur render target (same format/size as ssao_rt).
(device: &wgpu::Device, width: u32, height: u32)
| 678 | |
| 679 | /// Create the SSAO bilateral-blur render target (same format/size as ssao_rt). |
| 680 | pub(super) fn create_ssao_blur_rt(device: &wgpu::Device, width: u32, height: u32) -> (wgpu::Texture, wgpu::TextureView) { |
| 681 | let w = (width / 2).max(1); |
| 682 | let h = (height / 2).max(1); |
| 683 | let texture = device.create_texture(&wgpu::TextureDescriptor { |
| 684 | label: Some("ssao_blur_rt"), |
| 685 | size: wgpu::Extent3d { width: w, height: h, depth_or_array_layers: 1 }, |
| 686 | mip_level_count: 1, |
| 687 | sample_count: 1, |
| 688 | dimension: wgpu::TextureDimension::D2, |
| 689 | format: SSAO_FORMAT, |
| 690 | usage: wgpu::TextureUsages::RENDER_ATTACHMENT |
| 691 | | wgpu::TextureUsages::TEXTURE_BINDING, |
| 692 | view_formats: &[], |
| 693 | }); |
| 694 | let view = texture.create_view(&wgpu::TextureViewDescriptor::default()); |
| 695 | (texture, view) |
| 696 | } |
| 697 | |
| 698 | /// Build the linear-depth Hi-Z pyramid as `HIZ_MIP_COUNT` separate |
| 699 | /// single-mip textures. One multi-mip texture is cheaper on paper |