summaryrefslogtreecommitdiffstats
path: root/source/slang/parameter-binding.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-08-22 11:36:02 -0400
committerTim Foley <tfoleyNV@users.noreply.github.com>2018-08-22 08:36:02 -0700
commit6a8ad6eb4cab72c18de48762768e04d08b60a21c (patch)
tree903863bf0154cb73e87c7a70a65c022649c096d3 /source/slang/parameter-binding.cpp
parent0ce1131ba12f777fbaa40004e0e3e7af89ccf4f0 (diff)
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.
Diffstat (limited to 'source/slang/parameter-binding.cpp')
-rw-r--r--source/slang/parameter-binding.cpp11
1 files changed, 10 insertions, 1 deletions
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<GLSLPushConstantLayoutModifier>() && type->As<ConstantBufferType>() )
+ if( varDecl->HasModifier<PushConstantAttribute>() && type->As<ConstantBufferType>() )
{
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<PushConstantAttribute>() && type->As<ConstantBufferType>())
+ {
+ return CreateTypeLayout(
+ layoutContext.with(rules->getPushConstantBufferRules()),
+ type);
+ }
+
// HLSL `static` modifier indicates "thread local"
if(varDecl->HasModifier<HLSLStaticModifier>())
return nullptr;