diff options
| author | Yong He <yonghe@outlook.com> | 2022-02-25 20:49:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-25 20:49:31 -0800 |
| commit | c31577953d5041c82375c22d847c2eba06106c58 (patch) | |
| tree | bc685a8b63fc13cb85d160ae13df950056ca6e91 /source/slang/slang-ir.cpp | |
| parent | 8990d270e3a0c01b1f7abbf4f79556c5ef82a096 (diff) | |
Improved SCCP, inlining and resource specialization passes, legalize `ImageSubscript` for GLSL (#2146)
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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<IRImageLoad>(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<IRImageStore>(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: |
