From 2bf87743ffe73f041036ae62c8bf53f09215ca53 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 14 Jul 2017 10:44:42 -0700 Subject: Don't assign a `binding` to a `push_constant` buffer Fixes #12 - This was a latent issue, but the previous commit brought it to the front. - As indicated in #12, I don't allocate a descriptor-table slot to the block - Instead I allocate a `PushConstantBuffer` - Unlike what #12 asks for, I don't use a different resource type for the contents of the block - Pretty much all the logic is easiest if these continue to be just plain `Uniform` data --- source/slang/parameter-binding.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/slang/parameter-binding.cpp') diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index 0683c7f8c..01727fb36 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -101,7 +101,7 @@ struct ParameterBindingInfo enum { - kLayoutResourceKindCount = SLANG_PARAMETER_CATEGORY_MIXED, + kLayoutResourceKindCount = SLANG_PARAMETER_CATEGORY_COUNT, }; // Information on a single parameter @@ -290,6 +290,11 @@ getTypeLayoutForGlobalShaderParameter_GLSL( // any more. As such we also inspect the type // of the variable. + // We want to check for a constant-buffer type with a `push_constant` layout + // qualifier before we move on to anything else. + if (varDecl->HasModifier() && type->As()) + return CreateTypeLayout(type, rules->getPushConstantBufferRules()); + // TODO(tfoley): We have multiple variations of // the `uniform` modifier right now, and that // needs to get fixed... -- cgit v1.2.3