diff options
author | ethannicholas <ethannicholas@google.com> | 2016-11-15 12:53:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-15 12:53:06 -0800 |
commit | fa5f65ac61fd525029aa9dab161ffe4896c10f6d (patch) | |
tree | 759d6a3b9602b86deec1028e081c0ceaf1004751 /src/sksl/SkSLSPIRVCodeGenerator.h | |
parent | 3667b4970d6972675be58a331be7c5ba02f3d39e (diff) |
added support for push_constant layout
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2187433003
Review-Url: https://codereview.chromium.org/2187433003
Diffstat (limited to 'src/sksl/SkSLSPIRVCodeGenerator.h')
-rw-r--r-- | src/sksl/SkSLSPIRVCodeGenerator.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.h b/src/sksl/SkSLSPIRVCodeGenerator.h index e6fc28ee0c..6459e5bcf5 100644 --- a/src/sksl/SkSLSPIRVCodeGenerator.h +++ b/src/sksl/SkSLSPIRVCodeGenerator.h @@ -14,6 +14,7 @@ #include <unordered_map> #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) @@ -93,17 +95,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, std::ostream& 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, std::ostream& out); @@ -229,6 +236,7 @@ private: std::ostream& out); const Context& fContext; + const MemoryLayout fDefaultLayout; uint64_t fCapabilities; SpvId fIdCount; |