![]() |
LLGL 0.05 Beta
|
Context class for descriptor parsing. More...
#include <Parse.h>
Public Types | |
| using | StringType = SmallVector<char, 0> |
| using | TokenArrayType = SmallVector<StringView, 0> |
Public Member Functions | |
| ParseContext ()=default | |
| ParseContext (const ParseContext &)=default | |
| ParseContext & | operator= (const ParseContext &)=default |
| ParseContext (ParseContext &&)=default | |
| ParseContext & | operator= (ParseContext &&)=default |
| ParseContext (const StringView &source) | |
| Constructs the context with a string view. | |
| ParseContext (UTF8String &&source) | |
| Constructs the context with a UTF-8 string. | |
| PipelineLayoutDescriptor | AsPipelineLayoutDesc () const |
| Generates a pipeline layout descriptor from this parse context. | |
| SamplerDescriptor | AsSamplerDesc () const |
| Generates a sampler descriptor from this parse context. | |
| DepthDescriptor | AsDepthDesc () const |
| Generates a depth descriptor from this parse context. | |
| StencilFaceDescriptor | AsStencilFaceDesc () const |
| Generates a stencil-face descriptor from this parse context. | |
| StencilDescriptor | AsStencilDesc () const |
| Generates a stencil descriptor from this parse context. | |
| TextureSwizzleRGBA | AsTextureSwizzleRGBA () const |
| Generates a texture swizzle descriptor from this parse context. | |
| VertexAttribute | AsVertexAttribute () const |
| Generates a basic vertex attribute descriptor from this parse context. This only includes format and identifier. | |
| DynamicVector< VertexAttribute > | AsVertexAttributeVector () const |
| Generates a vector of basic vertex attributes from this parse context. | |
| operator PipelineLayoutDescriptor () const | |
| Implicit conversion to PipelineLayoutDescriptor. | |
| operator SamplerDescriptor () const | |
| Implicit conversion to SamplerDescriptor. | |
| operator DepthDescriptor () const | |
| Implicit conversion to DepthDescriptor. | |
| operator StencilFaceDescriptor () const | |
| Implicit conversion to StencilFaceDescriptor. | |
| operator StencilDescriptor () const | |
| Implicit conversion to StencilDescriptor. | |
| operator TextureSwizzleRGBA () const | |
| Implicit conversion to TextureSwizzleRGBA. | |
| operator VertexAttribute () const | |
| Implicit conversion to VertexAttribute. | |
| operator DynamicVector< VertexAttribute > () const | |
| Implicit conversion to DynamicVector<VertexAttribute>. | |
Context class for descriptor parsing.
| using LLGL::ParseContext::StringType = SmallVector<char, 0> |
| using LLGL::ParseContext::TokenArrayType = SmallVector<StringView, 0> |
|
default |
|
default |
|
default |
|
explicit |
Constructs the context with a string view.
|
explicit |
Constructs the context with a UTF-8 string.
| DepthDescriptor LLGL::ParseContext::AsDepthDesc | ( | ) | const |
Generates a depth descriptor from this parse context.
compare maps to DepthDescriptor::compareOp; see ParseContext::AsSamplerDesc for accepted value.test maps to DepthDescriptor::testEnabled and accepts a boolean value.write maps to DepthDescriptor::writeEnabled and accepts a boolean value. | PipelineLayoutDescriptor LLGL::ParseContext::AsPipelineLayoutDesc | ( | ) | const |
Generates a pipeline layout descriptor from this parse context.
"heap{"..."}" will be put into PipelineLayoutDescriptor::heapBindings. Otherwise, they are put into PipelineLayoutDescriptor::bindings.cbuffer for constant buffers (i.e. ResourceType::Buffer and BindFlags::ConstantBuffer).buffer for sampled buffers (i.e. ResourceType::Buffer and BindFlags::Sampled).rwbuffer for read/write storage buffers (i.e. ResourceType::Buffer and BindFlags::Storage).tbuffer for sampled texel buffers (i.e. ResourceType::Buffer, BindFlags::Sampled, and BindFlags::TexelBuffer).rwtbuffer for read/write storage texel buffers (i.e. ResourceType::Buffer, BindFlags::Storage, and BindFlags::TexelBuffer).texture for textures (i.e. ResourceType::Texture and BindFlags::Sampled).rwtexture for read/write textures (i.e. ResourceType::Texture and BindFlags::Storage).sampler for sampler states (i.e. ResourceType::Sampler)."texture(myColorMap@1)")."texture(1)")."texture(1[2])" or "texture(tex@1[2])") or after the resource name (e.g. texture(tex[2]@1)), but not both."texture(1[2],3,arr1[2]@4,arr2@6[3])")."texture(1),sampler(2)," or "texture(1),sampler(2)").vert for the vertex shader stage (i.e. StageFlags::VertexStage).tesc for the tessellation-control shader stage (i.e. StageFlags::TessControlStage).tese for the tessellation-evaluation shader stage (i.e. StageFlags::TessEvaluationStage).geom for the geometry shader stage (i.e. StageFlags::GeometryStage).frag for the fragment shader stage (i.e. StageFlags::FragmentStage).comp for the compute shader stage (i.e. StageFlags::ComputeStage).' ', tabulators '\t', new-line characters '\n' and '\r' etc.), see C++ STL function std::isspace. | SamplerDescriptor LLGL::ParseContext::AsSamplerDesc | ( | ) | const |
Generates a sampler descriptor from this parse context.
'=' assignment operator (e.g. filter=linear)."filter=linear,address=repeat," or "filter=linear,address=repeat").address maps to SamplerAddressMode and the accepted values are:repeat (SamplerAddressMode::Repeat).mirror (SamplerAddressMode::Mirror).clamp (SamplerAddressMode::Clamp).border (SamplerAddressMode::Border).mirrorOnce (SamplerAddressMode::MirrorOnce).filter maps to minification, magnification, and MIP-map filters and the accepted values are:none (Only for filter.mip to disable mipMapEnabled).nearest (SamplerFilter::Nearest).linear (SamplerFilter::Linear).lod.bias maps to SamplerDescriptor::mipMapLODBias and the value must be an integral or fractional number.lod.min maps to SamplerDescriptor::minLOD and the value must be an integral or fractional number.lod.max maps to SamplerDescriptor::maxLOD and the value must be an integral or fractional number.anisotropy maps to SamplerDescriptor::maxAnisotropy and the value must be an integral number.compare maps to SamplerDescriptor::compareOp (also enables SamplerDescriptor::compareEnabled) and the accepted values are:never (CompareOp::NeverPass).lt (CompareOp::Less). ls is also accepted but deprecated.eq (CompareOp::Equal).le (CompareOp::LessEqual).gt (CompareOp::Greater). gr is also accepted but deprecated.ne (CompareOp::NotEqual).ge (CompareOp::GreaterEqual).always (CompareOp::AlwaysPass).border maps to SamplerDescriptor::borderColor and the accepted values are:transparent (Border color of { 0, 0, 0, 0 }).black (Border color of { 0, 0, 0, 1 }).white (Border color of { 1, 1, 1, 1 }).address also accepts optional subscripts which can be one or more of the following subscripts:u or x maps to SamplerDescriptor::addressModeU.v or y maps to SamplerDescriptor::addressModeV.w or z maps to SamplerDescriptor::addressModeW.filter also accepts optional subscripts which can be either one of the following identifiers:min maps to SamplerDescriptor::minFilter.mag maps to SamplerDescriptor::magFilter.mip maps to SamplerDescriptor::mipMapFilter. | StencilDescriptor LLGL::ParseContext::AsStencilDesc | ( | ) | const |
Generates a stencil descriptor from this parse context.
| StencilFaceDescriptor LLGL::ParseContext::AsStencilFaceDesc | ( | ) | const |
Generates a stencil-face descriptor from this parse context.
sfail maps to StencilFaceDescriptor::stencilFailOp and the accepted values are:keep (StencilOp::Keep).zero (StencilOp::Zero).set (StencilOp::Replace).inc (StencilOp::IncClamp).dec (StencilOp::DecClamp).inv (StencilOp::Invert).incw (StencilOp::IncWrap).decw (StencilOp::DecWrap).dfail maps to StencilFaceDescriptor::depthFailOp and the accepted values are the same as for sfail.dpass maps to StencilFaceDescriptor::depthPassOp and the accepted values are the same as for sfail.compare maps to StencilFaceDescriptor::compareOp; see ParseContext::AsSamplerDesc for accepted value.read maps to StencilFaceDescriptor::readMask and accepts an integer value.write maps to StencilFaceDescriptor::writeMask and accepts an integer value.ref maps to StencilFaceDescriptor::reference and accepts an integer value. | TextureSwizzleRGBA LLGL::ParseContext::AsTextureSwizzleRGBA | ( | ) | const |
Generates a texture swizzle descriptor from this parse context.
'1' translates to TextureSwizzle::One'0' translates to TextureSwizzle::One'r' or 'R' translates to TextureSwizzle::Red'g' or 'G' translates to TextureSwizzle::Green'b' or 'B' translates to TextureSwizzle::Blue'a' or 'A' translates to TextureSwizzle::Alpha | VertexAttribute LLGL::ParseContext::AsVertexAttribute | ( | ) | const |
Generates a basic vertex attribute descriptor from this parse context. This only includes format and identifier.
'float' can be abbreviated with 'f', e.g. 'rgb32float' as 'rgb32f'.'sint' can be abbreviated with 'i', e.g. 'rgba16sint' as 'rgba16i'.'uint' can be abbreviated with 'u', e.g. 'rgba16uint' as 'rgba16u'. "rgb32f(position)". | DynamicVector< VertexAttribute > LLGL::ParseContext::AsVertexAttributeVector | ( | ) | const |
Generates a vector of basic vertex attributes from this parse context.
"rgb32f(position),rgba8unorm(color),".
|
inline |
Implicit conversion to DepthDescriptor.
|
inline |
Implicit conversion to DynamicVector<VertexAttribute>.
|
inline |
Implicit conversion to PipelineLayoutDescriptor.
|
inline |
Implicit conversion to SamplerDescriptor.
|
inline |
Implicit conversion to StencilDescriptor.
|
inline |
Implicit conversion to StencilFaceDescriptor.
|
inline |
Implicit conversion to TextureSwizzleRGBA.
|
inline |
Implicit conversion to VertexAttribute.
|
default |
|
default |