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
d6be6da0
Commit
d6be6da0
authored
Aug 17, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Fix #1016: Don't allow non-GLSL-extension protected Layer and ViewportIndex members.
parent
03e63fa8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
124 additions
and
57 deletions
+124
-57
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+4
-0
spv.450.geom.out
Test/baseResults/spv.450.geom.out
+14
-2
spv.450.tesc.out
Test/baseResults/spv.450.tesc.out
+102
-54
spv.450.geom
Test/spv.450.geom
+2
-0
spv.450.tesc
Test/spv.450.tesc
+2
-1
No files found.
SPIRV/GlslangToSpv.cpp
View file @
d6be6da0
...
@@ -2465,6 +2465,10 @@ bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member)
...
@@ -2465,6 +2465,10 @@ bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member)
if
(
member
.
getFieldName
()
==
"gl_ViewportMaskPerViewNV"
&&
if
(
member
.
getFieldName
()
==
"gl_ViewportMaskPerViewNV"
&&
extensions
.
find
(
"GL_NVX_multiview_per_view_attributes"
)
==
extensions
.
end
())
extensions
.
find
(
"GL_NVX_multiview_per_view_attributes"
)
==
extensions
.
end
())
return
true
;
return
true
;
if
((
member
.
getFieldName
()
==
"gl_ViewportIndex"
||
member
.
getFieldName
()
==
"gl_Layer"
)
&&
extensions
.
find
(
glslang
::
E_GL_ARB_shader_viewport_layer_array
)
==
extensions
.
end
()
&&
extensions
.
find
(
glslang
::
E_GL_NV_viewport_array2
)
==
extensions
.
end
())
return
true
;
return
false
;
return
false
;
};
};
...
...
Test/baseResults/spv.450.geom.out
View file @
d6be6da0
spv.450.geom
spv.450.geom
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80001
// Generated by (magic number): 80001
// Id's are bound by
26
// Id's are bound by
31
Capability Geometry
Capability Geometry
Capability GeometryPointSize
Capability GeometryPointSize
Capability MultiViewport
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 13 20
EntryPoint Geometry 4 "main" 13 20
27 29
ExecutionMode 4 Triangles
ExecutionMode 4 Triangles
ExecutionMode 4 Invocations 4
ExecutionMode 4 Invocations 4
ExecutionMode 4 OutputLineStrip
ExecutionMode 4 OutputLineStrip
...
@@ -26,6 +27,8 @@ spv.450.geom
...
@@ -26,6 +27,8 @@ spv.450.geom
MemberName 16(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 16(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 16(gl_PerVertex) 3 "gl_CullDistance"
MemberName 16(gl_PerVertex) 3 "gl_CullDistance"
Name 20 "gl_in"
Name 20 "gl_in"
Name 27 "gl_Layer"
Name 29 "gl_ViewportIndex"
MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance
...
@@ -36,6 +39,8 @@ spv.450.geom
...
@@ -36,6 +39,8 @@ spv.450.geom
MemberDecorate 16(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 16(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 16(gl_PerVertex) 3 BuiltIn CullDistance
MemberDecorate 16(gl_PerVertex) 3 BuiltIn CullDistance
Decorate 16(gl_PerVertex) Block
Decorate 16(gl_PerVertex) Block
Decorate 27(gl_Layer) BuiltIn Layer
Decorate 29(gl_ViewportIndex) BuiltIn ViewportIndex
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeFloat 32
6: TypeFloat 32
...
@@ -55,11 +60,18 @@ spv.450.geom
...
@@ -55,11 +60,18 @@ spv.450.geom
20(gl_in): 19(ptr) Variable Input
20(gl_in): 19(ptr) Variable Input
21: TypePointer Input 6(float)
21: TypePointer Input 6(float)
24: TypePointer Output 6(float)
24: TypePointer Output 6(float)
26: TypePointer Output 14(int)
27(gl_Layer): 26(ptr) Variable Output
28: 14(int) Constant 2
29(gl_ViewportIndex): 26(ptr) Variable Output
30: 14(int) Constant 3
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
22: 21(ptr) AccessChain 20(gl_in) 15 15
22: 21(ptr) AccessChain 20(gl_in) 15 15
23: 6(float) Load 22
23: 6(float) Load 22
25: 24(ptr) AccessChain 13 15
25: 24(ptr) AccessChain 13 15
Store 25 23
Store 25 23
Store 27(gl_Layer) 28
Store 29(gl_ViewportIndex) 30
Return
Return
FunctionEnd
FunctionEnd
Test/baseResults/spv.450.tesc.out
View file @
d6be6da0
This diff is collapsed.
Click to expand it.
Test/spv.450.geom
View file @
d6be6da0
...
@@ -9,4 +9,6 @@ layout(invocations = 4) in;
...
@@ -9,4 +9,6 @@ layout(invocations = 4) in;
void
main
()
void
main
()
{
{
gl_PointSize
=
gl_in
[
1
].
gl_PointSize
;
gl_PointSize
=
gl_in
[
1
].
gl_PointSize
;
gl_Layer
=
2
;
gl_ViewportIndex
=
3
;
}
}
Test/spv.450.tesc
View file @
d6be6da0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
layout(vertices = 4) out;
layout(vertices = 4) out;
patch out vec4 patchOut;
layout(location=1)
patch out vec4 patchOut;
struct S {
struct S {
float sMem1; // should not see a patch decoration
float sMem1; // should not see a patch decoration
...
@@ -17,6 +17,7 @@ layout(location = 12) patch out TheBlock {
...
@@ -17,6 +17,7 @@ layout(location = 12) patch out TheBlock {
void main()
void main()
{
{
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
}
}
layout(location = 2) patch out SingleBlock {
layout(location = 2) patch out SingleBlock {
...
...
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