diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-12-14 11:51:29 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-14 11:51:29 -0800 |
| commit | 4137f9d4a58462ed94ed658ac0d722c830c3eb89 (patch) | |
| tree | 74e89ad6deb13e23a4a2a72020e87219c9a1879e /source/slang/reflection.cpp | |
| parent | 6d6142122b15461d6c8cabdb31292b0de688ba35 (diff) | |
More fixups for Vulkan parameter block bindings (#309)
I'm adding a small cross-compilation test to try to make sure that we are testing the binding generation for GLSL output. We probably still need a more complex test that uses multiple blocks, plus variables not in a block.
The big changes here are:
- Change the `containerTypeLayout` field to a `containerVarLayout` in the `ParameterGroupTypeLayout`, so that we can store the base offsets for the fields in a uniform fashion (even though these will all be zero).
- Switch the emit logic to carefully use either the container or element var layout depending on what they are emitting bindings for. This involved adding something akin to the "reflection path" notion that Falcor has to use, but only for the emit step.
Diffstat (limited to 'source/slang/reflection.cpp')
| -rw-r--r-- | source/slang/reflection.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/reflection.cpp b/source/slang/reflection.cpp index 7068ecea4..cc2c6b289 100644 --- a/source/slang/reflection.cpp +++ b/source/slang/reflection.cpp @@ -581,7 +581,7 @@ SLANG_API SlangParameterCategory spReflectionTypeLayout_GetParameterCategory(Sla if (auto parameterGroupTypeLayout = dynamic_cast<ParameterGroupTypeLayout*>(typeLayout)) { - typeLayout = parameterGroupTypeLayout->containerTypeLayout; + typeLayout = parameterGroupTypeLayout->containerVarLayout->typeLayout; } return getParameterCategory(typeLayout); @@ -594,7 +594,7 @@ SLANG_API unsigned spReflectionTypeLayout_GetCategoryCount(SlangReflectionTypeLa if (auto parameterGroupTypeLayout = dynamic_cast<ParameterGroupTypeLayout*>(typeLayout)) { - typeLayout = parameterGroupTypeLayout->containerTypeLayout; + typeLayout = parameterGroupTypeLayout->containerVarLayout->typeLayout; } return (unsigned) typeLayout->resourceInfos.Count(); @@ -607,7 +607,7 @@ SLANG_API SlangParameterCategory spReflectionTypeLayout_GetCategoryByIndex(Slang if (auto parameterGroupTypeLayout = dynamic_cast<ParameterGroupTypeLayout*>(typeLayout)) { - typeLayout = parameterGroupTypeLayout->containerTypeLayout; + typeLayout = parameterGroupTypeLayout->containerVarLayout->typeLayout; } return typeLayout->resourceInfos[index].kind; |
