| 82 | } |
| 83 | |
| 84 | pub(super) fn create_hdr_rt(device: &wgpu::Device, width: u32, height: u32) -> (wgpu::Texture, wgpu::TextureView) { |
| 85 | let texture = device.create_texture(&wgpu::TextureDescriptor { |
| 86 | label: Some("hdr_rt"), |
| 87 | size: wgpu::Extent3d { width, height, depth_or_array_layers: 1 }, |
| 88 | mip_level_count: 1, |
| 89 | sample_count: 1, |
| 90 | dimension: wgpu::TextureDimension::D2, |
| 91 | format: HDR_FORMAT, |
| 92 | // Phase 4b adds COPY_SRC so the translucent-pass scheduler |
| 93 | // can snapshot hdr_rt → a SceneColor transient via |
| 94 | // copy_texture_to_texture before refractive draws run. |
| 95 | usage: wgpu::TextureUsages::RENDER_ATTACHMENT |
| 96 | | wgpu::TextureUsages::TEXTURE_BINDING |
| 97 | | wgpu::TextureUsages::COPY_SRC, |
| 98 | view_formats: &[], |
| 99 | }); |
| 100 | let view = texture.create_view(&wgpu::TextureViewDescriptor::default()); |
| 101 | (texture, view) |
| 102 | } |
| 103 | |
| 104 | /// Create the two ping-pong 1×1 exposure textures. Single fragment |
| 105 | /// writes to one, composite samples the other, swap each frame. |