A complete, immutable-on-success frontend module backed by fixed arenas. More...
#include "donner/gpu/shader/wgsl/Module.h"
Public Member Functions | |
| constexpr bool | isValid () const |
| Returns true only after the parser completed every validation pass. | |
| constexpr std::string_view | name (NameRef reference) const |
| Returns a module-owned identifier spelling. | |
| constexpr std::string_view | source () const |
| Returns the validated WGSL source retained for WGSL projection. | |
| constexpr uint32_t | typeAlignment (Type type) const |
| Returns natural host-shareable alignment, or zero for an unsupported type. | |
| constexpr uint32_t | typeSize (Type type) const |
| Returns fixed byte size; runtime arrays and unsupported types have size zero. | |
| constexpr uint32_t | arrayStride (Type type) const |
| Returns the array element stride, including trailing element padding. | |
Public Attributes | |
| bool | valid = false |
| Set only after complete successful parsing and validation. | |
| std::array< char, ModuleLimits::kMaxSourceBytes > | sourceBytes |
| Retained WGSL source storage. | |
| uint32_t | sourceByteCount = 0 |
| Number of valid bytes in sourceBytes. | |
| std::array< char, ModuleLimits::kMaxIdentifierBytes > | identifierBytes |
| Module-owned identifier spelling storage. | |
| uint16_t | identifierByteCount = 0 |
| Number of valid bytes in identifierBytes. | |
| std::array< Struct, ModuleLimits::kMaxStructs > | structs |
| Structure arena; only entries before structCount are valid. | |
| uint16_t | structCount = 0 |
| Number of structure arena entries. | |
| std::array< StructMember, ModuleLimits::kMaxStructMembers > | structMembers |
| Structure-member arena; only entries before structMemberCount are valid. | |
| uint16_t | structMemberCount = 0 |
| Number of structure-member arena entries. | |
| std::array< Binding, ModuleLimits::kMaxBindings > | bindings |
| Resource-binding arena; only entries before bindingCount are valid. | |
| uint16_t | bindingCount = 0 |
| Number of resource-binding arena entries. | |
| std::array< Symbol, ModuleLimits::kMaxSymbols > | symbols |
| Resolved-symbol arena; only entries before symbolCount are valid. | |
| uint16_t | symbolCount = 0 |
| Number of resolved-symbol arena entries. | |
| std::array< Expression, ModuleLimits::kMaxExpressions > | expressions |
| Typed-expression arena; only entries before expressionCount are valid. | |
| uint16_t | expressionCount = 0 |
| Number of expression arena entries. | |
| std::array< Statement, ModuleLimits::kMaxStatements > | statements |
| Typed-statement arena; only entries before statementCount are valid. | |
| uint16_t | statementCount = 0 |
| Number of statement arena entries. | |
| std::array< Function, ModuleLimits::kMaxFunctions > | functions |
| Function arena; only entries before functionCount are valid. | |
| uint16_t | functionCount = 0 |
| Number of function arena entries. | |
| std::array< InterfaceVariable, ModuleLimits::kMaxInterfaceVariables > | interfaceVariables |
| Flattened entry-interface arena; only entries before interfaceVariableCount are valid. | |
| uint16_t | interfaceVariableCount = 0 |
| Number of flattened entry-interface arena entries. | |
| std::array< FoldedConstant, ModuleLimits::kMaxFoldedConstants > | foldedConstants |
| Outermost folded expressions in source order, disjoint; only entries before foldedConstantCount are valid. | |
| uint16_t | foldedConstantCount = 0 |
| Number of folded-constant entries. | |
A complete, immutable-on-success frontend module backed by fixed arenas.
| std::array<Binding, ModuleLimits::kMaxBindings> donner::gpu::shader::wgsl::Module::bindings |
Resource-binding arena; only entries before bindingCount are valid.
| std::array<Expression, ModuleLimits::kMaxExpressions> donner::gpu::shader::wgsl::Module::expressions |
Typed-expression arena; only entries before expressionCount are valid.
| std::array<FoldedConstant, ModuleLimits::kMaxFoldedConstants> donner::gpu::shader::wgsl::Module::foldedConstants |
Outermost folded expressions in source order, disjoint; only entries before foldedConstantCount are valid.
| std::array<Function, ModuleLimits::kMaxFunctions> donner::gpu::shader::wgsl::Module::functions |
Function arena; only entries before functionCount are valid.
| std::array<char, ModuleLimits::kMaxIdentifierBytes> donner::gpu::shader::wgsl::Module::identifierBytes |
Module-owned identifier spelling storage.
| std::array<InterfaceVariable, ModuleLimits::kMaxInterfaceVariables> donner::gpu::shader::wgsl::Module::interfaceVariables |
Flattened entry-interface arena; only entries before interfaceVariableCount are valid.
| std::array<char, ModuleLimits::kMaxSourceBytes> donner::gpu::shader::wgsl::Module::sourceBytes |
Retained WGSL source storage.
| std::array<Statement, ModuleLimits::kMaxStatements> donner::gpu::shader::wgsl::Module::statements |
Typed-statement arena; only entries before statementCount are valid.
| std::array<StructMember, ModuleLimits::kMaxStructMembers> donner::gpu::shader::wgsl::Module::structMembers |
Structure-member arena; only entries before structMemberCount are valid.
| std::array<Struct, ModuleLimits::kMaxStructs> donner::gpu::shader::wgsl::Module::structs |
Structure arena; only entries before structCount are valid.
| std::array<Symbol, ModuleLimits::kMaxSymbols> donner::gpu::shader::wgsl::Module::symbols |
Resolved-symbol arena; only entries before symbolCount are valid.