summaryrefslogtreecommitdiff
path: root/source/slang/type-layout.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2019-01-31 13:35:03 -0800
committerGitHub <noreply@github.com>2019-01-31 13:35:03 -0800
commitbcb361db7c5a6f8baa9b2012b9ee9778421f1386 (patch)
tree9e5e1703e3b06e109bae6db136bbc2e816f96a2f /source/slang/type-layout.h
parentc1fe5f295e843d10e24ae0d053fc3813a29aec89 (diff)
parentf20c64c348393602ed2a9c873386345cc4b493e8 (diff)
Merge branch 'master' into crashfix
Diffstat (limited to 'source/slang/type-layout.h')
-rw-r--r--source/slang/type-layout.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/source/slang/type-layout.h b/source/slang/type-layout.h
index da2f0e4f7..418f4684d 100644
--- a/source/slang/type-layout.h
+++ b/source/slang/type-layout.h
@@ -575,6 +575,18 @@ public:
LayoutSize tagOffset;
};
+ /// Layout for a scoped entity like a program, module, or entry point
+class ScopeLayout : public Layout
+{
+public:
+ // The layout for the parameters of this entity.
+ //
+ RefPtr<VarLayout> parametersLayout;
+};
+
+StructTypeLayout* getScopeStructLayout(
+ ScopeLayout* programLayout);
+
// Layout information for a single shader entry point
// within a program
//
@@ -584,7 +596,7 @@ public:
//
// TODO: where to store layout info for the return
// type of the function?
-class EntryPointLayout : public StructTypeLayout
+class EntryPointLayout : public ScopeLayout
{
public:
// The corresponding function declaration
@@ -617,9 +629,10 @@ public:
};
// Layout information for the global scope of a program
-class ProgramLayout : public Layout
+class ProgramLayout : public ScopeLayout
{
public:
+ /*
// We store a layout for the declarations at the global
// scope. Note that this will *either* be a single
// `StructTypeLayout` with the fields stored directly,
@@ -634,6 +647,7 @@ public:
// to store them).
//
RefPtr<VarLayout> globalScopeLayout;
+ */
// We catalog the requested entry points here,
// and any entry-point-specific parameter data
@@ -646,6 +660,9 @@ public:
TargetRequest* targetRequest = nullptr;
};
+StructTypeLayout* getGlobalStructLayout(
+ ProgramLayout* programLayout);
+
struct LayoutRulesFamilyImpl;
// A delineation of shader parameter types into fine-grained