Interface for handling new include streams.
Definition IncludeHandler.hpp:21
Log base class.
Definition Log.hpp:19
Pre-processor to substitute macros and include directives.
Definition PreProcessor.hpp:38
InputShaderVersion
Input shader version enumeration.
Definition Targets.hpp:40
@ HLSL5
HLSL Shader Model 5.0 (DirectX 11).
ShaderTarget
Shader target enumeration.
Definition Targets.hpp:16
@ Undefined
Undefined shader target.
bool compileShader(const ShaderInput &inputDesc, const ShaderOutput &outputDesc, Log *log=nullptr, Reflection::ReflectionData *reflectionData=nullptr)
Cross compiles the shader code from the specified input stream into the specified output shader code.
OutputShaderVersion
Output shader version enumeration.
Definition Targets.hpp:67
@ GLSL
Auto-detect minimal required GLSL version (for OpenGL 2+).
std::shared_ptr< T > SPtr
SPtr is a smart pointer that retains shared ownership of an object through a pointer.
Definition SmartPtr.hpp:37
std::int32_t Int32
Definition DataTypes.hpp:21
sfl::small_vector< T, N, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > SmallVector
SmallVector is a sequence container similar to Vector.
Definition SmallVector.hpp:31
std::uint32_t UInt32
Definition DataTypes.hpp:23
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Language extension flags.
Definition ShaderCompiler.hpp:73
@ SpaceAttribute
Enables the 'space' attribute extension for a stronger type system (e.g. "[space(OBJECT,...
Definition ShaderCompiler.hpp:79
@ LayoutAttribute
Enables the 'layout' attribute extension (e.g. "[layout(rgba8)]").
Definition ShaderCompiler.hpp:76
@ All
All extensions.
Definition ShaderCompiler.hpp:82
Name mangling descriptor structure for shader input/output variables (also referred to as "varyings")...
Definition ShaderCompiler.hpp:185
String reservedWordPrefix
Name mangling prefix for reserved words (such as "texture", "main", "sin" etc.).
Definition ShaderCompiler.hpp:197
String namespacePrefix
Name mangling prefix for namespaces like structures or classes.
Definition ShaderCompiler.hpp:207
bool useAlwaysSemantics
If true, shader input/output variables are always renamed to their semantics, even for vertex input a...
Definition ShaderCompiler.hpp:212
bool renameBufferFields
If true, the data fields of a 'buffer'-objects is renamed rather than the outer identifier.
Definition ShaderCompiler.hpp:218
String temporaryPrefix
Name mangling prefix for temporary variables.
Definition ShaderCompiler.hpp:201
String inputPrefix
Name mangling prefix for shader input variables.
Definition ShaderCompiler.hpp:188
String outputPrefix
Name mangling prefix for shader output variables.
Definition ShaderCompiler.hpp:192
Structure for additional translation options.
Definition ShaderCompiler.hpp:115
Int32 autoBindingStartSlot
Index to start generating binding slots from.
Definition ShaderCompiler.hpp:127
bool rowMajorAlignment
If true, matrices have row-major alignment.
Definition ShaderCompiler.hpp:151
bool obfuscate
If true, code obfuscation is performed. By default, false.
Definition ShaderCompiler.hpp:133
bool autoBinding
If true, binding slots for all buffer types will be generated sequentially, starting with index at 'a...
Definition ShaderCompiler.hpp:123
bool preprocessOnly
If true, only the preprocessed source code will be written out. By default, false.
Definition ShaderCompiler.hpp:144
bool preferWrappers
If true, intrinsics are prefered to be implemented as wrappers (instead of inlining).
Definition ShaderCompiler.hpp:141
bool preserveComments
If true, commentaries are preserved for each statement. By default, false.
Definition ShaderCompiler.hpp:147
bool optimize
If true, little code optimizations are performed. By default, false.
Definition ShaderCompiler.hpp:136
bool separateSamplers
If true, generated GLSL code will contain separate sampler and texture objects when supported.
Definition ShaderCompiler.hpp:155
bool showAST
If true, the AST (Abstract Syntax Tree) will be written to the log output.
Definition ShaderCompiler.hpp:163
bool showTimes
If true, the timings of the different compilation processes are written to the log output.
Definition ShaderCompiler.hpp:167
bool explicitBinding
If true, explicit binding slots are enabled. By default, false.
Definition ShaderCompiler.hpp:130
bool writeGeneratorHeader
If true, the generator header with metadata is written as first comment to the output.
Definition ShaderCompiler.hpp:179
bool unrollArrayInitializers
If true, array initializations will be unrolled. By default, false.
Definition ShaderCompiler.hpp:171
bool separateShaders
If true, generated GLSL code will support the 'ARB_separate_shader_objects' extension.
Definition ShaderCompiler.hpp:159
bool allowExtensions
If true, the shader output may contain GLSL extensions, if the target shader version is too low.
Definition ShaderCompiler.hpp:118
bool validateOnly
If true, the source code is only validated, but no output code will be generated.
Definition ShaderCompiler.hpp:175
Structure for shader output statistics (e.g. texture/buffer binding points).
Definition Reflection.hpp:418
Shader output descriptor structure.
Definition ShaderCompiler.hpp:293
OutputShaderVersion shaderVersion
Specifies the output shader version.
Definition ShaderCompiler.hpp:305
UniformPacking uniformPacking
Optional parameters to pack all global uniforms into a single output uniform buffer.
Definition ShaderCompiler.hpp:314
NameMangling nameMangling
Specifies the options for name mangling.
Definition ShaderCompiler.hpp:323
String filename
Specifies the filename of the output shader code.
Definition ShaderCompiler.hpp:296
Formatting formatting
Output code formatting descriptor.
Definition ShaderCompiler.hpp:320
std::ostream * sourceCode
Specifies the output source code stream.
Definition ShaderCompiler.hpp:301
SmallVector< VertexSemantic, 10 > vertexSemantics
Optional list of vertex semantic layouts, to bind a vertex attribute (semantic name) to a location in...
Definition ShaderCompiler.hpp:310
Options options
Additional options to configure the code generation.
Definition ShaderCompiler.hpp:317
Vertex shader semantic (or rather attribute) layout structure.
Definition ShaderCompiler.hpp:268
Int32 location
Specifies the binding location.
Definition ShaderCompiler.hpp:273
String semantic
Specifies the shader semantic (or rather attribute).
Definition ShaderCompiler.hpp:270
Compiler warning flags.
Definition ShaderCompiler.hpp:31
@ IndexBoundary
Warning for index boundary violations.
Definition ShaderCompiler.hpp:64
@ Basic
Warning for basic issues (control path, disabled code etc.).
Definition ShaderCompiler.hpp:34
@ Syntax
Warning for syntactic issues.
Definition ShaderCompiler.hpp:37
@ RequiredExtensions
Warning for required extensions in the output code.
Definition ShaderCompiler.hpp:58
@ UnlocatedObjects
Warning for optional objects that where not found.
Definition ShaderCompiler.hpp:55
@ DeclarationShadowing
Warning for declarations that shadow a previous local (e.g. for-loops or variables in class hierarchy...
Definition ShaderCompiler.hpp:52
@ CodeReflection
Warning for issues during code reflection.
Definition ShaderCompiler.hpp:61
@ All
All warnings.
Definition ShaderCompiler.hpp:67
@ UnusedVariables
Warning for unused variables.
Definition ShaderCompiler.hpp:43
@ ImplicitTypeConversions
Warning for specific implicit type conversions.
Definition ShaderCompiler.hpp:49
@ EmptyStatementBody
Warning for statements with empty body.
Definition ShaderCompiler.hpp:46