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

Borrowed views into a shader artifact with static storage in the owning program. More...

#include "donner/gpu/shader/CompiledShader.h"

Public Member Functions

constexpr const ShaderResource * resource (std::string_view name) const
 Finds a resource by its authored WGSL name; the result borrows this view's artifact.
constexpr const ShaderBufferMember * findMember (uint32_t first, uint32_t count, std::string_view name) const
 Finds a member within a validated reflected range; the result borrows this artifact.
constexpr bool matchesMember (std::string_view resourceName, std::string_view memberName, uint32_t offsetBytes, uint32_t sizeBytes, ShaderScalarType scalarType, uint8_t lanes=1, uint32_t arrayCount=0, uint32_t arrayStrideBytes=0, uint8_t matrixColumns=0, uint32_t matrixStrideBytes=0) const
 Checks one C++ field against the corresponding shader member.

Static Public Member Functions

static constexpr bool matchesLayout (const ShaderBufferMember &member, uint32_t absoluteOffset, uint32_t offset, uint32_t size, ShaderScalarType scalar, uint8_t lanes, uint32_t count, uint32_t stride, uint8_t columns, uint32_t matrixStride)
 Compares one resolved member with its expected absolute layout.

Public Attributes

std::string_view wgsl
 Borrowed WGSL source text.
std::string_view msl
 Borrowed Metal Shading Language source text.
std::span< const uint32_t > spirv
 Borrowed SPIR-V words.
std::span< const ShaderResource > resources
 Borrowed reflected resource bindings.
std::span< const ShaderBufferMember > members
 Borrowed reflected buffer members.
std::span< const ShaderEntryPoint > entryPoints
 Borrowed entry-point metadata.
std::span< const ShaderInterfaceVariable > interfaceVariables
 Borrowed flattened entry input and output metadata.

Detailed Description

Borrowed views into a shader artifact with static storage in the owning program.

Member Function Documentation

◆ findMember()

const ShaderBufferMember * donner::gpu::shader::CompiledShaderView::findMember ( uint32_t first,
uint32_t count,
std::string_view name ) const
inlineconstexpr

Finds a member within a validated reflected range; the result borrows this artifact.

Parameters
firstFirst member.
countMember count.
nameUnqualified member name.

◆ matchesMember()

bool donner::gpu::shader::CompiledShaderView::matchesMember ( std::string_view resourceName,
std::string_view memberName,
uint32_t offsetBytes,
uint32_t sizeBytes,
ShaderScalarType scalarType,
uint8_t lanes = 1,
uint32_t arrayCount = 0,
uint32_t arrayStrideBytes = 0,
uint8_t matrixColumns = 0,
uint32_t matrixStrideBytes = 0 ) const
inlineconstexpr

Checks one C++ field against the corresponding shader member.

Parameters
resourceNameBuffer resource name.
memberNameMember name or dotted structure path.
offsetBytesC++ field offset.
sizeBytesC++ field size.
scalarTypeC++ numeric component kind.
lanesC++ component count.
arrayCountFixed array length, or zero for a non-array member.
arrayStrideBytesFixed array element stride, or zero for a non-array member.
matrixColumnsMatrix columns, or zero for a non-matrix member.
matrixStrideBytesMatrix column stride, or zero for a non-matrix member.

◆ resource()

const ShaderResource * donner::gpu::shader::CompiledShaderView::resource ( std::string_view name) const
inlineconstexpr

Finds a resource by its authored WGSL name; the result borrows this view's artifact.

Parameters
nameAuthored resource name.

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