diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-11-16 16:04:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-16 16:04:56 -0500 |
| commit | 0f67d92df9ca1f528b7a7fc8a8712aaea56f7115 (patch) | |
| tree | e254a484500bd95549689eecff7ed62463aa6e71 /source | |
| parent | cfb1f61d478c92026718cedca4bfec8c2afc1b00 (diff) | |
Bug fix - vk::binding on structured buffers (#720)
* Fix output of binding of structured buffer on GLSL.
* Added test to check vk binding is coming thru.
* Fix closethit binding inconsistency.
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/emit.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index 644725fa8..8038561d0 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -5951,8 +5951,28 @@ struct EmitVisitor // TODO: we should require either the extension or the version... requireGLSLVersion(430); - emit("layout(std430) buffer "); + Emit("layout(std430"); + auto layout = getVarLayout(ctx, varDecl); + if (layout) + { + LayoutResourceKind kind = LayoutResourceKind::DescriptorTableSlot; + EmitVarChain chain(layout); + + const UInt index = getBindingOffset(&chain, kind); + const UInt space = getBindingSpace(&chain, kind); + + Emit(", binding = "); + Emit(index); + if (space) + { + Emit(", set = "); + Emit(space); + } + } + + emit(") buffer "); + // Generate a dummy name for the block emit("_S"); Emit(ctx->shared->uniqueIDCounter++); |
