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
0479437a
Commit
0479437a
authored
Mar 01, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Fix #739: OpSelect can only operate on scalars and vectors.
parent
173c0c01
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
17 deletions
+55
-17
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+2
-1
spv.Operations.frag.out
Test/baseResults/spv.Operations.frag.out
+49
-15
spv.Operations.frag
Test/spv.Operations.frag
+3
-0
revision.h
glslang/Include/revision.h
+1
-1
No files found.
SPIRV/GlslangToSpv.cpp
View file @
0479437a
...
@@ -1789,7 +1789,8 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
...
@@ -1789,7 +1789,8 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
// Crucially, side effects must be avoided, and there are performance trade-offs.
// Crucially, side effects must be avoided, and there are performance trade-offs.
// Return true if good idea (and safe) for OpSelect, false otherwise.
// Return true if good idea (and safe) for OpSelect, false otherwise.
const
auto
selectPolicy
=
[
&
]()
->
bool
{
const
auto
selectPolicy
=
[
&
]()
->
bool
{
if
(
node
->
getBasicType
()
==
glslang
::
EbtVoid
)
if
((
!
node
->
getType
().
isScalar
()
&&
!
node
->
getType
().
isVector
())
||
node
->
getBasicType
()
==
glslang
::
EbtVoid
)
return
false
;
return
false
;
if
(
node
->
getTrueBlock
()
==
nullptr
||
if
(
node
->
getTrueBlock
()
==
nullptr
||
...
...
Test/baseResults/spv.Operations.frag.out
View file @
0479437a
...
@@ -3,12 +3,12 @@ Warning, version 450 is not yet complete; most version-specific features are pre
...
@@ -3,12 +3,12 @@ Warning, version 450 is not yet complete; most version-specific features are pre
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80001
// Generated by (magic number): 80001
// Id's are bound by 5
09
// Id's are bound by 5
32
Capability Shader
Capability Shader
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 22 212 288 485 5
03 508
EntryPoint Fragment 4 "main" 11 22 212 288 485 5
26 531
ExecutionMode 4 OriginUpperLeft
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
Source GLSL 450
Name 4 "main"
Name 4 "main"
...
@@ -24,13 +24,15 @@ Warning, version 450 is not yet complete; most version-specific features are pre
...
@@ -24,13 +24,15 @@ Warning, version 450 is not yet complete; most version-specific features are pre
Name 305 "b"
Name 305 "b"
Name 342 "ub42"
Name 342 "ub42"
Name 485 "FragColor"
Name 485 "FragColor"
Name 503 "uiv4"
Name 503 "m1"
Name 505 "ub"
Name 510 "m2"
Name 508 "uuv4"
Name 526 "uiv4"
Name 528 "ub"
Name 531 "uuv4"
Decorate 22(ui) Flat
Decorate 22(ui) Flat
Decorate 288(uui) Flat
Decorate 288(uui) Flat
Decorate 5
03
(uiv4) Flat
Decorate 5
26
(uiv4) Flat
Decorate 5
08
(uuv4) Flat
Decorate 5
31
(uuv4) Flat
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeFloat 32
6: TypeFloat 32
...
@@ -65,14 +67,24 @@ Warning, version 450 is not yet complete; most version-specific features are pre
...
@@ -65,14 +67,24 @@ Warning, version 450 is not yet complete; most version-specific features are pre
472: 18(int) Constant 17
472: 18(int) Constant 17
484: TypePointer Output 7(fvec4)
484: TypePointer Output 7(fvec4)
485(FragColor): 484(ptr) Variable Output
485(FragColor): 484(ptr) Variable Output
501: TypeVector 18(int) 4
501: TypeMatrix 7(fvec4) 4
502: TypePointer Input 501(ivec4)
502: TypePointer Function 501
503(uiv4): 502(ptr) Variable Input
504: 6(float) Constant 0
504: TypePointer Private 178(bool)
505: 7(fvec4) ConstantComposite 461 504 504 504
505(ub): 504(ptr) Variable Private
506: 7(fvec4) ConstantComposite 504 461 504 504
506: TypeVector 141(int) 4
507: 7(fvec4) ConstantComposite 504 504 461 504
507: TypePointer Input 506(ivec4)
508: 7(fvec4) ConstantComposite 504 504 504 461
508(uuv4): 507(ptr) Variable Input
509: 501 ConstantComposite 505 506 507 508
511: 7(fvec4) ConstantComposite 504 504 504 504
512: 501 ConstantComposite 511 511 511 511
524: TypeVector 18(int) 4
525: TypePointer Input 524(ivec4)
526(uiv4): 525(ptr) Variable Input
527: TypePointer Private 178(bool)
528(ub): 527(ptr) Variable Private
529: TypeVector 141(int) 4
530: TypePointer Input 529(ivec4)
531(uuv4): 530(ptr) Variable Input
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
9(v): 8(ptr) Variable Function
9(v): 8(ptr) Variable Function
...
@@ -81,6 +93,9 @@ Warning, version 450 is not yet complete; most version-specific features are pre
...
@@ -81,6 +93,9 @@ Warning, version 450 is not yet complete; most version-specific features are pre
285(u): 284(ptr) Variable Function
285(u): 284(ptr) Variable Function
305(b): 304(ptr) Variable Function
305(b): 304(ptr) Variable Function
486: 8(ptr) Variable Function
486: 8(ptr) Variable Function
503(m1): 502(ptr) Variable Function
510(m2): 502(ptr) Variable Function
513: 502(ptr) Variable Function
12: 7(fvec4) Load 11(uv4)
12: 7(fvec4) Load 11(uv4)
13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12
13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12
Store 9(v) 13
Store 9(v) 13
...
@@ -666,5 +681,24 @@ Warning, version 450 is not yet complete; most version-specific features are pre
...
@@ -666,5 +681,24 @@ Warning, version 450 is not yet complete; most version-specific features are pre
489: Label
489: Label
500: 7(fvec4) Load 486
500: 7(fvec4) Load 486
Store 485(FragColor) 500
Store 485(FragColor) 500
Store 503(m1) 509
Store 510(m2) 512
514: 178(bool) Load 305(b)
SelectionMerge 516 None
BranchConditional 514 515 518
515: Label
517: 501 Load 503(m1)
Store 513 517
Branch 516
518: Label
519: 501 Load 510(m2)
Store 513 519
Branch 516
516: Label
520: 8(ptr) AccessChain 513 405
521: 7(fvec4) Load 520
522: 7(fvec4) Load 485(FragColor)
523: 7(fvec4) FAdd 522 521
Store 485(FragColor) 523
Return
Return
FunctionEnd
FunctionEnd
Test/spv.Operations.frag
View file @
0479437a
...
@@ -135,4 +135,7 @@ void main()
...
@@ -135,4 +135,7 @@ void main()
b
=
!
b
;
b
=
!
b
;
FragColor
=
b
?
vec4
(
i
)
+
vec4
(
f
)
+
v
:
v
;
FragColor
=
b
?
vec4
(
i
)
+
vec4
(
f
)
+
v
:
v
;
mat4
m1
=
mat4
(
1
.
0
),
m2
=
mat4
(
0
.
0
);
FragColor
+=
(
b
?
m1
:
m2
)[
1
];
}
}
glslang/Include/revision.h
View file @
0479437a
...
@@ -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.18
65
"
#define GLSLANG_REVISION "Overload400-PrecQual.18
70
"
#define GLSLANG_DATE "01-Mar-2017"
#define GLSLANG_DATE "01-Mar-2017"
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