diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-17 13:32:20 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-17 13:35:22 -0700 |
| commit | 453a9ca07417bbc17294267c5e44843d16e93c50 (patch) | |
| tree | 3c07ad5576737423cd407772a7d23748eb67f090 /source/slang/syntax.h | |
| parent | 77e3c3bfb1f77ec04cd8e63a676bfa3e2ae2f998 (diff) | |
Handle arrays when scalarizing "resources in structs"
The basic idea is that an array of `struct`s will get scalarized into per-field arrays (for any fields that need to be scalarized). So given:
struct Foo { float x; Texture2D t; };
cbuffer C { Foo foo[4]; }
We'll get output like:
struct Foo { float x; };
cbuffer C { Foo foo[4]; }
Texture2D C_foo_t[4];
(Of course the output would also be translated over to GLSL, but I'm only concerned about this one transformation here).
Diffstat (limited to 'source/slang/syntax.h')
| -rw-r--r-- | source/slang/syntax.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/syntax.h b/source/slang/syntax.h index 83b2f5801..3f1c47fb9 100644 --- a/source/slang/syntax.h +++ b/source/slang/syntax.h @@ -244,7 +244,7 @@ namespace Slang : createFunc(createFunc) {} - void* createInstanceImpl() + void* createInstanceImpl() const { return createFunc ? createFunc() : nullptr; } @@ -271,7 +271,7 @@ namespace Slang { } - T* createInstance() + T* createInstance() const { return (T*)createInstanceImpl(); } |
