summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-c-like.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-emit-c-like.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-emit-c-like.cpp')
-rw-r--r--source/slang/slang-emit-c-like.cpp49
1 files changed, 0 insertions, 49 deletions
diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp
index 84c369d40..f9d71beb9 100644
--- a/source/slang/slang-emit-c-like.cpp
+++ b/source/slang/slang-emit-c-like.cpp
@@ -1450,17 +1450,6 @@ void CLikeSourceEmitter::_emitCallArgList(IRCall* inst)
m_writer->emit(")");
}
-void CLikeSourceEmitter::handleRequiredCapabilities(IRInst* inst)
-{
- auto decoratedValue = inst;
- while (auto specInst = as<IRSpecialize>(decoratedValue))
- {
- decoratedValue = getSpecializedValue(specInst);
- }
-
- handleRequiredCapabilitiesImpl(decoratedValue);
-}
-
void CLikeSourceEmitter::emitCallExpr(IRCall* inst, EmitOpInfo outerPrec)
{
auto funcValue = inst->getOperand(0);
@@ -2164,15 +2153,6 @@ void CLikeSourceEmitter::emitSemantics(IRInst* inst)
emitSemanticsImpl(inst);
}
-IRVarLayout* CLikeSourceEmitter::getVarLayout(IRInst* var)
-{
- auto decoration = var->findDecoration<IRLayoutDecoration>();
- if (!decoration)
- return nullptr;
-
- return as<IRVarLayout>(decoration->getLayout());
-}
-
void CLikeSourceEmitter::emitLayoutSemantics(IRInst* inst, char const* uniformSemanticSpelling)
{
emitLayoutSemanticsImpl(inst, uniformSemanticSpelling);
@@ -2781,35 +2761,6 @@ void CLikeSourceEmitter::emitParamTypeImpl(IRType* type, String const& name)
emitType(type, name);
}
-IRInst* CLikeSourceEmitter::getSpecializedValue(IRSpecialize* specInst)
-{
- auto base = specInst->getBase();
-
- // It is possible to have a `specialize(...)` where the first
- // operand is also a `specialize(...)`, so that we need to
- // look at what declaration is being specialized at the inner
- // step to find the one being specialized at the outer step.
- //
- while(auto baseSpecialize = as<IRSpecialize>(base))
- {
- base = getSpecializedValue(baseSpecialize);
- }
-
- auto baseGeneric = as<IRGeneric>(base);
- if (!baseGeneric)
- return base;
-
- auto lastBlock = baseGeneric->getLastBlock();
- if (!lastBlock)
- return base;
-
- auto returnInst = as<IRReturnVal>(lastBlock->getTerminator());
- if (!returnInst)
- return base;
-
- return returnInst->getVal();
-}
-
void CLikeSourceEmitter::emitFuncDecl(IRFunc* func)
{
// We don't want to emit declarations for operations