From 478be540a6f93ffcb552e496c41fe1c278ae054e Mon Sep 17 00:00:00 2001 From: Julius Ikkala Date: Fri, 27 Dec 2024 20:24:19 +0200 Subject: Fix parsing GLSL SSBO arrays / bindless descriptors (#5932) * Fix parsing GLSL SSBO arrays / bindless descriptors * Clean up SSBO array parsing * Fix mutable SSBO arrays not being detected as such * Allow sized SSBO arrays * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He --- source/slang/slang-parser.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/slang/slang-parser.cpp') diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index 8a4ba55eb..1aa313fa8 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -3360,6 +3360,16 @@ static Decl* ParseBufferBlockDecl( reflectionNameModifier->nameAndLoc = bufferVarDecl->nameAndLoc; parser->ReadToken(TokenType::Semicolon); } + else if ( + parser->options.allowGLSLInput && parser->LookAheadToken(TokenType::Identifier) && + parser->LookAheadToken(TokenType::LBracket, 1)) + { + // GLSL bindless buffers are denoted with [] after the name. + bufferVarDecl->nameAndLoc = ParseDeclName(parser); + bufferVarDecl->type.exp = parseBracketTypeSuffix(parser, bufferVarDecl->type.exp); + reflectionNameModifier->nameAndLoc = bufferVarDecl->nameAndLoc; + parser->ReadToken(TokenType::Semicolon); + } else { // Otherwise, we need to generate a name for the buffer variable. -- cgit v1.2.3