Nameless Engine
|
#include <ShaderMacro.h>
Static Public Member Functions | |
static unsigned long long | convertConfigurationToHash (const std::set< ShaderMacro > &configuration) |
static std::string | convertConfigurationToText (const std::set< ShaderMacro > &configuration) |
static bool | isMacroShouldBeConsideredInConfiguration (ShaderMacro macro, const std::set< ShaderMacro > &configuration) |
Static Public Attributes | |
static const std::set< std::set< ShaderMacro > > | validVertexShaderMacroConfigurations |
static const std::set< std::set< ShaderMacro > > | validPixelShaderMacroConfigurations |
static const std::set< std::set< ShaderMacro > > | validComputeShaderMacroConfigurations = {{}} |
Static Private Member Functions | |
static std::set< std::set< ShaderMacro > > | combineConfigurations (const std::set< std::set< ShaderMacro > > &constantSets, const std::set< std::set< ShaderMacro > > ¯oSets, const std::set< ShaderMacro > &appendToEachSet, bool bIncludeEmptyConfiguration) |
static std::set< std::set< ShaderMacro > > | duplicateAndAppendConfiguration (const std::set< std::set< ShaderMacro > > &toDuplicateSets, const std::set< ShaderMacro > &toAppendToDuplicated) |
Static Private Attributes | |
static const std::unordered_map< ShaderMacro, ShaderMacro > | dependentMacros = {} |
Defines valid shader macro combinations (configurations), plus some helper functions.
|
staticprivate |
Combines the specified macro sets with macros to append.
Example:
constantSets | Sets that will be in the resulting set. |
macroSets | Sets to append macros to. |
appendToEachSet | Each macro from this set will be added to each set of the second argument. |
bIncludeEmptyConfiguration | Whether to add empty configuration to resulting sets or not. |
|
static |
Converts configuration to hash.
configuration | Used shader configuration. |
|
static |
Converts configuration to text.
configuration | Used shader configuration. |
|
staticprivate |
Takes an array of shader configurations, duplicates it and appends additional macros to the duplicated set.
toDuplicateSets | Original sets to duplicate. |
toAppendToDuplicated | Macros to add to each set of the duplicated sets. |
|
static |
Tells if the specified macro is valid (should be considered) in the specified configuration. Some macros depend on other which creates a situation where some macros should not be considered.
macro | Macro to test. |
configuration | Configuration that the specified macro is going to be used. |
true
if the specified macro should be used in the specified configuration, false
if some dependent macro does not exist in the specified configuration and thus makes the use of the specified macro useless.
|
inlinestaticprivate |
Defines dependent macros that should be considered only when a specific macro is defined. Stores pairs of "dependent macro" - "macro it depends on".
Example:
|
inlinestatic |
Valid combinations of compute shader macros.
|
inlinestatic |
Valid combinations of pixel shader macros.
|
inlinestatic |
Valid combinations of vertex shader macros.