Index: src/sksl/SkSLSPIRVCodeGenerator.h |
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.h b/src/sksl/SkSLSPIRVCodeGenerator.h |
index b79194500a5f8213fc8b20c9b84365a72755b2d4..c885ffc3ff69d939fe170ac0c2289df7c76d9a7a 100644 |
--- a/src/sksl/SkSLSPIRVCodeGenerator.h |
+++ b/src/sksl/SkSLSPIRVCodeGenerator.h |
@@ -14,6 +14,7 @@ |
#include "SkStream.h" |
#include "SkSLCodeGenerator.h" |
+#include "SkSLMemoryLayout.h" |
#include "ir/SkSLBinaryExpression.h" |
#include "ir/SkSLBoolLiteral.h" |
#include "ir/SkSLConstructor.h" |
@@ -63,6 +64,7 @@ public: |
SPIRVCodeGenerator(const Context* context) |
: fContext(*context) |
+ , fDefaultLayout(MemoryLayout::k140_Standard) |
, fCapabilities(1 << SpvCapabilityShader) |
, fIdCount(1) |
, fBoolTrue(0) |
@@ -94,17 +96,22 @@ private: |
SpvId getType(const Type& type); |
+ SpvId getType(const Type& type, const MemoryLayout& layout); |
+ |
SpvId getFunctionType(const FunctionDeclaration& function); |
SpvId getPointerType(const Type& type, SpvStorageClass_ storageClass); |
+ SpvId getPointerType(const Type& type, const MemoryLayout& layout, |
+ SpvStorageClass_ storageClass); |
+ |
std::vector<SpvId> getAccessChain(const Expression& expr, SkWStream& out); |
void writeLayout(const Layout& layout, SpvId target); |
void writeLayout(const Layout& layout, SpvId target, int member); |
- void writeStruct(const Type& type, SpvId resultId); |
+ void writeStruct(const Type& type, const MemoryLayout& layout, SpvId resultId); |
void writeProgramElement(const ProgramElement& pe, SkWStream& out); |
@@ -230,6 +237,7 @@ private: |
SkWStream& out); |
const Context& fContext; |
+ const MemoryLayout fDefaultLayout; |
uint64_t fCapabilities; |
SpvId fIdCount; |