Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: src/sksl/SkSLSPIRVCodeGenerator.cpp

Issue 2129913002: fix for SkSL producing invalid branch after an OpKill (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkSLSPIRVCodeGenerator.h" 8 #include "SkSLSPIRVCodeGenerator.h"
9 9
10 #include "string.h" 10 #include "string.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 ABORT("unsupported SPIR-V op"); 768 ABORT("unsupported SPIR-V op");
769 } 769 }
770 } 770 }
771 #endif 771 #endif
772 772
773 void SPIRVCodeGenerator::writeOpCode(SpvOp_ opCode, int length, std::ostream& ou t) { 773 void SPIRVCodeGenerator::writeOpCode(SpvOp_ opCode, int length, std::ostream& ou t) {
774 ASSERT(opCode != SpvOpUndef); 774 ASSERT(opCode != SpvOpUndef);
775 switch (opCode) { 775 switch (opCode) {
776 case SpvOpReturn: // fall through 776 case SpvOpReturn: // fall through
777 case SpvOpReturnValue: // fall through 777 case SpvOpReturnValue: // fall through
778 case SpvOpKill: // fall through
778 case SpvOpBranch: // fall through 779 case SpvOpBranch: // fall through
779 case SpvOpBranchConditional: 780 case SpvOpBranchConditional:
780 ASSERT(fCurrentBlock); 781 ASSERT(fCurrentBlock);
781 fCurrentBlock = 0; 782 fCurrentBlock = 0;
782 break; 783 break;
783 case SpvOpConstant: // fall through 784 case SpvOpConstant: // fall through
784 case SpvOpConstantTrue: // fall through 785 case SpvOpConstantTrue: // fall through
785 case SpvOpConstantFalse: // fall through 786 case SpvOpConstantFalse: // fall through
786 case SpvOpConstantComposite: // fall through 787 case SpvOpConstantComposite: // fall through
787 case SpvOpTypeVoid: // fall through 788 case SpvOpTypeVoid: // fall through
(...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after
2619 this->writeWord(SpvVersion, out); 2620 this->writeWord(SpvVersion, out);
2620 this->writeWord(SKSL_MAGIC, out); 2621 this->writeWord(SKSL_MAGIC, out);
2621 std::stringstream buffer; 2622 std::stringstream buffer;
2622 this->writeInstructions(program, buffer); 2623 this->writeInstructions(program, buffer);
2623 this->writeWord(fIdCount, out); 2624 this->writeWord(fIdCount, out);
2624 this->writeWord(0, out); // reserved, always zero 2625 this->writeWord(0, out); // reserved, always zero
2625 out << buffer.str(); 2626 out << buffer.str();
2626 } 2627 }
2627 2628
2628 } 2629 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698