From 6406523511037987d8b8ab881aea41389afd57eb Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 12 Aug 2021 13:14:15 -0700 Subject: 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. --- source/slang/slang-ir.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-ir.cpp') 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, -- cgit v1.2.3