Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
GeodeShaderSelection.h File Reference

Selects the shader projection a device consumes from a family's linked artifact. More...

Include dependency graph for GeodeShaderSelection.h:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

const gpu::shader::CompiledShaderView & donner::geode::SelectShaderProjection (const gpu::Device &device, const gpu::shader::CompiledShaderView &linked)
 Selects one family's projection for device from the artifact this build links for it, named with DONNER_LINKED_SHADER_ARTIFACT.
gpu::Result< gpu::ShaderModule > donner::geode::CreateShaderModule (gpu::Device &device, const gpu::shader::CompiledShaderView &linked, std::string_view label)
 Creates one family's shader module from the projection device consumes.

Detailed Description

Selects the shader projection a device consumes from a family's linked artifact.

Function Documentation

◆ CreateShaderModule()

gpu::Result< gpu::ShaderModule > donner::geode::CreateShaderModule ( gpu::Device & device,
const gpu::shader::CompiledShaderView & linked,
std::string_view label )
inline

Creates one family's shader module from the projection device consumes.

Parameters
deviceGPU device receiving the prevalidated source and metadata.
linkedThe family's linked artifact, named with DONNER_LINKED_SHADER_ARTIFACT.
labelDiagnostic shader label.
Returns
Shader module or creation error.

◆ SelectShaderProjection()

const gpu::shader::CompiledShaderView & donner::geode::SelectShaderProjection ( const gpu::Device & device,
const gpu::shader::CompiledShaderView & linked )
inline

Selects one family's projection for device from the artifact this build links for it, named with DONNER_LINKED_SHADER_ARTIFACT.

A native build links only the platform-native projection, which its Metal or Vulkan device consumes; the WebAssembly package links only the authored WGSL its browser device consumes. A test device that consumes another projection receives the one a test-only library registered, and otherwise an artifact that carries nothing in its kind, which gpu::Device::createShaderModule refuses rather than compiling nothing. See gpu::shader::SelectLinkedProjection.

Every projection of a family shares one reflected interface, so bindings, entry points and workgroup shapes may be read from either the returned view or linked.

Parameters
deviceDevice whose source kind selects the projection.
linkedThe family's linked artifact.
Returns
The artifact view to build a descriptor from.