The one projection of each shader family a build links, and the view a device builds its shader module from.
More...
The one projection of each shader family a build links, and the view a device builds its shader module from.
| #define DONNER_LINKED_SHADER_ARTIFACT |
( |
| family | ) |
|
Value:(::donner::gpu::shader::programs::family##Shader())
Names the artifact of family this build links for its own devices: the platform-native projection (MSL on Apple platforms, SPIR-V on Linux) in a native build, and the authored WGSL in the WebAssembly package.
Production code names a family's artifact only through this macro and depends on the family through linked_shader_artifacts, so no build links a projection none of its devices consume. The caller includes the family's own program header.
- Parameters
-
| family | Program name, as in SlugFill for SlugFillNativeShader and SlugFillShader. |
Selects the view a device that consumes deviceKind builds one family's module from, given the artifact of that family this build links.
A Metal or Vulkan device in a native build, and the browser device in the WebAssembly package, consume the linked projection and receive linked. A device that consumes another projection exists only in tests, such as a recording device or the WebGPU reference on a native build: it receives the view a test-only library registered for linked through RegisterAlternateProjection (LinkedProjectionTesting.h, a test-only library, so no production target can register one). Without one it also receives linked, which carries nothing in its kind, so gpu::Device::createShaderModule refuses the empty descriptor rather than compiling nothing.
Callers that derive bindings, entry points or workgroup shapes from reflection may read them from linked: every projection of a family is compiled with one reflected interface.
- Parameters
-
| deviceKind | Source kind the device consumes. |
| linked | The family's artifact this build links. |
- Returns
- The artifact view to build a shader module descriptor from.