diff options
| author | Pierre Moreau <dev@pmoreau.org> | 2018-04-21 18:09:15 +0200 |
|---|---|---|
| committer | Karol Herbst <kherbst@redhat.com> | 2018-06-13 20:21:31 +0200 |
| commit | a373c16a258d8e1d2db79c1a1c1b6be5415a699b (patch) | |
| tree | 67583becdd773c513f58484224d260ab2c0614a6 | |
| parent | 284d40e470b1f187d38ee936242c306ddc99596b (diff) | |
Add the input storage class and use it for builtins instead of Uniform
| -rw-r--r-- | lib/SPIRV/OCL20ToSPIRV.cpp | 2 | ||||
| -rw-r--r-- | lib/SPIRV/SPIRVInternal.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/SPIRV/OCL20ToSPIRV.cpp b/lib/SPIRV/OCL20ToSPIRV.cpp index a8b8e8c..504bfd6 100644 --- a/lib/SPIRV/OCL20ToSPIRV.cpp +++ b/lib/SPIRV/OCL20ToSPIRV.cpp @@ -1196,7 +1196,7 @@ void OCL20ToSPIRV::transWorkItemBuiltinsToVariables() { IsVec ? VectorType::get(I.getReturnType(), 3) : I.getReturnType(); auto BV = new GlobalVariable( *M, GVType, true, GlobalValue::ExternalLinkage, nullptr, BuiltinVarName, - 0, GlobalVariable::NotThreadLocal, SPIRAS_Constant); + 0, GlobalVariable::NotThreadLocal, SPIRAS_Input); std::vector<Instruction *> InstList; for (auto UI = I.user_begin(), UE = I.user_end(); UI != UE; ++UI) { auto CI = dyn_cast<CallInst>(*UI); diff --git a/lib/SPIRV/SPIRVInternal.h b/lib/SPIRV/SPIRVInternal.h index 99962b0..75e3281 100644 --- a/lib/SPIRV/SPIRVInternal.h +++ b/lib/SPIRV/SPIRVInternal.h @@ -178,6 +178,7 @@ enum SPIRAddressSpace { SPIRAS_Constant, SPIRAS_Local, SPIRAS_Generic, + SPIRAS_Input, SPIRAS_Count, }; @@ -187,6 +188,7 @@ template <> inline void SPIRVMap<SPIRAddressSpace, std::string>::init() { add(SPIRAS_Constant, "Constant"); add(SPIRAS_Local, "Local"); add(SPIRAS_Generic, "Generic"); + add(SPIRAS_Input, "Input"); } typedef SPIRVMap<SPIRAddressSpace, SPIRVStorageClassKind> SPIRAddrSpaceCapitalizedNameMap; @@ -198,6 +200,7 @@ inline void SPIRVMap<SPIRAddressSpace, SPIRVStorageClassKind>::init() { add(SPIRAS_Constant, StorageClassUniformConstant); add(SPIRAS_Local, StorageClassWorkgroup); add(SPIRAS_Generic, StorageClassGeneric); + add(SPIRAS_Input, StorageClassInput); } typedef SPIRVMap<SPIRAddressSpace, SPIRVStorageClassKind> SPIRSPIRVAddrSpaceMap; |
