diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-09-12 11:25:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-12 11:25:16 -0700 |
| commit | 3763ca90479338f26b30a0147e8d41512c38e0cd (patch) | |
| tree | a68fc0d963e434d554c67019b87adf81d899c1f9 /source/slang/type-layout.h | |
| parent | b0b076357f0869c0483fad6c456d6079e5a52610 (diff) | |
| parent | 2e0f8f28a781c285e96670e515d8fab24c484ce8 (diff) | |
Merge pull request #181 from tfoleyNV/ir-lowering-work
Get IR working for `AdaptiveTessellationCS40/Render` test
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, |
