From 9914ca800c92e9b3fe768dec4e913a302f3d678d Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 31 Jul 2018 11:03:53 -0400 Subject: Feature/attributed binding (#621) * Typo fix, and added dxc to command line documentation. * Fix small typos. Added support for Scope to lexer. Fix bug in Token ctor. * Add support for attribute names that are scoped. * Added GLSLBindingAttribute. Make binding work through core.met.slang. * Allow [[gl::binding(binding, set)]] [[vk::binding(binding,set)]] --- source/slang/parameter-binding.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/slang/parameter-binding.cpp') diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index e5fddac02..ced8d7af2 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -1413,10 +1413,13 @@ static void addExplicitParameterBindings_GLSL( if( (resInfo = typeLayout->FindResourceInfo(LayoutResourceKind::DescriptorTableSlot)) != nullptr ) { // Try to find `binding` and `set` - if(!findLayoutArg(varDecl, &semanticInfo.index)) + auto attr = varDecl.getDecl()->FindModifier(); + if (!attr) + { return; - - findLayoutArg(varDecl, &semanticInfo.space); + } + semanticInfo.index = attr->binding; + semanticInfo.space = attr->set; } else if( (resInfo = typeLayout->FindResourceInfo(LayoutResourceKind::VertexInput)) != nullptr ) { -- cgit v1.2.3