diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-07-31 11:03:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-31 11:03:53 -0400 |
| commit | 9914ca800c92e9b3fe768dec4e913a302f3d678d (patch) | |
| tree | 49544fb2c0387f39876fd99e112cfc32ed05302d /source/slang/parameter-binding.cpp | |
| parent | 171f524d7ca2922084a33f50c77a1e8797e80949 (diff) | |
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)]]
Diffstat (limited to 'source/slang/parameter-binding.cpp')
| -rw-r--r-- | source/slang/parameter-binding.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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<GLSLBindingLayoutModifier>(varDecl, &semanticInfo.index)) + auto attr = varDecl.getDecl()->FindModifier<GLSLBindingAttribute>(); + if (!attr) + { return; - - findLayoutArg<GLSLSetLayoutModifier>(varDecl, &semanticInfo.space); + } + semanticInfo.index = attr->binding; + semanticInfo.space = attr->set; } else if( (resInfo = typeLayout->FindResourceInfo(LayoutResourceKind::VertexInput)) != nullptr ) { |
