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
9e41f362
Commit
9e41f362
authored
Jun 15, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
glslang AEP: Full semantics for *_shader_io_blocks.
git-svn-id:
https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31490
e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent
f6deb620
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
323 additions
and
24 deletions
+323
-24
310.frag
Test/310.frag
+59
-0
310.vert
Test/310.vert
+39
-0
310.frag.out
Test/baseResults/310.frag.out
+114
-1
310.geom.out
Test/baseResults/310.geom.out
+0
-1
310.vert.out
Test/baseResults/310.vert.out
+66
-1
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+12
-3
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+28
-15
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+2
-2
linkValidate.cpp
glslang/MachineIndependent/linkValidate.cpp
+3
-1
No files found.
Test/310.frag
View file @
9e41f362
...
@@ -123,3 +123,62 @@ struct SA { float f[4]; };
...
@@ -123,3 +123,62 @@ struct SA { float f[4]; };
in
SA
inSA
;
// ERROR
in
SA
inSA
;
// ERROR
struct
SS
{
float
f
;
S
s
;
};
struct
SS
{
float
f
;
S
s
;
};
in
SS
inSS
;
// ERROR
in
SS
inSS
;
// ERROR
#ifndef GL_EXT_shader_io_blocks
#error GL_EXT_shader_io_blocks not defined
#endif
#extension GL_EXT_shader_io_blocks : enable
out
outbname
{
int
a
;
}
outbinst
;
// ERROR, not out block in fragment shader
in
inbname
{
int
a
;
vec4
v
;
struct
{
int
b
;
}
s
;
// ERROR, nested struct definition
}
inbinst
;
in
inbname2
{
layout
(
location
=
12
)
int
aAnon
;
layout
(
location
=
13
)
centroid
in
vec4
vAnon
;
};
in
layout
(
location
=
13
)
vec4
aliased
;
// ERROR, aliased
in
inbname2
{
// ERROR, reuse of block name
int
aAnon
;
centroid
in
vec4
vAnon
;
};
in
badmember
{
// ERROR, aAnon already in global scope
int
aAnon
;
};
int
inbname
;
// ERROR, redefinition of block name
vec4
vAnon
;
// ERROR, anon in global scope; redefinition
in
arrayed
{
float
f
;
}
arrayedInst
[
4
];
void
fooIO
()
{
vec4
v
=
inbinst
.
v
+
vAnon
;
v
*=
arrayedInst
[
2
].
f
;
v
*=
arrayedInst
[
i
].
f
;
// ERROR, not constant
}
in
vec4
gl_FragCoord
;
layout
(
origin_upper_left
,
pixel_center_integer
)
in
vec4
gl_FragCoord
;
// ERROR, non-ES
layout
(
early_fragment_tests
)
in
;
out
float
gl_FragDepth
;
layout
(
depth_any
)
out
float
gl_FragDepth
;
// ERROR, non-ES
void
foo_IO
()
{
gl_FragDepth
=
0
.
2
;
// ERROR, early_fragment_tests declared
}
out
float
gl_FragDepth
;
Test/310.vert
View file @
9e41f362
...
@@ -84,3 +84,42 @@ out SS outSS; // ERROR
...
@@ -84,3 +84,42 @@ out SS outSS; // ERROR
layout
(
std430
)
uniform
U430
{
int
a
;
}
U430i
;
// ERROR
layout
(
std430
)
uniform
U430
{
int
a
;
}
U430i
;
// ERROR
layout
(
std430
)
buffer
B430
{
int
a
;
}
B430i
;
layout
(
std430
)
buffer
B430
{
int
a
;
}
B430i
;
#ifndef GL_OES_shader_io_blocks
#error GL_OES_shader_io_blocks not defined
#endif
#extension GL_OES_shader_io_blocks : enable
out
outbname
{
int
a
;
out
vec4
v
;
highp
sampler2D
s
;
// ERROR, opaque type
}
outbinst
;
out
outbname2
{
layout
(
location
=
12
)
int
aAnon
;
layout
(
location
=
13
)
vec4
vAnon
;
};
layout
(
location
=
12
)
out
highp
int
aliased
;
// ERROR, aliasing location
in
inbname
{
int
a
;
}
inbinst
;
// ERROR, no in block in vertex shader
out
gl_PerVertex
{
// ERROR, has extra member
highp
vec4
gl_Position
;
highp
vec4
t
;
};
void
foo_IO
()
{
int
sum
=
gl_VertexID
+
gl_InstanceID
;
gl_Position
=
vec4
(
1
.
0
);
gl_PointSize
=
2
.
0
;
// ERROR, removed by redeclaration
}
out
gl_PerVertex
{
// ERROR, already used and already redeclared
highp
vec4
gl_Position
;
highp
vec4
t
;
};
Test/baseResults/310.frag.out
View file @
9e41f362
...
@@ -41,11 +41,28 @@ ERROR: 0:120: 'fragment-shader array-of-struct input' : not supported with this
...
@@ -41,11 +41,28 @@ ERROR: 0:120: 'fragment-shader array-of-struct input' : not supported with this
ERROR: 0:121: 'fragment-shader array-of-struct input' : not supported with this profile: 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: 'fragment-shader struct input containing an array' : not supported with this profile: es
ERROR: 0:125: 'fragment-shader struct input containing structure' : not supported with this profile: es
ERROR: 0:125: 'fragment-shader struct input containing structure' : not supported with this profile: es
ERROR: 41 compilation errors. No code generated.
ERROR: 0:133: 'out' : cannot declare an output block in a fragment shader
ERROR: 0:138: '' : cannot nest a structure definition inside a structure or block
ERROR: 0:146: 'location' : overlapping use of location 13
ERROR: 0:148: 'inbname2' : Cannot reuse block name within the same interface: in
ERROR: 0:153: 'badmember' : nameless block contains a member that already has a name at global scope
ERROR: 0:157: 'inbname' : redefinition
ERROR: 0:159: 'vAnon' : redefinition
ERROR: 0:169: 'variable indexing block array' : not supported with this profile: es
ERROR: 0:173: 'origin_upper_left' : not supported with this profile: es
ERROR: 0:173: 'pixel_center_integer' : not supported with this profile: es
ERROR: 0:173: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord
ERROR: 0:177: 'depth layout qualifier' : not supported with this profile: es
ERROR: 0:181: 'assign' : l-value required "gl_FragDepth" (can't modify gl_FragDepth if using early_fragment_tests)
ERROR: 54 compilation errors. No code generated.
Shader version: 310
Shader version: 310
Requested GL_EXT_shader_io_blocks
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
using early_fragment_tests
using early_fragment_tests
using depth_any
ERROR: node is still EOpNull!
ERROR: node is still EOpNull!
0:21 Function Definition: main( (global void)
0:21 Function Definition: main( (global void)
0:21 Function Parameters:
0:21 Function Parameters:
...
@@ -259,6 +276,45 @@ ERROR: node is still EOpNull!
...
@@ -259,6 +276,45 @@ ERROR: node is still EOpNull!
0:107 'v2' (temp highp 2-component vector of int)
0:107 'v2' (temp highp 2-component vector of int)
0:107 Function Call: imageSize(I21; (global highp 2-component vector of int)
0:107 Function Call: imageSize(I21; (global highp 2-component vector of int)
0:107 'i2Dqualified' (layout(binding=6 ) coherent volatile restrict uniform highp image2D)
0:107 'i2Dqualified' (layout(binding=6 ) coherent volatile restrict uniform highp image2D)
0:165 Function Definition: fooIO( (global void)
0:165 Function Parameters:
0:167 Sequence
0:167 Sequence
0:167 move second child to first child (temp mediump 4-component vector of float)
0:167 'v' (temp mediump 4-component vector of float)
0:167 add (temp mediump 4-component vector of float)
0:167 v: direct index for structure (in mediump 4-component vector of float)
0:167 'inbinst' (in block{in mediump int a, in mediump 4-component vector of float v, in structure{global mediump int b} s})
0:167 Constant:
0:167 1 (const int)
0:167 vAnon: direct index for structure (layout(location=13 ) centroid in mediump 4-component vector of float)
0:167 'anon@0' (in block{layout(location=12 ) in mediump int aAnon, layout(location=13 ) centroid in mediump 4-component vector of float vAnon})
0:167 Constant:
0:167 1 (const uint)
0:168 vector scale second child into first child (temp mediump 4-component vector of float)
0:168 'v' (temp mediump 4-component vector of float)
0:168 f: direct index for structure (in mediump float)
0:168 direct index (temp block{in mediump float f})
0:168 'arrayedInst' (in 4-element array of block{in mediump float f})
0:168 Constant:
0:168 2 (const int)
0:168 Constant:
0:168 0 (const int)
0:169 vector scale second child into first child (temp mediump 4-component vector of float)
0:169 'v' (temp mediump 4-component vector of float)
0:169 f: direct index for structure (in mediump float)
0:169 indirect index (temp block{in mediump float f})
0:169 'arrayedInst' (in 4-element array of block{in mediump float f})
0:169 'i' (uniform mediump int)
0:169 Constant:
0:169 0 (const int)
0:179 Function Definition: foo_IO( (global void)
0:179 Function Parameters:
0:181 Sequence
0:181 move second child to first child (temp highp float)
0:181 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
0:181 Constant:
0:181 0.200000
0:? Linker Objects
0:? Linker Objects
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
...
@@ -300,6 +356,13 @@ ERROR: node is still EOpNull!
...
@@ -300,6 +356,13 @@ ERROR: node is still EOpNull!
0:? 'insa' (smooth in 4-element array of structure{global mediump float f})
0:? 'insa' (smooth in 4-element array of structure{global mediump float f})
0:? 'inSA' (smooth in structure{global 4-element array of mediump float f})
0:? 'inSA' (smooth in structure{global 4-element array of mediump float f})
0:? 'inSS' (smooth in structure{global mediump float f, global structure{global mediump float f} s})
0:? 'inSS' (smooth in structure{global mediump float f, global structure{global mediump float f} s})
0:? 'outbinst' (out block{out mediump int a})
0:? 'inbinst' (in block{in mediump int a, in mediump 4-component vector of float v, in structure{global mediump int b} s})
0:? 'anon@0' (in block{layout(location=12 ) in mediump int aAnon, layout(location=13 ) centroid in mediump 4-component vector of float vAnon})
0:? 'aliased' (layout(location=13 ) smooth in mediump 4-component vector of float)
0:? 'arrayedInst' (in 4-element array of block{in mediump float f})
0:? 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
0:? 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
Linked fragment stage:
Linked fragment stage:
...
@@ -307,7 +370,11 @@ Linked fragment stage:
...
@@ -307,7 +370,11 @@ Linked fragment stage:
ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers
ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers
Shader version: 310
Shader version: 310
Requested GL_EXT_shader_io_blocks
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
using early_fragment_tests
using early_fragment_tests
using depth_any
ERROR: node is still EOpNull!
ERROR: node is still EOpNull!
0:21 Function Definition: main( (global void)
0:21 Function Definition: main( (global void)
0:21 Function Parameters:
0:21 Function Parameters:
...
@@ -521,6 +588,45 @@ ERROR: node is still EOpNull!
...
@@ -521,6 +588,45 @@ ERROR: node is still EOpNull!
0:107 'v2' (temp highp 2-component vector of int)
0:107 'v2' (temp highp 2-component vector of int)
0:107 Function Call: imageSize(I21; (global highp 2-component vector of int)
0:107 Function Call: imageSize(I21; (global highp 2-component vector of int)
0:107 'i2Dqualified' (layout(binding=6 ) coherent volatile restrict uniform highp image2D)
0:107 'i2Dqualified' (layout(binding=6 ) coherent volatile restrict uniform highp image2D)
0:165 Function Definition: fooIO( (global void)
0:165 Function Parameters:
0:167 Sequence
0:167 Sequence
0:167 move second child to first child (temp mediump 4-component vector of float)
0:167 'v' (temp mediump 4-component vector of float)
0:167 add (temp mediump 4-component vector of float)
0:167 v: direct index for structure (in mediump 4-component vector of float)
0:167 'inbinst' (in block{in mediump int a, in mediump 4-component vector of float v, in structure{global mediump int b} s})
0:167 Constant:
0:167 1 (const int)
0:167 vAnon: direct index for structure (layout(location=13 ) centroid in mediump 4-component vector of float)
0:167 'anon@0' (in block{layout(location=12 ) in mediump int aAnon, layout(location=13 ) centroid in mediump 4-component vector of float vAnon})
0:167 Constant:
0:167 1 (const uint)
0:168 vector scale second child into first child (temp mediump 4-component vector of float)
0:168 'v' (temp mediump 4-component vector of float)
0:168 f: direct index for structure (in mediump float)
0:168 direct index (temp block{in mediump float f})
0:168 'arrayedInst' (in 4-element array of block{in mediump float f})
0:168 Constant:
0:168 2 (const int)
0:168 Constant:
0:168 0 (const int)
0:169 vector scale second child into first child (temp mediump 4-component vector of float)
0:169 'v' (temp mediump 4-component vector of float)
0:169 f: direct index for structure (in mediump float)
0:169 indirect index (temp block{in mediump float f})
0:169 'arrayedInst' (in 4-element array of block{in mediump float f})
0:169 'i' (uniform mediump int)
0:169 Constant:
0:169 0 (const int)
0:179 Function Definition: foo_IO( (global void)
0:179 Function Parameters:
0:181 Sequence
0:181 move second child to first child (temp highp float)
0:181 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
0:181 Constant:
0:181 0.200000
0:? Linker Objects
0:? Linker Objects
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
...
@@ -562,4 +668,11 @@ ERROR: node is still EOpNull!
...
@@ -562,4 +668,11 @@ ERROR: node is still EOpNull!
0:? 'insa' (smooth in 4-element array of structure{global mediump float f})
0:? 'insa' (smooth in 4-element array of structure{global mediump float f})
0:? 'inSA' (smooth in structure{global 4-element array of mediump float f})
0:? 'inSA' (smooth in structure{global 4-element array of mediump float f})
0:? 'inSS' (smooth in structure{global mediump float f, global structure{global mediump float f} s})
0:? 'inSS' (smooth in structure{global mediump float f, global structure{global mediump float f} s})
0:? 'outbinst' (out block{out mediump int a})
0:? 'inbinst' (in block{in mediump int a, in mediump 4-component vector of float v, in structure{global mediump int b} s})
0:? 'anon@0' (in block{layout(location=12 ) in mediump int aAnon, layout(location=13 ) centroid in mediump 4-component vector of float vAnon})
0:? 'aliased' (layout(location=13 ) smooth in mediump 4-component vector of float)
0:? 'arrayedInst' (in 4-element array of block{in mediump float f})
0:? 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
0:? 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
Test/baseResults/310.geom.out
View file @
9e41f362
310.geom
310.geom
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
WARNING: 0:3: '#extension' : extension is only partially supported: GL_EXT_geometry_shader
WARNING: 0:3: '#extension' : extension is only partially supported: GL_EXT_geometry_shader
WARNING: 0:3: '#extension' : extension is only partially supported: GL_EXT_shader_io_blocks
ERROR: 0:21: 'fromVertex' : block instance name redefinition
ERROR: 0:21: 'fromVertex' : block instance name redefinition
ERROR: 0:25: 'fromVertex' : redefinition
ERROR: 0:25: 'fromVertex' : redefinition
ERROR: 0:27: 'fooC' : block instance name redefinition
ERROR: 0:27: 'fooC' : block instance name redefinition
...
...
Test/baseResults/310.vert.out
View file @
9e41f362
...
@@ -15,10 +15,18 @@ ERROR: 0:79: 'vertex-shader array-of-struct output' : not supported with this pr
...
@@ -15,10 +15,18 @@ ERROR: 0:79: 'vertex-shader array-of-struct output' : not supported with this pr
ERROR: 0:81: 'vertex-shader struct output containing an array' : not supported with this profile: es
ERROR: 0:81: 'vertex-shader struct output containing an array' : not supported with this profile: es
ERROR: 0:83: 'vertex-shader struct output containing structure' : not supported with this profile: es
ERROR: 0:83: 'vertex-shader struct output containing structure' : not supported with this profile: es
ERROR: 0:85: 'std430 on a uniform block' : not supported with this profile: es
ERROR: 0:85: 'std430 on a uniform block' : not supported with this profile: es
ERROR: 15 compilation errors. No code generated.
ERROR: 0:97: 's' : member of block cannot be a sampler type
ERROR: 0:105: 'location' : overlapping use of location 12
ERROR: 0:107: 'in' : cannot declare an input block in a vertex shader
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' : 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: 22 compilation errors. No code generated.
Shader version: 310
Shader version: 310
Requested GL_OES_shader_io_blocks
ERROR: node is still EOpNull!
ERROR: node is still EOpNull!
0:12 Function Definition: main( (global void)
0:12 Function Definition: main( (global void)
0:12 Function Parameters:
0:12 Function Parameters:
...
@@ -166,6 +174,29 @@ ERROR: node is still EOpNull!
...
@@ -166,6 +174,29 @@ ERROR: node is still EOpNull!
0:66 2 (const int)
0:66 2 (const int)
0:67 Constant:
0:67 Constant:
0:67 0.000000
0:67 0.000000
0:114 Function Definition: foo_IO( (global void)
0:114 Function Parameters:
0:116 Sequence
0:116 Sequence
0:116 move second child to first child (temp highp int)
0:116 'sum' (temp highp int)
0:116 add (temp highp int)
0:116 'gl_VertexID' (gl_VertexId highp int VertexId)
0:117 'gl_InstanceID' (gl_InstanceId highp int InstanceId)
0:118 move second child to first child (temp highp 4-component vector of float)
0:118 gl_Position: direct index for structure (gl_Position highp 4-component vector of float Position)
0:118 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
0:118 Constant:
0:118 0 (const uint)
0:118 Constant:
0:118 1.000000
0:118 1.000000
0:118 1.000000
0:118 1.000000
0:119 gl_PointSize: direct index for structure (gl_PointSize highp void PointSize)
0:119 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
0:119 Constant:
0:119 1 (const uint)
0:? Linker Objects
0:? Linker Objects
0:? 's' (shared highp 4-component vector of float)
0:? 's' (shared highp 4-component vector of float)
0:? 'v' (buffer highp 4-component vector of float)
0:? 'v' (buffer highp 4-component vector of float)
...
@@ -188,6 +219,11 @@ ERROR: node is still EOpNull!
...
@@ -188,6 +219,11 @@ ERROR: node is still EOpNull!
0:? 'outSS' (smooth out structure{global highp float f, global structure{global highp float f} s})
0:? 'outSS' (smooth out structure{global highp float f, global structure{global highp float f} s})
0:? 'U430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform highp int a})
0:? 'U430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform highp int a})
0:? 'B430i' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=0 ) buffer highp int a})
0:? 'B430i' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=0 ) buffer highp int a})
0:? 'outbinst' (out block{out highp int a, out highp 4-component vector of float v, out highp sampler2D s})
0:? 'anon@0' (out block{layout(location=12 ) out highp int aAnon, layout(location=13 ) out highp 4-component vector of float vAnon})
0:? 'aliased' (layout(location=12 ) smooth out highp int)
0:? 'inbinst' (in block{in highp int a})
0:? 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
0:? 'gl_VertexID' (gl_VertexId highp int VertexId)
0:? 'gl_VertexID' (gl_VertexId highp int VertexId)
0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId)
0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId)
...
@@ -196,6 +232,7 @@ Linked vertex stage:
...
@@ -196,6 +232,7 @@ Linked vertex stage:
Shader version: 310
Shader version: 310
Requested GL_OES_shader_io_blocks
ERROR: node is still EOpNull!
ERROR: node is still EOpNull!
0:12 Function Definition: main( (global void)
0:12 Function Definition: main( (global void)
0:12 Function Parameters:
0:12 Function Parameters:
...
@@ -343,6 +380,29 @@ ERROR: node is still EOpNull!
...
@@ -343,6 +380,29 @@ ERROR: node is still EOpNull!
0:66 2 (const int)
0:66 2 (const int)
0:67 Constant:
0:67 Constant:
0:67 0.000000
0:67 0.000000
0:114 Function Definition: foo_IO( (global void)
0:114 Function Parameters:
0:116 Sequence
0:116 Sequence
0:116 move second child to first child (temp highp int)
0:116 'sum' (temp highp int)
0:116 add (temp highp int)
0:116 'gl_VertexID' (gl_VertexId highp int VertexId)
0:117 'gl_InstanceID' (gl_InstanceId highp int InstanceId)
0:118 move second child to first child (temp highp 4-component vector of float)
0:118 gl_Position: direct index for structure (gl_Position highp 4-component vector of float Position)
0:118 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
0:118 Constant:
0:118 0 (const uint)
0:118 Constant:
0:118 1.000000
0:118 1.000000
0:118 1.000000
0:118 1.000000
0:119 gl_PointSize: direct index for structure (gl_PointSize highp void PointSize)
0:119 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
0:119 Constant:
0:119 1 (const uint)
0:? Linker Objects
0:? Linker Objects
0:? 's' (shared highp 4-component vector of float)
0:? 's' (shared highp 4-component vector of float)
0:? 'v' (buffer highp 4-component vector of float)
0:? 'v' (buffer highp 4-component vector of float)
...
@@ -365,6 +425,11 @@ ERROR: node is still EOpNull!
...
@@ -365,6 +425,11 @@ ERROR: node is still EOpNull!
0:? 'outSS' (smooth out structure{global highp float f, global structure{global highp float f} s})
0:? 'outSS' (smooth out structure{global highp float f, global structure{global highp float f} s})
0:? 'U430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform highp int a})
0:? 'U430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform highp int a})
0:? 'B430i' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=0 ) buffer highp int a})
0:? 'B430i' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=0 ) buffer highp int a})
0:? 'outbinst' (out block{out highp int a, out highp 4-component vector of float v, out highp sampler2D s})
0:? 'anon@0' (out block{layout(location=12 ) out highp int aAnon, layout(location=13 ) out highp 4-component vector of float vAnon})
0:? 'aliased' (layout(location=12 ) smooth out highp int)
0:? 'inbinst' (in block{in highp int a})
0:? 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
0:? 'gl_VertexID' (gl_VertexId highp int VertexId)
0:? 'gl_VertexID' (gl_VertexId highp int VertexId)
0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId)
0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId)
glslang/MachineIndependent/Initialize.cpp
View file @
9e41f362
...
@@ -1464,10 +1464,19 @@ void TBuiltIns::initialize(int version, EProfile profile)
...
@@ -1464,10 +1464,19 @@ void TBuiltIns::initialize(int version, EProfile profile)
stageBuiltins
[
EShLangVertex
].
append
(
stageBuiltins
[
EShLangVertex
].
append
(
"highp int gl_VertexID;"
// needs qualifier fixed later
"highp int gl_VertexID;"
// needs qualifier fixed later
"highp int gl_InstanceID;"
// needs qualifier fixed later
"highp int gl_InstanceID;"
// needs qualifier fixed later
"highp vec4 gl_Position;"
// needs qualifier fixed later
"highp float gl_PointSize;"
// needs qualifier fixed later
);
);
if
(
version
<
310
)
stageBuiltins
[
EShLangVertex
].
append
(
"highp vec4 gl_Position;"
// needs qualifier fixed later
"highp float gl_PointSize;"
// needs qualifier fixed later
);
else
stageBuiltins
[
EShLangVertex
].
append
(
"out gl_PerVertex {"
"highp vec4 gl_Position;"
// needs qualifier fixed later
"highp float gl_PointSize;"
// needs qualifier fixed later
"};"
);
}
}
}
}
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
9e41f362
...
@@ -1653,8 +1653,13 @@ bool TParseContext::lValueErrorCheck(TSourceLoc loc, const char* op, TIntermType
...
@@ -1653,8 +1653,13 @@ bool TParseContext::lValueErrorCheck(TSourceLoc loc, const char* op, TIntermType
if
(
node
->
getQualifier
().
readonly
)
if
(
node
->
getQualifier
().
readonly
)
message
=
"can't modify a readonly buffer"
;
message
=
"can't modify a readonly buffer"
;
break
;
break
;
default
:
case
EvqFragDepth
:
// "In addition, it is an error to statically write to gl_FragDepth in the fragment shader."
if
(
profile
==
EEsProfile
&&
intermediate
.
getEarlyFragmentTests
())
message
=
"can't modify gl_FragDepth if using early_fragment_tests"
;
break
;
default
:
//
//
// Type that can't be written to?
// Type that can't be written to?
//
//
...
@@ -2632,7 +2637,12 @@ void TParseContext::nonInitConstCheck(TSourceLoc loc, TString& identifier, TType
...
@@ -2632,7 +2637,12 @@ void TParseContext::nonInitConstCheck(TSourceLoc loc, TString& identifier, TType
//
//
TSymbol
*
TParseContext
::
redeclareBuiltinVariable
(
TSourceLoc
loc
,
const
TString
&
identifier
,
const
TQualifier
&
qualifier
,
const
TShaderQualifiers
&
publicType
,
bool
&
newDeclaration
)
TSymbol
*
TParseContext
::
redeclareBuiltinVariable
(
TSourceLoc
loc
,
const
TString
&
identifier
,
const
TQualifier
&
qualifier
,
const
TShaderQualifiers
&
publicType
,
bool
&
newDeclaration
)
{
{
if
(
profile
==
EEsProfile
||
!
builtInName
(
identifier
)
||
symbolTable
.
atBuiltInLevel
()
||
!
symbolTable
.
atGlobalLevel
())
if
(
!
builtInName
(
identifier
)
||
symbolTable
.
atBuiltInLevel
()
||
!
symbolTable
.
atGlobalLevel
())
return
0
;
bool
nonEsRedecls
=
(
profile
!=
EEsProfile
&&
(
version
>=
130
||
identifier
==
"gl_TexCoord"
));
bool
esRedecls
=
(
profile
==
EEsProfile
&&
extensionsTurnedOn
(
Num_AEP_shader_io_blocks
,
AEP_shader_io_blocks
));
if
(
!
esRedecls
&&
!
nonEsRedecls
)
return
0
;
return
0
;
// Special case when using GL_ARB_separate_shader_objects
// Special case when using GL_ARB_separate_shader_objects
...
@@ -2648,15 +2658,15 @@ TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString&
...
@@ -2648,15 +2658,15 @@ TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString&
// Potentially redeclaring a built-in variable...
// Potentially redeclaring a built-in variable...
if
(
ssoPre150
||
if
(
ssoPre150
||
(
identifier
==
"gl_FragDepth"
&&
version
>=
420
)
||
(
identifier
==
"gl_FragDepth"
&&
((
nonEsRedecls
&&
version
>=
420
)
||
esRedecls
)
)
||
(
identifier
==
"gl_FragCoord"
&&
version
>=
150
)
||
(
identifier
==
"gl_FragCoord"
&&
((
nonEsRedecls
&&
version
>=
150
)
||
esRedecls
)
)
||
(
identifier
==
"gl_ClipDistance"
&&
version
>=
130
)
||
identifier
==
"gl_ClipDistance"
||
(
identifier
==
"gl_FrontColor"
&&
version
>=
130
)
||
identifier
==
"gl_FrontColor"
||
(
identifier
==
"gl_BackColor"
&&
version
>=
130
)
||
identifier
==
"gl_BackColor"
||
(
identifier
==
"gl_FrontSecondaryColor"
&&
version
>=
130
)
||
identifier
==
"gl_FrontSecondaryColor"
||
(
identifier
==
"gl_BackSecondaryColor"
&&
version
>=
130
)
||
identifier
==
"gl_BackSecondaryColor"
||
(
identifier
==
"gl_SecondaryColor"
&&
version
>=
130
)
||
identifier
==
"gl_SecondaryColor"
||
(
identifier
==
"gl_Color"
&&
version
>=
130
&&
language
==
EShLangFragment
)
||
(
identifier
==
"gl_Color"
&&
language
==
EShLangFragment
)
||
identifier
==
"gl_TexCoord"
)
{
identifier
==
"gl_TexCoord"
)
{
// Find the existing symbol, if any.
// Find the existing symbol, if any.
...
@@ -2715,7 +2725,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString&
...
@@ -2715,7 +2725,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString&
if
(
qualifier
.
nopersp
!=
symbolQualifier
.
nopersp
||
qualifier
.
flat
!=
symbolQualifier
.
flat
||
if
(
qualifier
.
nopersp
!=
symbolQualifier
.
nopersp
||
qualifier
.
flat
!=
symbolQualifier
.
flat
||
qualifier
.
isMemory
()
||
qualifier
.
isAuxiliary
())
qualifier
.
isMemory
()
||
qualifier
.
isAuxiliary
())
error
(
loc
,
"can only change layout qualification of"
,
"redeclaration"
,
symbol
->
getName
().
c_str
());
error
(
loc
,
"can only change layout qualification of"
,
"redeclaration"
,
symbol
->
getName
().
c_str
());
if
(
identifier
==
"gl_FragCoord"
&&
qualifier
.
storage
!=
EvqVaryingIn
)
if
(
qualifier
.
storage
!=
EvqVaryingIn
)
error
(
loc
,
"cannot change input storage qualification of"
,
"redeclaration"
,
symbol
->
getName
().
c_str
());
error
(
loc
,
"cannot change input storage qualification of"
,
"redeclaration"
,
symbol
->
getName
().
c_str
());
if
(
!
builtIn
&&
(
publicType
.
pixelCenterInteger
!=
intermediate
.
getPixelCenterInteger
()
||
if
(
!
builtIn
&&
(
publicType
.
pixelCenterInteger
!=
intermediate
.
getPixelCenterInteger
()
||
publicType
.
originUpperLeft
!=
intermediate
.
getOriginUpperLeft
()))
publicType
.
originUpperLeft
!=
intermediate
.
getOriginUpperLeft
()))
...
@@ -2753,7 +2763,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString&
...
@@ -2753,7 +2763,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString&
void
TParseContext
::
redeclareBuiltinBlock
(
TSourceLoc
loc
,
TTypeList
&
newTypeList
,
const
TString
&
blockName
,
const
TString
*
instanceName
,
TArraySizes
*
arraySizes
)
void
TParseContext
::
redeclareBuiltinBlock
(
TSourceLoc
loc
,
TTypeList
&
newTypeList
,
const
TString
&
blockName
,
const
TString
*
instanceName
,
TArraySizes
*
arraySizes
)
{
{
const
char
*
feature
=
"built-in block redeclaration"
;
const
char
*
feature
=
"built-in block redeclaration"
;
requireProfile
(
loc
,
~
EEsProfile
,
feature
);
profileRequires
(
loc
,
EEsProfile
,
0
,
Num_AEP_shader_io_blocks
,
AEP_shader_io_blocks
,
feature
);
profileRequires
(
loc
,
~
EEsProfile
,
410
,
GL_ARB_separate_shader_objects
,
feature
);
profileRequires
(
loc
,
~
EEsProfile
,
410
,
GL_ARB_separate_shader_objects
,
feature
);
if
(
blockName
!=
"gl_PerVertex"
&&
blockName
!=
"gl_PerFragment"
)
{
if
(
blockName
!=
"gl_PerVertex"
&&
blockName
!=
"gl_PerFragment"
)
{
...
@@ -4603,8 +4613,9 @@ void TParseContext::declareBlock(TSourceLoc loc, TTypeList& typeList, const TStr
...
@@ -4603,8 +4613,9 @@ void TParseContext::declareBlock(TSourceLoc loc, TTypeList& typeList, const TStr
switch
(
currentBlockQualifier
.
storage
)
{
switch
(
currentBlockQualifier
.
storage
)
{
case
EvqVaryingIn
:
case
EvqVaryingIn
:
case
EvqVaryingOut
:
case
EvqVaryingOut
:
requireProfile
(
memberLoc
,
ECoreProfile
|
ECompatibilityProfile
,
feature
);
requireProfile
(
memberLoc
,
ECoreProfile
|
ECompatibilityProfile
|
EEsProfile
,
feature
);
profileRequires
(
memberLoc
,
ECoreProfile
|
ECompatibilityProfile
,
440
,
GL_ARB_enhanced_layouts
,
feature
);
profileRequires
(
memberLoc
,
ECoreProfile
|
ECompatibilityProfile
,
440
,
GL_ARB_enhanced_layouts
,
feature
);
profileRequires
(
memberLoc
,
EEsProfile
,
0
,
Num_AEP_shader_io_blocks
,
AEP_shader_io_blocks
,
feature
);
memberWithLocation
=
true
;
memberWithLocation
=
true
;
break
;
break
;
default
:
default
:
...
@@ -4752,7 +4763,9 @@ void TParseContext::blockStageIoCheck(TSourceLoc loc, TStorageQualifier storageQ
...
@@ -4752,7 +4763,9 @@ void TParseContext::blockStageIoCheck(TSourceLoc loc, TStorageQualifier storageQ
profileRequires
(
loc
,
~
EEsProfile
,
150
,
GL_ARB_separate_shader_objects
,
"output block"
);
profileRequires
(
loc
,
~
EEsProfile
,
150
,
GL_ARB_separate_shader_objects
,
"output block"
);
switch
(
language
)
{
switch
(
language
)
{
case
EShLangVertex
:
case
EShLangVertex
:
profileRequires
(
loc
,
EEsProfile
,
0
,
Num_AEP_shader_io_blocks
,
AEP_shader_io_blocks
,
"vertex output block"
);
// ES 310 can have a block before shader_io is turned on, so skip this test for built-ins
if
(
!
parsingBuiltins
)
profileRequires
(
loc
,
EEsProfile
,
0
,
Num_AEP_shader_io_blocks
,
AEP_shader_io_blocks
,
"vertex output block"
);
if
(
profile
==
EEsProfile
&&
arraySizes
)
if
(
profile
==
EEsProfile
&&
arraySizes
)
arraySizeRequiredCheck
(
loc
,
arraySizes
->
getSize
());
arraySizeRequiredCheck
(
loc
,
arraySizes
->
getSize
());
break
;
break
;
...
...
glslang/MachineIndependent/Versions.cpp
View file @
9e41f362
...
@@ -185,7 +185,7 @@ void TParseContext::initializeExtensionBehavior()
...
@@ -185,7 +185,7 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior
[
GL_EXT_geometry_point_size
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_geometry_point_size
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_gpu_shader5
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_gpu_shader5
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_primitive_bounding_box
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_primitive_bounding_box
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_shader_io_blocks
]
=
EBhDisable
Partial
;
extensionBehavior
[
GL_EXT_shader_io_blocks
]
=
EBhDisable
;
extensionBehavior
[
GL_EXT_tessellation_shader
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_tessellation_shader
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_tessellation_point_size
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_tessellation_point_size
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_texture_buffer
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_EXT_texture_buffer
]
=
EBhDisablePartial
;
...
@@ -195,7 +195,7 @@ void TParseContext::initializeExtensionBehavior()
...
@@ -195,7 +195,7 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior
[
GL_OES_geometry_shader
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_geometry_shader
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_gpu_shader5
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_gpu_shader5
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_primitive_bounding_box
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_primitive_bounding_box
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_shader_io_blocks
]
=
EBhDisable
Partial
;
extensionBehavior
[
GL_OES_shader_io_blocks
]
=
EBhDisable
;
extensionBehavior
[
GL_OES_tessellation_shader
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_tessellation_shader
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_texture_buffer
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_texture_buffer
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_texture_cube_map_array
]
=
EBhDisablePartial
;
extensionBehavior
[
GL_OES_texture_cube_map_array
]
=
EBhDisablePartial
;
...
...
glslang/MachineIndependent/linkValidate.cpp
View file @
9e41f362
...
@@ -715,7 +715,9 @@ int TIntermediate::computeTypeLocationSize(const TType& type) const
...
@@ -715,7 +715,9 @@ int TIntermediate::computeTypeLocationSize(const TType& type) const
return
size
;
return
size
;
}
}
// "If a vertex shader input is any scalar or vector type, it will consume a single location. If a non-vertex
// ES: "If a shader input is any scalar or vector type, it will consume a single location."
// Desktop: "If a vertex shader input is any scalar or vector type, it will consume a single location. If a non-vertex
// shader input is a scalar or vector type other than dvec3 or dvec4, it will consume a single location, while
// shader input is a scalar or vector type other than dvec3 or dvec4, it will consume a single location, while
// types dvec3 or dvec4 will consume two consecutive locations. Inputs of type double and dvec2 will
// types dvec3 or dvec4 will consume two consecutive locations. Inputs of type double and dvec2 will
// consume only a single location, in all stages."
// consume only a single location, in all stages."
...
...
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