diff options
Diffstat (limited to 'src/sksl/SkSLSPIRVCodeGenerator.cpp')
-rw-r--r-- | src/sksl/SkSLSPIRVCodeGenerator.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.cpp b/src/sksl/SkSLSPIRVCodeGenerator.cpp index 5403ba3628..d17e3c42a2 100644 --- a/src/sksl/SkSLSPIRVCodeGenerator.cpp +++ b/src/sksl/SkSLSPIRVCodeGenerator.cpp @@ -15,7 +15,6 @@ #include "ir/SkSLExtension.h" #include "ir/SkSLIndexExpression.h" #include "ir/SkSLVariableReference.h" -#include "SkSLCompiler.h" namespace SkSL { @@ -2163,19 +2162,13 @@ SpvId SPIRVCodeGenerator::writePrefixExpression(const PrefixExpression& p, std:: lv->store(result, out); return result; } - case Token::LOGICALNOT: { + case Token::NOT: { ASSERT(p.fOperand->fType == *fContext.fBool_Type); SpvId result = this->nextId(); this->writeInstruction(SpvOpLogicalNot, this->getType(p.fOperand->fType), result, this->writeExpression(*p.fOperand, out), out); return result; } - case Token::BITWISENOT: { - SpvId result = this->nextId(); - this->writeInstruction(SpvOpNot, this->getType(p.fOperand->fType), result, - this->writeExpression(*p.fOperand, out), out); - return result; - } default: ABORT("unsupported prefix expression: %s", p.description().c_str()); } @@ -2328,7 +2321,7 @@ void SPIRVCodeGenerator::writeLayout(const Layout& layout, SpvId target) { this->writeInstruction(SpvOpDecorate, target, SpvDecorationDescriptorSet, layout.fSet, fDecorationBuffer); } - if (layout.fBuiltin >= 0 && layout.fBuiltin != SK_FRAGCOLOR_BUILTIN) { + if (layout.fBuiltin >= 0) { this->writeInstruction(SpvOpDecorate, target, SpvDecorationBuiltIn, layout.fBuiltin, fDecorationBuffer); } @@ -2370,19 +2363,10 @@ SpvId SPIRVCodeGenerator::writeInterfaceBlock(const InterfaceBlock& intf) { return result; } -#define BUILTIN_IGNORE 9999 -void SPIRVCodeGenerator::writeGlobalVars(Program::Kind kind, const VarDeclarations& decl, - std::ostream& out) { +void SPIRVCodeGenerator::writeGlobalVars(const VarDeclarations& decl, std::ostream& out) { for (size_t i = 0; i < decl.fVars.size(); i++) { const VarDeclaration& varDecl = decl.fVars[i]; const Variable* var = varDecl.fVar; - if (var->fModifiers.fLayout.fBuiltin == BUILTIN_IGNORE) { - continue; - } - if (var->fModifiers.fLayout.fBuiltin == SK_FRAGCOLOR_BUILTIN && - kind != Program::kFragment_Kind) { - continue; - } if (!var->fIsReadFrom && !var->fIsWrittenTo && !(var->fModifiers.fFlags & (Modifiers::kIn_Flag | Modifiers::kOut_Flag | @@ -2578,8 +2562,7 @@ void SPIRVCodeGenerator::writeInstructions(const Program& program, std::ostream& } for (size_t i = 0; i < program.fElements.size(); i++) { if (program.fElements[i]->fKind == ProgramElement::kVar_Kind) { - this->writeGlobalVars(program.fKind, ((VarDeclarations&) *program.fElements[i]), - body); + this->writeGlobalVars(((VarDeclarations&) *program.fElements[i]), body); } } for (size_t i = 0; i < program.fElements.size(); i++) { |