diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-09-13 12:30:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-13 12:30:54 -0700 |
| commit | 5c45b09e4c1727a4ab081e3c48775ed5c8a0638f (patch) | |
| tree | 8c24595f78a47e962155e49a30f2ed6ac6ca9f5d /source/slang/type-layout.h | |
| parent | 11bd6632edfc44d15c2f1b1603aecfa9376f2dc5 (diff) | |
| parent | 3763ca90479338f26b30a0147e8d41512c38e0cd (diff) | |
Merge branch 'master' into design-docs
Diffstat (limited to 'source/slang/type-layout.h')
| -rw-r--r-- | source/slang/type-layout.h | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/source/slang/type-layout.h b/source/slang/type-layout.h index 8a034b5a6..971088aac 100644 --- a/source/slang/type-layout.h +++ b/source/slang/type-layout.h @@ -313,6 +313,22 @@ public: size_t uniformStride; }; +// When storing the layout for a matrix-type +// value, we need to know whether it has been +// laid ot with row-major or column-major +// storage. +// +enum MatrixLayoutMode +{ + kMatrixLayoutMode_RowMajor, + kMatrixLayoutMode_ColumnMajor, +}; +class MatrixTypeLayout : public TypeLayout +{ +public: + MatrixLayoutMode mode; +}; + // Specific case of type layout for a struct class StructTypeLayout : public TypeLayout { @@ -515,6 +531,8 @@ struct LayoutRulesImpl // LayoutRulesFamilyImpl* getLayoutRulesFamily() { return family; } + + MatrixLayoutMode getDefaultMatrixLayoutMode(); }; struct LayoutRulesFamilyImpl @@ -526,6 +544,7 @@ struct LayoutRulesFamilyImpl virtual LayoutRulesImpl* getVaryingOutputRules() = 0; virtual LayoutRulesImpl* getSpecializationConstantRules() = 0; virtual LayoutRulesImpl* getShaderStorageBufferRules() = 0; + virtual MatrixLayoutMode getDefaultMatrixLayoutMode() = 0; }; LayoutRulesImpl* GetLayoutRulesImpl(LayoutRule rule); @@ -541,21 +560,30 @@ RefPtr<TypeLayout> CreateTypeLayout(Type* type, LayoutRulesImpl* rules, SimpleLa // +struct TypeLayoutContext; + // Create a type layout for a parameter block type. RefPtr<ParameterBlockTypeLayout> createParameterBlockTypeLayout( - RefPtr<ParameterBlockType> parameterBlockType, - LayoutRulesImpl* rules); + TypeLayoutContext* context, + RefPtr<ParameterBlockType> parameterBlockType); RefPtr<ParameterBlockTypeLayout> createParameterBlockTypeLayout( + TypeLayoutContext* context, RefPtr<ParameterBlockType> parameterBlockType, - LayoutRulesImpl* parameterBlockRules, - RefPtr<Type> elementType, + RefPtr<Type> elementType, LayoutRulesImpl* elementTypeRules); RefPtr<ParameterBlockTypeLayout> createParameterBlockTypeLayout( + TypeLayoutContext* context, + RefPtr<ParameterBlockType> parameterBlockType, + SimpleLayoutInfo parameterBlockInfo, + RefPtr<TypeLayout> elementTypeLayout); + +RefPtr<ParameterBlockTypeLayout> +createParameterBlockTypeLayout( RefPtr<ParameterBlockType> parameterBlockType, LayoutRulesImpl* parameterBlockRules, SimpleLayoutInfo parameterBlockInfo, |
