From 6a8ad6eb4cab72c18de48762768e04d08b60a21c Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 22 Aug 2018 11:36:02 -0400 Subject: Support for [[vk::push_constant]] (#629) * Support for attributed [[vk::push_constant]] and [[push_constant]]. Can also use layout(push_constant). * Fix test so matches the expected output. * Add expected output to binding-push-constant-gl.hlsl * Trivial change to force travis rebuild to test the gcc linux build really has a problem. --- source/slang/parameter-binding.cpp | 11 ++++++++++- 1 file changed, 10 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 ced8d7af2..40491c4df 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -977,7 +977,7 @@ getTypeLayoutForGlobalShaderParameter_GLSL( // 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() ) + if( varDecl->HasModifier() && type->As() ) { return CreateTypeLayout( layoutContext.with(rules->getPushConstantBufferRules()), @@ -1043,6 +1043,15 @@ getTypeLayoutForGlobalShaderParameter_HLSL( auto rules = layoutContext.getRulesFamily(); auto type = varDecl->getType(); + // 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( + layoutContext.with(rules->getPushConstantBufferRules()), + type); + } + // HLSL `static` modifier indicates "thread local" if(varDecl->HasModifier()) return nullptr; -- cgit v1.2.3