MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / create_material_rt

Function create_material_rt

native/shared/src/renderer/formats.rs:128–142  ·  view source on GitHub ↗

Create the material G-buffer (Rg8Unorm, surface size).

(device: &wgpu::Device, width: u32, height: u32)

Source from the content-addressed store, hash-verified

126
127/// Create the material G-buffer (Rg8Unorm, surface size).
128pub(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

Callers 2

newMethod · 0.85
resizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected