diff options
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; |
