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

Unified Diff: src/sksl/SkSLSPIRVCodeGenerator.cpp

Issue 2300023002: minor SkSL changes to avoid compiler errors in Chromium (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sksl/SkSLParser.cpp ('k') | src/sksl/ir/SkSLFieldAccess.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sksl/SkSLSPIRVCodeGenerator.cpp
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.cpp b/src/sksl/SkSLSPIRVCodeGenerator.cpp
index 8a38cf7028bf263b77ed479d848362f9c91a7bfb..efa41bfd1ad68ae3bddd1f370569e5c3b78cdfd9 100644
--- a/src/sksl/SkSLSPIRVCodeGenerator.cpp
+++ b/src/sksl/SkSLSPIRVCodeGenerator.cpp
@@ -973,7 +973,7 @@ void SPIRVCodeGenerator::writeStruct(const Type& type, SpvId resultId) {
// in the middle of writing the struct instruction
std::vector<SpvId> types;
for (const auto& f : type.fields()) {
- types.push_back(this->getType(f.fType));
+ types.push_back(this->getType(*f.fType));
}
this->writeOpCode(SpvOpTypeStruct, 2 + (int32_t) types.size(), fConstantBuffer);
this->writeWord(resultId, fConstantBuffer);
@@ -982,8 +982,8 @@ void SPIRVCodeGenerator::writeStruct(const Type& type, SpvId resultId) {
}
size_t offset = 0;
for (int32_t i = 0; i < (int32_t) type.fields().size(); i++) {
- size_t size = type.fields()[i].fType.size();
- size_t alignment = type.fields()[i].fType.alignment();
+ size_t size = type.fields()[i].fType->size();
+ size_t alignment = type.fields()[i].fType->alignment();
size_t mod = offset % alignment;
if (mod != 0) {
offset += alignment - mod;
@@ -995,14 +995,14 @@ void SPIRVCodeGenerator::writeStruct(const Type& type, SpvId resultId) {
this->writeInstruction(SpvOpMemberDecorate, resultId, (SpvId) i, SpvDecorationOffset,
(SpvId) offset, fDecorationBuffer);
}
- if (type.fields()[i].fType.kind() == Type::kMatrix_Kind) {
+ if (type.fields()[i].fType->kind() == Type::kMatrix_Kind) {
this->writeInstruction(SpvOpMemberDecorate, resultId, i, SpvDecorationColMajor,
fDecorationBuffer);
this->writeInstruction(SpvOpMemberDecorate, resultId, i, SpvDecorationMatrixStride,
- (SpvId) type.fields()[i].fType.stride(), fDecorationBuffer);
+ (SpvId) type.fields()[i].fType->stride(), fDecorationBuffer);
}
offset += size;
- Type::Kind kind = type.fields()[i].fType.kind();
+ Type::Kind kind = type.fields()[i].fType->kind();
if ((kind == Type::kArray_Kind || kind == Type::kStruct_Kind) && offset % alignment != 0) {
offset += alignment - offset % alignment;
}
« no previous file with comments | « src/sksl/SkSLParser.cpp ('k') | src/sksl/ir/SkSLFieldAccess.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698