summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-08-12 13:14:15 -0700
committerGitHub <noreply@github.com>2021-08-12 13:14:15 -0700
commit6406523511037987d8b8ab881aea41389afd57eb (patch)
tree79f24b6cba377340c2f4d3dcf9fed78fc586f3e0 /source/slang/slang-ir.cpp
parent389d21d982da34815b65b10cae63088c397eecc8 (diff)
Further implementation of SPIRV direct emit. (#1920)
* Further implementation of SPIRV direct emit. This change implements: - Struct, Vector, Matrix and Unsized Array types. - Basic arithmetic opcodes, vector construct, swizzle etc. - getElementPtr, getElement, fieldAddress, extractField. - SPIRV target intrinsics with SPIRV asm code in stdlib. - RWStructuredBuffer and StructuredBuffer. - Pointer storage class propagation. - Control flow. * Fix.
Diffstat (limited to 'source/slang/slang-ir.cpp')
-rw-r--r--source/slang/slang-ir.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index fe60fb480..60aaafa83 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -2604,6 +2604,12 @@ namespace Slang
operands);
}
+ IRPtrType* IRBuilder::getPtrType(IROp op, IRType* valueType, IRIntegerValue addressSpace)
+ {
+ IRInst* operands[] = {valueType, getIntValue(getIntType(), addressSpace)};
+ return (IRPtrType*)getType(op, 2, operands);
+ }
+
IRArrayTypeBase* IRBuilder::getArrayTypeBase(
IROp op,
IRType* elementType,