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
baa55a15
Commit
baa55a15
authored
Jan 18, 2016
by
Dejan Mircevski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spv.branch-return.vert and fix inReadableOrder().
parent
44bfb0d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
3 deletions
+78
-3
InReadableOrder.cpp
SPIRV/InReadableOrder.cpp
+4
-3
spv.branch-return.vert.out
Test/baseResults/spv.branch-return.vert.out
+63
-0
spv.branch-return.vert
Test/spv.branch-return.vert
+10
-0
test-spirv-list
Test/test-spirv-list
+1
-0
No files found.
SPIRV/InReadableOrder.cpp
View file @
baa55a15
...
@@ -27,10 +27,11 @@ using BlockSet = std::unordered_set<Id>;
...
@@ -27,10 +27,11 @@ using BlockSet = std::unordered_set<Id>;
using
IdToBool
=
std
::
unordered_map
<
Id
,
bool
>
;
using
IdToBool
=
std
::
unordered_map
<
Id
,
bool
>
;
namespace
{
namespace
{
// True if any of prerequisites have not yet been visited.
// True if any of prerequisites have not yet been visited. May add new,
bool
delay
(
const
BlockSet
&
prereqs
,
const
IdToBool
&
visited
)
{
// zero-initialized, values to visited, but doesn't modify any existing values.
bool
delay
(
const
BlockSet
&
prereqs
,
IdToBool
&
visited
)
{
return
std
::
any_of
(
prereqs
.
begin
(),
prereqs
.
end
(),
return
std
::
any_of
(
prereqs
.
begin
(),
prereqs
.
end
(),
[
&
visited
](
Id
b
)
{
return
!
visited
.
count
(
b
)
;
});
[
&
visited
](
Id
b
)
{
return
!
visited
[
b
]
;
});
}
}
}
}
...
...
Test/baseResults/spv.branch-return.vert.out
0 → 100644
View file @
baa55a15
spv.branch-return.vert
Linked vertex stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 35
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 8 19 34
Source ESSL 300
Name 4 "main"
Name 8 "gl_InstanceID"
Name 19 "gl_Position"
Name 34 "gl_VertexID"
Decorate 8(gl_InstanceID) BuiltIn InstanceId
Decorate 19(gl_Position) BuiltIn Position
Decorate 34(gl_VertexID) BuiltIn VertexId
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypePointer Input 6(int)
8(gl_InstanceID): 7(ptr) Variable Input
16: TypeFloat 32
17: TypeVector 16(float) 4
18: TypePointer Output 17(fvec4)
19(gl_Position): 18(ptr) Variable Output
20: 16(float) Constant 0
21: 17(fvec4) ConstantComposite 20 20 20 20
26: 16(float) Constant 1039918957
27: TypeInt 32 0
28: 27(int) Constant 0
29: TypePointer Output 16(float)
34(gl_VertexID): 7(ptr) Variable Input
4(main): 2 Function None 3
5: Label
9: 6(int) Load 8(gl_InstanceID)
SelectionMerge 14 None
Switch 9 14
case 0: 10
case 1: 11
case 2: 12
case 3: 13
10: Label
Return
11: Label
Store 19(gl_Position) 21
Branch 14
12: Label
Return
13: Label
Return
14: Label
30: 29(ptr) AccessChain 19(gl_Position) 28
31: 16(float) Load 30
32: 16(float) FAdd 31 26
33: 29(ptr) AccessChain 19(gl_Position) 28
Store 33 32
Return
FunctionEnd
Test/spv.branch-return.vert
0 → 100644
View file @
baa55a15
#version 300 es
void
main
()
{
switch
(
gl_InstanceID
)
{
case
0
:
return
;
case
1
:
gl_Position
=
vec4
(
0
.
0
);
break
;
case
2
:
return
;
case
3
:
return
;
}
gl_Position
.
x
+=
0
.
123
;
}
Test/test-spirv-list
View file @
baa55a15
...
@@ -32,6 +32,7 @@ spv.always-discard.frag
...
@@ -32,6 +32,7 @@ spv.always-discard.frag
spv.always-discard2.frag
spv.always-discard2.frag
spv.bitCast.frag
spv.bitCast.frag
spv.bool.vert
spv.bool.vert
spv.branch-return.vert
spv.conditionalDiscard.frag
spv.conditionalDiscard.frag
spv.conversion.frag
spv.conversion.frag
spv.dataOut.frag
spv.dataOut.frag
...
...
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