8. io mapping refine & qualifier member check & resolver expand (#2396)

* Code refine and adding missing features

1. Add new level for built in symbols.
2. Fix issues for structure members' qualifiers.
3. Global qualifier fix.
4. IO Mapper refine. Add support for checking with mangle names.

* Additional missing features

* Invariant member. (Only check non-interface).

* Split block nesting level and struct nesting level. To fix issues of checking 'invariant' qualifier.

Current grammar would check block/struct member without its parent class's information.
So we split nesting level, and 'invariant' would only be checked within a struct.

* Format anonymous block names. Refine codes for symbols from all kinds of resouces.

* Fix writeonly check.

* Use LValueBase to find operator.

* Fix random null ptr issue.

* invariant check, stage in io mapping, reference parameter should be used and remove wrong codes introduced with ordering vector.

* Remained: to be fixed with double check link.vk.multiblocksValid

* Fix version error.

invariant

* Revert loc modification.
This commit is contained in:
Chow
2020-11-04 04:34:19 +08:00
committed by GitHub
parent d550bebee9
commit 478b232952
25 changed files with 565 additions and 149 deletions

View File

@@ -1,6 +1,7 @@
300layout.vert
ERROR: 0:7: 'vertex input arrays' : not supported with this profile: es
ERROR: 0:8: 'in' : cannot be a structure or array
ERROR: 0:8: 's' : A structure containing an array is not allowed as input in ES
ERROR: 0:8: 'vertex input arrays' : not supported with this profile: es
ERROR: 0:8: 'location' : overlapping use of location 10
ERROR: 0:12: 'layout' : cannot specify matrix layout on a variable declaration
@@ -18,7 +19,7 @@ ERROR: 0:50: 'shared' : not supported for this version or the enabled extensions
ERROR: 0:50: 'shared' : not supported in this stage: vertex
ERROR: 0:54: 'layout' : cannot specify packing on a variable declaration
ERROR: 0:57: 'location' : overlapping use of location 40
ERROR: 19 compilation errors. No code generated.
ERROR: 20 compilation errors. No code generated.
Shader version: 300

View File

@@ -40,10 +40,14 @@ ERROR: 0:112: 'out' : cannot be a matrix
ERROR: 0:114: 'in' : cannot be bool
ERROR: 0:115: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: ino
ERROR: 0:117: 'fragment-shader array-of-array input' : not supported with this profile: es
ERROR: 0:120: 'S' : A structure containing an array is not allowed as input in ES
ERROR: 0:120: 'fragment-shader array-of-struct input' : not supported with this profile: es
ERROR: 0:121: 'S' : A structure containing an array is not allowed as input in ES
ERROR: 0:121: 'fragment-shader array-of-struct input' : not supported with this profile: es
ERROR: 0:123: 'fragment-shader struct input containing an array' : not supported with this profile: es
ERROR: 0:123: 'SA' : A structure containing an array is not allowed as input in ES
ERROR: 0:125: 'fragment-shader struct input containing structure' : not supported with this profile: es
ERROR: 0:125: 'SS' : A structure containing an struct is not allowed as input in ES
ERROR: 0:133: 'output block' : not supported in this stage: fragment
ERROR: 0:138: '' : cannot nest a structure definition inside a structure or block
ERROR: 0:146: 'location' : overlapping use of location 13
@@ -139,7 +143,7 @@ ERROR: 0:461: 'func' : function already has a body
ERROR: 0:463: 'return' : void function cannot return a value
ERROR: 0:472: '=' : cannot convert from ' temp mediump uint' to ' temp mediump int'
ERROR: 0:485: '=' : cannot convert from ' global mediump int' to ' temp mediump uint'
ERROR: 132 compilation errors. No code generated.
ERROR: 136 compilation errors. No code generated.
Shader version: 310

View File

@@ -21,6 +21,7 @@ ERROR: 0:105: 'location' : overlapping use of location 12
ERROR: 0:107: 'input block' : not supported in this stage: vertex
ERROR: 0:109: 'gl_PerVertex' : block redeclaration has extra members
ERROR: 0:119: 'gl_PointSize' : member of nameless block was not redeclared
ERROR: 0:119: 'assign' : l-value required "gl_PerVertex" (can't modify void)
ERROR: 0:119: 'assign' : cannot convert from ' const float' to ' gl_PointSize highp void PointSize'
ERROR: 0:122: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use
ERROR: 0:127: 'flat/smooth/noperspective' : cannot use interpolation qualifiers on an interface block
@@ -96,7 +97,7 @@ ERROR: 0:389: 'sample' : Reserved word.
ERROR: 0:400: 'interpolateAtCentroid' : no matching overloaded function found
ERROR: 0:401: 'interpolateAtSample' : no matching overloaded function found
ERROR: 0:402: 'interpolateAtOffset' : no matching overloaded function found
ERROR: 93 compilation errors. No code generated.
ERROR: 94 compilation errors. No code generated.
Shader version: 310

View File

@@ -4,6 +4,7 @@ ERROR: 0:14: 'location' : overlapping use of location 12
ERROR: 0:16: 'input block' : not supported in this stage: vertex
ERROR: 0:18: 'gl_PerVertex' : block redeclaration has extra members
ERROR: 0:28: 'gl_PointSize' : member of nameless block was not redeclared
ERROR: 0:28: 'assign' : l-value required "gl_PerVertex" (can't modify void)
ERROR: 0:28: 'assign' : cannot convert from ' const float' to ' gl_PointSize highp void PointSize'
ERROR: 0:31: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use
ERROR: 0:36: 'flat/smooth/noperspective' : cannot use interpolation qualifiers on an interface block
@@ -33,7 +34,7 @@ ERROR: 0:211: '=' : cannot convert from ' const float' to ' temp highp 3-compon
ERROR: 0:252: 'interpolateAtCentroid' : no matching overloaded function found
ERROR: 0:253: 'interpolateAtSample' : no matching overloaded function found
ERROR: 0:254: 'interpolateAtOffset' : no matching overloaded function found
ERROR: 34 compilation errors. No code generated.
ERROR: 35 compilation errors. No code generated.
Shader version: 320

View File

@@ -5,9 +5,10 @@ ERROR: 0:20: 'gl_PerVertex' : can only redeclare a built-in block once, and befo
ERROR: 0:32: 'gl_Position' : no such field in structure
ERROR: 0:32: '=' : cannot convert from ' temp block{ in float PointSize gl_PointSize}' to ' temp 4-component vector of float'
ERROR: 0:33: 'gl_Position' : member of nameless block was not redeclared
ERROR: 0:33: 'assign' : l-value required "gl_PerVertex" (can't modify void)
ERROR: 0:33: 'assign' : cannot convert from ' const 4-component vector of float' to 'layout( stream=0) gl_Position void Position'
WARNING: 0:38: 'return' : type conversion on return values was not explicitly allowed until version 420
ERROR: 7 compilation errors. No code generated.
ERROR: 8 compilation errors. No code generated.
Shader version: 410

View File

@@ -190,13 +190,13 @@ Validation failed
Decorate 9 BufferBlock
Decorate 12 BufferBlock
Decorate 49(sbuf_a) DescriptorSet 0
Decorate 49(sbuf_a) Binding 4
Decorate 49(sbuf_a) Binding 0
Decorate 50(sbuf_a@count) DescriptorSet 0
Decorate 50(sbuf_a@count) Binding 6
Decorate 50(sbuf_a@count) Binding 0
Decorate 51(sbuf_c) DescriptorSet 0
Decorate 51(sbuf_c) Binding 5
Decorate 51(sbuf_c) Binding 1
Decorate 52(sbuf_c@count) DescriptorSet 0
Decorate 52(sbuf_c@count) Binding 7
Decorate 52(sbuf_c@count) Binding 0
Decorate 58(pos) Flat
Decorate 58(pos) Location 0
Decorate 61(@entryPointOutput) Location 0

View File

@@ -191,9 +191,9 @@ Validation failed
Decorate 18 BufferBlock
Decorate 20 BufferBlock
Decorate 47(sbuf2) DescriptorSet 0
Decorate 47(sbuf2) Binding 2
Decorate 47(sbuf2) Binding 0
Decorate 48(sbuf2@count) DescriptorSet 0
Decorate 48(sbuf2@count) Binding 3
Decorate 48(sbuf2@count) Binding 0
Decorate 50(sbuf) DescriptorSet 0
Decorate 50(sbuf) Binding 10
Decorate 63(pos) Flat

View File

@@ -211,7 +211,7 @@ Shader version: 430
Name 70 "BufferBlock"
MemberName 70(BufferBlock) 0 "p"
Name 72 "uBuf"
Decorate 14(oColor) Location 4
Decorate 14(oColor) Location 2
MemberDecorate 16(ColorBlock) 0 Offset 0
MemberDecorate 16(ColorBlock) 1 Offset 16
MemberDecorate 16(ColorBlock) 2 Offset 32
@@ -224,7 +224,7 @@ Shader version: 430
Decorate 28(uColorBuf) DescriptorSet 0
Decorate 28(uColorBuf) Binding 0
Decorate 32(Vertex) Block
Decorate 34(oV) Location 2
Decorate 34(oV) Location 0
MemberDecorate 40(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 40(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 40(gl_PerVertex) 2 BuiltIn ClipDistance

View File

@@ -304,7 +304,7 @@ output primitive = triangle_strip
MemberName 95(BufferBlock) 0 "p"
Name 97 "uBuf"
Name 100 "P"
Decorate 18(oColor) Location 2
Decorate 18(oColor) Location 1
MemberDecorate 20(ColorBlock) 0 Offset 0
MemberDecorate 20(ColorBlock) 1 Offset 16
MemberDecorate 20(ColorBlock) 2 Offset 32
@@ -326,16 +326,16 @@ output primitive = triangle_strip
Decorate 50(uM) DescriptorSet 0
Decorate 50(uM) Binding 0
Decorate 59(Vertex) Block
Decorate 61(oV) Location 1
Decorate 61(oV) Location 0
Decorate 64(Vertex) Block
Decorate 68(iV) Location 0
Decorate 68(iV) Location 1
MemberDecorate 95(BufferBlock) 0 ColMajor
MemberDecorate 95(BufferBlock) 0 Offset 0
MemberDecorate 95(BufferBlock) 0 MatrixStride 16
Decorate 95(BufferBlock) BufferBlock
Decorate 97(uBuf) DescriptorSet 0
Decorate 97(uBuf) Binding 1
Decorate 100(P) Location 4
Decorate 100(P) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32

View File

@@ -11,7 +11,7 @@ spv.specConstant.vert
Source GLSL 400
Name 4 "main"
Name 9 "arraySize"
Name 14 "foo(vf4[s4546];"
Name 14 "foo(vf4[s805310914];"
Name 13 "p"
Name 17 "builtin_spec_constant("
Name 20 "color"
@@ -106,10 +106,10 @@ spv.specConstant.vert
Store 20(color) 46
48: 10 Load 22(ucol)
Store 47(param) 48
49: 2 FunctionCall 14(foo(vf4[s4546];) 47(param)
49: 2 FunctionCall 14(foo(vf4[s805310914];) 47(param)
Return
FunctionEnd
14(foo(vf4[s4546];): 2 Function None 12
14(foo(vf4[s805310914];): 2 Function None 12
13(p): 11(ptr) FunctionParameter
15: Label
54: 24(ptr) AccessChain 53(dupUcol) 23