Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
13075c61
Commit
13075c61
authored
Apr 11, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Fix #832: don't require terminating semicolon for cbuffer/tbuffer.
parent
e9f18fd9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
15 deletions
+19
-15
hlsl.buffer.frag
Test/hlsl.buffer.frag
+2
-2
revision.h
glslang/Include/revision.h
+2
-2
hlslGrammar.cpp
hlsl/hlslGrammar.cpp
+15
-11
No files found.
Test/hlsl.buffer.frag
View file @
13075c61
...
...
@@ -9,7 +9,7 @@ tbuffer {
cbuffer
cbufName
:
register
(
b2
,
space10
)
{
float4
v3
;
int
i3
:
packoffset
(
c1
.
y
);
}
;
}
// no semicolon is okay
tbuffer
tbufName
:
register
(
b8
)
{
float4
v4
:
packoffset
(
c1
);
...
...
@@ -24,7 +24,7 @@ tbuffer tbufName : register(b8) {
row_major
float3x4
m2
;
column_major
float3x4
m3
;
float3x4
m4
;
}
;
}
// no semicolon is okay
float4
PixelShaderFunction
(
float4
input
)
:
COLOR0
{
...
...
glslang/Include/revision.h
View file @
13075c61
...
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.19
85
"
#define GLSLANG_DATE "
07
-Apr-2017"
#define GLSLANG_REVISION "Overload400-PrecQual.19
90
"
#define GLSLANG_DATE "
11
-Apr-2017"
hlsl/hlslGrammar.cpp
View file @
13075c61
...
...
@@ -308,7 +308,7 @@ bool HlslGrammar::acceptSamplerDeclarationDX9(TType& /*type*/)
// declaration
// : sampler_declaration_dx9 post_decls SEMICOLON
// | fully_specified_type declarator_list SEMICOLON
// | fully_specified_type declarator_list SEMICOLON
(optional for cbuffer/tbuffer)
// | fully_specified_type identifier function_parameters post_decls compound_statement // function definition
// | fully_specified_type identifier sampler_state post_decls compound_statement // sampler definition
// | typedef declaration
...
...
@@ -509,18 +509,22 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
else
nodeList
=
initializers
;
// SEMICOLON
// SEMICOLON
(optional for cbuffer/tbuffer)
if
(
!
acceptTokenClass
(
EHTokSemicolon
))
{
// This may have been a false detection of what appeared to be a declaration, but
// was actually an assignment such as "float = 4", where "float" is an identifier.
// We put the token back to let further parsing happen for cases where that may
// happen. This errors on the side of caution, and mostly triggers the error.
if
(
peek
()
==
EHTokAssign
||
peek
()
==
EHTokLeftBracket
||
peek
()
==
EHTokDot
||
peek
()
==
EHTokComma
)
if
(
peek
()
==
EHTokAssign
||
peek
()
==
EHTokLeftBracket
||
peek
()
==
EHTokDot
||
peek
()
==
EHTokComma
)
{
// This may have been a false detection of what appeared to be a declaration, but
// was actually an assignment such as "float = 4", where "float" is an identifier.
// We put the token back to let further parsing happen for cases where that may
// happen. This errors on the side of caution, and mostly triggers the error.
recedeToken
();
else
return
false
;
}
else
if
(
declaredType
.
getBasicType
()
==
EbtBlock
)
{
// cbuffer, et. al. (but not struct) don't have an ending semicolon
return
true
;
}
else
{
expected
(
";"
);
return
false
;
return
false
;
}
}
return
true
;
...
...
@@ -601,7 +605,7 @@ bool HlslGrammar::acceptFullySpecifiedType(TType& type, TIntermNode*& nodeList)
// the type was a block, which set some parts of the qualifier
parseContext
.
mergeQualifiers
(
type
.
getQualifier
(),
qualifier
);
// further, it can create an anonymous instance of the block
if
(
peek
TokenClass
(
EHTokSemicolon
)
)
if
(
peek
()
!=
EHTokIdentifier
)
parseContext
.
declareBlock
(
loc
,
type
);
}
else
{
// Some qualifiers are set when parsing the type. Merge those with
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment