Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::gpu::ShaderModuleDescriptor Struct Reference

Descriptor for Device::createShaderModule. Source is trusted generated build output, never runtime input from documents. Exactly one source representation must be populated: text kinds (ShaderSourceKind::Wgsl, ShaderSourceKind::Msl) require nonempty sourceText and empty spirvWords; ShaderSourceKind::Spirv requires nonempty spirvWords and empty sourceText. Device::createShaderModule fails closed on any other combination. More...

#include "donner/gpu/Descriptors.h"

Public Attributes

RcString label
 Debug label.
RcString sourceText
 Shader source text (text kinds only).
ShaderSourceKind sourceKind = ShaderSourceKind::Wgsl
 Source language.
std::vector< uint32_t > spirvWords
 SPIR-V words (ShaderSourceKind::Spirv only).
std::vector< ComputeEntryPointInfo > computeEntryPoints
 Compute entry points with their compiled workgroup sizes.
std::optional< std::vector< ShaderBufferBindingInfo > > bufferBindings
 Buffer requirements derived from shader IR.

Detailed Description

Descriptor for Device::createShaderModule. Source is trusted generated build output, never runtime input from documents. Exactly one source representation must be populated: text kinds (ShaderSourceKind::Wgsl, ShaderSourceKind::Msl) require nonempty sourceText and empty spirvWords; ShaderSourceKind::Spirv requires nonempty spirvWords and empty sourceText. Device::createShaderModule fails closed on any other combination.

Member Data Documentation

◆ bufferBindings

std::optional<std::vector<ShaderBufferBindingInfo> > donner::gpu::ShaderModuleDescriptor::bufferBindings

Buffer requirements derived from shader IR.

An engaged empty list means no entry point uses a buffer; absence means requirements were not supplied. Native Metal requires these facts for every MSL module before compilation, including an explicitly empty list for modules without buffer bindings. They let pipeline creation reject binding-type and stage-visibility mismatches before shader use.

◆ computeEntryPoints

std::vector<ComputeEntryPointInfo> donner::gpu::ShaderModuleDescriptor::computeEntryPoints

Compute entry points with their compiled workgroup sizes.

Required for compute pipelines; render-only modules leave it empty. donner::gpu::shader::ComputeEntryPointsOf fills it from the emitted IR module.

◆ label

RcString donner::gpu::ShaderModuleDescriptor::label

Debug label.

◆ sourceKind

ShaderSourceKind donner::gpu::ShaderModuleDescriptor::sourceKind = ShaderSourceKind::Wgsl

Source language.

◆ sourceText

RcString donner::gpu::ShaderModuleDescriptor::sourceText

Shader source text (text kinds only).

◆ spirvWords

std::vector<uint32_t> donner::gpu::ShaderModuleDescriptor::spirvWords

SPIR-V words (ShaderSourceKind::Spirv only).


The documentation for this struct was generated from the following file: