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
18adbdbb
Commit
18adbdbb
authored
Feb 02, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve issue #700: allow initializers on struct members.
parent
32fd5d26
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
2 deletions
+35
-2
hlsl.init.frag.out
Test/baseResults/hlsl.init.frag.out
+19
-1
hlsl.init.frag
Test/hlsl.init.frag
+5
-0
revision.h
glslang/Include/revision.h
+1
-1
hlslGrammar.cpp
hlsl/hlslGrammar.cpp
+10
-0
No files found.
Test/baseResults/hlsl.init.frag.out
View file @
18adbdbb
hlsl.init.frag
hlsl.init.frag
WARNING: 0:40: 'typedef' : struct-member initializers ignored
WARNING: 0:40: 'typedef' : struct-member initializers ignored
Shader version: 450
Shader version: 450
gl_FragCoord origin is upper left
gl_FragCoord origin is upper left
0:? Sequence
0:? Sequence
...
@@ -152,6 +155,7 @@ gl_FragCoord origin is upper left
...
@@ -152,6 +155,7 @@ gl_FragCoord origin is upper left
0:? 'single2' (global structure{temp 2-component vector of uint v})
0:? 'single2' (global structure{temp 2-component vector of uint v})
0:? 'single3' (global structure{temp structure{temp int f} s1})
0:? 'single3' (global structure{temp structure{temp int f} s1})
0:? 'single4' (global structure{temp structure{temp 2-component vector of uint v} s1})
0:? 'single4' (global structure{temp structure{temp 2-component vector of uint v} s1})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(row_major std140 ) uniform float a, layout(row_major std140 ) uniform float b, layout(row_major std140 ) uniform float c})
Linked fragment stage:
Linked fragment stage:
...
@@ -310,10 +314,11 @@ gl_FragCoord origin is upper left
...
@@ -310,10 +314,11 @@ gl_FragCoord origin is upper left
0:? 'single2' (global structure{temp 2-component vector of uint v})
0:? 'single2' (global structure{temp 2-component vector of uint v})
0:? 'single3' (global structure{temp structure{temp int f} s1})
0:? 'single3' (global structure{temp structure{temp int f} s1})
0:? 'single4' (global structure{temp structure{temp 2-component vector of uint v} s1})
0:? 'single4' (global structure{temp structure{temp 2-component vector of uint v} s1})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(row_major std140 ) uniform float a, layout(row_major std140 ) uniform float b, layout(row_major std140 ) uniform float c})
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80001
// Generated by (magic number): 80001
// Id's are bound by
97
// Id's are bound by
100
Capability Shader
Capability Shader
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
...
@@ -361,8 +366,18 @@ gl_FragCoord origin is upper left
...
@@ -361,8 +366,18 @@ gl_FragCoord origin is upper left
Name 90 "input"
Name 90 "input"
Name 95 "c4"
Name 95 "c4"
Name 96 "b5"
Name 96 "b5"
Name 97 "Constants"
MemberName 97(Constants) 0 "a"
MemberName 97(Constants) 1 "b"
MemberName 97(Constants) 2 "c"
Name 99 ""
Decorate 88(@entryPointOutput) Location 0
Decorate 88(@entryPointOutput) Location 0
Decorate 90(input) Location 0
Decorate 90(input) Location 0
MemberDecorate 97(Constants) 0 Offset 0
MemberDecorate 97(Constants) 1 Offset 4
MemberDecorate 97(Constants) 2 Offset 8
Decorate 97(Constants) Block
Decorate 99 DescriptorSet 0
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeFloat 32
6: TypeFloat 32
...
@@ -437,6 +452,9 @@ gl_FragCoord origin is upper left
...
@@ -437,6 +452,9 @@ gl_FragCoord origin is upper left
90(input): 89(ptr) Variable Input
90(input): 89(ptr) Variable Input
95(c4): 22(ptr) Variable Private
95(c4): 22(ptr) Variable Private
96(b5): 22(ptr) Variable Private
96(b5): 22(ptr) Variable Private
97(Constants): TypeStruct 6(float) 6(float) 6(float)
98: TypePointer Uniform 97(Constants)
99: 98(ptr) Variable Uniform
4(ShaderFunction): 2 Function None 3
4(ShaderFunction): 2 Function None 3
5: Label
5: Label
62(a2): 61(ptr) Variable Function
62(a2): 61(ptr) Variable Function
...
...
Test/hlsl.init.frag
View file @
18adbdbb
...
@@ -34,3 +34,8 @@ float4 ShaderFunction(float4 input) : COLOR0
...
@@ -34,3 +34,8 @@ float4 ShaderFunction(float4 input) : COLOR0
return
input
*
a1
;
return
input
*
a1
;
}
}
cbuffer
Constants
{
float
a
=
1
.
0
f
,
b
,
c
=
2
.
0
f
;
};
glslang/Include/revision.h
View file @
18adbdbb
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// 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).
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.180
4
"
#define GLSLANG_REVISION "Overload400-PrecQual.180
5
"
#define GLSLANG_DATE "02-Feb-2017"
#define GLSLANG_DATE "02-Feb-2017"
hlsl/hlslGrammar.cpp
View file @
18adbdbb
...
@@ -1758,6 +1758,16 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList)
...
@@ -1758,6 +1758,16 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList)
acceptPostDecls
(
member
.
type
->
getQualifier
());
acceptPostDecls
(
member
.
type
->
getQualifier
());
// EQUAL assignment_expression
if
(
acceptTokenClass
(
EHTokAssign
))
{
parseContext
.
warn
(
idToken
.
loc
,
"struct-member initializers ignored"
,
"typedef"
,
""
);
TIntermTyped
*
expressionNode
=
nullptr
;
if
(
!
acceptAssignmentExpression
(
expressionNode
))
{
expected
(
"initializer"
);
return
false
;
}
}
// success on seeing the SEMICOLON coming up
// success on seeing the SEMICOLON coming up
if
(
peekTokenClass
(
EHTokSemicolon
))
if
(
peekTokenClass
(
EHTokSemicolon
))
break
;
break
;
...
...
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