From 4137f9d4a58462ed94ed658ac0d722c830c3eb89 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 14 Dec 2017 11:51:29 -0800 Subject: 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. --- source/slang/reflection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/slang/reflection.cpp') 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(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(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(typeLayout)) { - typeLayout = parameterGroupTypeLayout->containerTypeLayout; + typeLayout = parameterGroupTypeLayout->containerVarLayout->typeLayout; } return typeLayout->resourceInfos[index].kind; -- cgit v1.2.3