engine
 
载入中...
搜索中...
未找到
Public 类型 | Public 成员函数 | 静态 Public 成员函数 | 静态 Public 属性 | 所有成员列表
TShaderPermutationDomain< Ts > 模板结构体 参考

Variadic template that defines an arbitrary multi-dimensional permutation domain, that can be instantiated to represent a vector within the domain. 更多...

#include <ShaderPermutation.h>

Public 类型

using Type = TShaderPermutationDomain< Ts... >
 Setup the dimension's type in permutation domain as itself so that a permutation domain can be used as a dimension of another domain.
 

Public 成员函数

template<class DimensionToGet >
const DimensionToGet::Type Get () const
 get dimension's value, but in this case emit compile time error if could not find the dimension to get.
 
void ModifyCompilationEnvironment (FShaderCompilerEnvironment &OutEnvironment) const
 Modify compilation environment.
 
bool operator== (const Type &Other) const
 Test if equal.
 
template<class DimensionToSet >
void Set (typename DimensionToSet::Type)
 Set dimension's value, but in this case emit compile time error if could not find the dimension to set.
 
 TShaderPermutationDomain ()
 Constructors.
 

静态 Public 成员函数

static Type FromDimensionValueId (const int32 PermutationId)
 Returns the permutation domain from the unique ID.
 
static int32 ToDimensionValueId (const Type &PermutationVector)
 Converts domain permutation vector to domain's value id.
 

静态 Public 属性

static constexpr bool IsMultiDimensional = true
 Define a domain as a multidimensional dimension so that ModifyCompilationEnvironment() is getting used.
 
static constexpr int32 PermutationCount = 1
 Total number of permutation within the domain is one if no dimension at all.
 

详细描述

template<typename... Ts>
struct TShaderPermutationDomain< Ts >

Variadic template that defines an arbitrary multi-dimensional permutation domain, that can be instantiated to represent a vector within the domain.

// Defines a permutation domain with arbitrary number of dimensions. Dimensions can themselves be domains. // It is totally legal to have a domain with no dimensions. class FMyPermutationDomain = TShaderPermutationDomain<FMyDimensionA, FMyDimensionB, FMyDimensionC>;

// ...

// Create a permutation vector to be initialized. By default a vector is set at the origin of the domain. // The origin of the domain is the ShaderPermutationId == 0. FMyPermutationDomain PermutationVector;

// Set the permutation vector's dimensions. PermutationVector.Set<FMyDimensionA>(MyDimensionValueA); PermutationVector.Set<FMyDimensionB>(MyDimensionValueB); PermutationVector.Set<FMyDimensionC>(MyDimensionValueC);

// Get the permutation id from the permutation vector for shader compiler. int32 ShaderPermutationId = PermutationVector.ToDimensionValueId();

// Reconstruct the permutation vector from shader permutation id. FMyPermutationDomain PermutationVector2(ShaderPermutationId);

// Get permutation vector's dimension. if (PermutationVector2.Get<FMyDimensionA>()) { }


该结构体的文档由以下文件生成: