diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-09-17 12:25:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-17 12:25:45 -0400 |
| commit | 3af404da7f7f125464b78159940cb3fc06e69cc5 (patch) | |
| tree | d1640fc1ac08be8a15420a8603eba991833a1792 /source/slang/slang-emit-cpp.h | |
| parent | 3758a50dae81973b00541f2a151e3ee9cd2d1645 (diff) | |
CPU ABI improvements (#1056)
* WIP: Improving CPU performance/ABI
* Optionally output code on CPU for groupThreadID and groupID.
* Added ability to set compute dispatch size on command line for render-test.
Dispatch compute tests taking into account dispatch size.
Added test for semantics are working.
* Test using GroupRange.
* Fix problem with adding \n for externa diagnostic - to do it if there isn't a \n at the end. Change the ouput order (put result before) so last value is diagnostic string.
Diffstat (limited to 'source/slang/slang-emit-cpp.h')
| -rw-r--r-- | source/slang/slang-emit-cpp.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/slang/slang-emit-cpp.h b/source/slang/slang-emit-cpp.h index 906086d71..f15a302e5 100644 --- a/source/slang/slang-emit-cpp.h +++ b/source/slang/slang-emit-cpp.h @@ -132,6 +132,17 @@ public: SLANG_CPP_INTRINSIC_OP(SLANG_CPP_INTRINSIC_OP_ENUM) }; + typedef uint32_t SemanticUsedFlags; + struct SemanticUsedFlag + { + enum Enum : SemanticUsedFlags + { + DispatchThreadID = 0x01, + GroupThreadID = 0x02, + GroupID = 0x04, + }; + }; + struct OperationInfo { UnownedStringSlice name; @@ -257,9 +268,12 @@ protected: SlangResult _calcTextureTypeName(IRTextureTypeBase* texType, StringBuilder& outName); - void _emitEntryPointDefinitionStart(IRFunc* func, IRGlobalParam* entryPointGlobalParams, const String& funcName); + void _emitEntryPointDefinitionStart(IRFunc* func, IRGlobalParam* entryPointGlobalParams, const String& funcName, const UnownedStringSlice& varyingTypeName); void _emitEntryPointDefinitionEnd(IRFunc* func); void _emitEntryPointGroup(const UInt sizeAlongAxis[3], const String& funcName); + void _emitEntryPointGroupRange(const UInt sizeAlongAxis[3], const String& funcName); + + void _emitInitAxisValues(const UInt sizeAlongAxis[3], const UnownedStringSlice& mulName, const UnownedStringSlice& addName); Dictionary<SpecializedIntrinsic, StringSlicePool::Handle> m_intrinsicNameMap; Dictionary<IRType*, StringSlicePool::Handle> m_typeNameMap; @@ -295,6 +309,8 @@ protected: List<IntrinsicOp> m_intrinsicOpMap; StringSlicePool m_slicePool; + + SemanticUsedFlags m_semanticUsedFlags; }; } |
