From c31577953d5041c82375c22d847c2eba06106c58 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 25 Feb 2022 20:49:31 -0800 Subject: Improved SCCP, inlining and resource specialization passes, legalize `ImageSubscript` for GLSL (#2146) --- source/slang/slang-ir.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index f7ebfdb64..721488f82 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -3541,6 +3541,21 @@ namespace Slang return inst; } + IRInst* IRBuilder::emitImageLoad(IRType* type, IRInst* image, IRInst* coord) + { + auto inst = createInst(this, kIROp_ImageLoad, type, image, coord); + addInst(inst); + return inst; + } + + IRInst* IRBuilder::emitImageStore(IRType* type, IRInst* image, IRInst* coord, IRInst* value) + { + IRInst* args[] = {image, coord, value}; + auto inst = createInst(this, kIROp_ImageStore, type, 3, args); + addInst(inst); + return inst; + } + IRInst* IRBuilder::emitFieldExtract( IRType* type, IRInst* base, @@ -5730,6 +5745,7 @@ namespace Slang case kIROp_makeArray: case kIROp_makeStruct: case kIROp_Load: // We are ignoring the possibility of loads from bad addresses, or `volatile` loads + case kIROp_ImageSubscript: case kIROp_FieldExtract: case kIROp_FieldAddress: case kIROp_getElement: -- cgit v1.2.3