diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-20 08:42:07 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-20 08:42:07 +0100 |
| commit | f74bcd843c631f82daefe543fca7741fb5bb71f4 (patch) | |
| tree | 0983e6c36fb0f9e2b152f76437ecf91ee1fd99cb /src/gpu/sequence.cc | |
| parent | a160cc797afb4291d356bdc0cbcf0f110e3ef8a9 (diff) | |
feat(cnn_v3): G-buffer phase 1 + training infrastructure
G-buffer (Phase 1):
- Add NodeTypes GBUF_ALBEDO/DEPTH32/R8/RGBA32UINT to NodeRegistry
- GBufferEffect: MRT raster pass (albedo+normal_mat+depth) + pack compute
- Shaders: gbuf_raster.wgsl (MRT), gbuf_pack.wgsl (feature packing, 32B/px)
- Shadow/SDF passes stubbed (placeholder textures), CMake integration deferred
Training infrastructure (Phase 2):
- blender_export.py: headless EXR export with all G-buffer render passes
- pack_blender_sample.py: EXR → per-channel PNGs (oct-normals, 1/z depth)
- pack_photo_sample.py: photo → zero-filled G-buffer sample layout
handoff(Gemini): G-buffer phases 3-5 remain (U-Net shaders, CNNv3Effect, parity)
Diffstat (limited to 'src/gpu/sequence.cc')
| -rw-r--r-- | src/gpu/sequence.cc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/gpu/sequence.cc b/src/gpu/sequence.cc index 1e3be6c..91ca187 100644 --- a/src/gpu/sequence.cc +++ b/src/gpu/sequence.cc @@ -181,6 +181,30 @@ void NodeRegistry::create_texture(Node& node) { usage = (WGPUTextureUsage)(WGPUTextureUsage_StorageBinding | WGPUTextureUsage_TextureBinding); break; + case NodeType::GBUF_ALBEDO: + format = WGPUTextureFormat_RGBA16Float; + usage = (WGPUTextureUsage)(WGPUTextureUsage_RenderAttachment | + WGPUTextureUsage_TextureBinding | + WGPUTextureUsage_StorageBinding | + WGPUTextureUsage_CopySrc); + break; + case NodeType::GBUF_DEPTH32: + format = WGPUTextureFormat_Depth32Float; + usage = (WGPUTextureUsage)(WGPUTextureUsage_RenderAttachment | + WGPUTextureUsage_TextureBinding | + WGPUTextureUsage_CopySrc); + break; + case NodeType::GBUF_R8: + format = WGPUTextureFormat_RGBA8Unorm; + usage = (WGPUTextureUsage)(WGPUTextureUsage_StorageBinding | + WGPUTextureUsage_TextureBinding | + WGPUTextureUsage_RenderAttachment); + break; + case NodeType::GBUF_RGBA32UINT: + format = WGPUTextureFormat_RGBA32Uint; + usage = (WGPUTextureUsage)(WGPUTextureUsage_StorageBinding | + WGPUTextureUsage_TextureBinding); + break; } WGPUTextureDescriptor desc = {}; @@ -201,7 +225,8 @@ void NodeRegistry::create_texture(Node& node) { view_desc.mipLevelCount = 1; view_desc.baseArrayLayer = 0; view_desc.arrayLayerCount = 1; - view_desc.aspect = (node.type == NodeType::DEPTH24) + view_desc.aspect = (node.type == NodeType::DEPTH24 || + node.type == NodeType::GBUF_DEPTH32) ? WGPUTextureAspect_DepthOnly : WGPUTextureAspect_All; |
