diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-03-02 14:33:31 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-02 20:23:00 +0000 |
commit | 8e48c1e1d38bf0f0086971be2b077d1a2cb12131 (patch) | |
tree | e4db3d07e04e8e4475b268e0e897e98b10e70fb2 /src | |
parent | ea5e676a7b75600edcde3912886486004ccd7626 (diff) |
fixed duplicate interface variable in SPIR-V output
BUG=skia:
Change-Id: Iee6b8de83b8ee6ce9de910a12bd86042018d7965
Reviewed-on: https://skia-review.googlesource.com/9167
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/sksl/SkSLSPIRVCodeGenerator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.cpp b/src/sksl/SkSLSPIRVCodeGenerator.cpp index 85e996c031..93ec4ce9b2 100644 --- a/src/sksl/SkSLSPIRVCodeGenerator.cpp +++ b/src/sksl/SkSLSPIRVCodeGenerator.cpp @@ -2820,7 +2820,7 @@ void SPIRVCodeGenerator::writeReturnStatement(const ReturnStatement& r, SkWStrea void SPIRVCodeGenerator::writeInstructions(const Program& program, SkWStream& out) { fGLSLExtendedInstructions = this->nextId(); SkDynamicMemoryWStream body; - std::vector<SpvId> interfaceVars; + std::set<SpvId> interfaceVars; // assign IDs to functions for (size_t i = 0; i < program.fElements.size(); i++) { if (program.fElements[i]->fKind == ProgramElement::kFunction_Kind) { @@ -2834,7 +2834,7 @@ void SPIRVCodeGenerator::writeInstructions(const Program& program, SkWStream& ou SpvId id = this->writeInterfaceBlock(intf); if ((intf.fVariable.fModifiers.fFlags & Modifiers::kIn_Flag) || (intf.fVariable.fModifiers.fFlags & Modifiers::kOut_Flag)) { - interfaceVars.push_back(id); + interfaceVars.insert(id); } } } @@ -2861,7 +2861,7 @@ void SPIRVCodeGenerator::writeInstructions(const Program& program, SkWStream& ou if (var->fStorage == Variable::kGlobal_Storage && ((var->fModifiers.fFlags & Modifiers::kIn_Flag) || (var->fModifiers.fFlags & Modifiers::kOut_Flag))) { - interfaceVars.push_back(entry.second); + interfaceVars.insert(entry.second); } } this->writeCapabilities(out); |