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
5c3eed54
Commit
5c3eed54
authored
Feb 05, 2018
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Create more access chains addressing a few swizzling issues.
- Fixes #1233 - Treats local bools like anything else - more consistently deals with a dynamic component selection
parent
2651ccae
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
764 additions
and
716 deletions
+764
-716
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+81
-62
SpvBuilder.h
SPIRV/SpvBuilder.h
+8
-4
spv.400.frag.out
Test/baseResults/spv.400.frag.out
+6
-6
spv.accessChain.frag.out
Test/baseResults/spv.accessChain.frag.out
+184
-160
spv.boolInBlock.frag.out
Test/baseResults/spv.boolInBlock.frag.out
+119
-124
spv.conversion.frag.out
Test/baseResults/spv.conversion.frag.out
+63
-63
spv.types.frag.out
Test/baseResults/spv.types.frag.out
+297
-297
spv.accessChain.frag
Test/spv.accessChain.frag
+6
-0
No files found.
SPIRV/SpvBuilder.cpp
View file @
5c3eed54
...
@@ -1388,16 +1388,13 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vect
...
@@ -1388,16 +1388,13 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vect
return
createCompositeInsert
(
source
,
target
,
typeId
,
channels
.
front
());
return
createCompositeInsert
(
source
,
target
,
typeId
,
channels
.
front
());
Instruction
*
swizzle
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpVectorShuffle
);
Instruction
*
swizzle
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpVectorShuffle
);
assert
(
isVector
(
target
));
assert
(
isVector
(
target
));
swizzle
->
addIdOperand
(
target
);
swizzle
->
addIdOperand
(
target
);
if
(
accessChain
.
component
!=
NoResult
)
// For dynamic component selection, source does not involve in l-value swizzle
assert
(
getNumComponents
(
source
)
==
(
int
)
channels
.
size
());
swizzle
->
addIdOperand
(
target
);
assert
(
isVector
(
source
));
else
{
swizzle
->
addIdOperand
(
source
);
assert
(
getNumComponents
(
source
)
==
(
int
)
channels
.
size
());
assert
(
isVector
(
source
));
swizzle
->
addIdOperand
(
source
);
}
// Set up an identity shuffle from the base value to the result value
// Set up an identity shuffle from the base value to the result value
unsigned
int
components
[
4
];
unsigned
int
components
[
4
];
...
@@ -1406,12 +1403,8 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vect
...
@@ -1406,12 +1403,8 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vect
components
[
i
]
=
i
;
components
[
i
]
=
i
;
// Punch in the l-value swizzle
// Punch in the l-value swizzle
for
(
int
i
=
0
;
i
<
(
int
)
channels
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
(
int
)
channels
.
size
();
++
i
)
if
(
accessChain
.
component
!=
NoResult
)
components
[
channels
[
i
]]
=
numTargetComponents
+
i
;
components
[
i
]
=
channels
[
i
];
// Only shuffle the base value
else
components
[
channels
[
i
]]
=
numTargetComponents
+
i
;
}
// finish the instruction with these components selectors
// finish the instruction with these components selectors
for
(
int
i
=
0
;
i
<
numTargetComponents
;
++
i
)
for
(
int
i
=
0
;
i
<
numTargetComponents
;
++
i
)
...
@@ -2203,7 +2196,7 @@ void Builder::accessChainPushSwizzle(std::vector<unsigned>& swizzle, Id preSwizz
...
@@ -2203,7 +2196,7 @@ void Builder::accessChainPushSwizzle(std::vector<unsigned>& swizzle, Id preSwizz
accessChain
.
preSwizzleBaseType
=
preSwizzleBaseType
;
accessChain
.
preSwizzleBaseType
=
preSwizzleBaseType
;
// if needed, propagate the swizzle for the current access chain
// if needed, propagate the swizzle for the current access chain
if
(
accessChain
.
swizzle
.
size
())
{
if
(
accessChain
.
swizzle
.
size
()
>
0
)
{
std
::
vector
<
unsigned
>
oldSwizzle
=
accessChain
.
swizzle
;
std
::
vector
<
unsigned
>
oldSwizzle
=
accessChain
.
swizzle
;
accessChain
.
swizzle
.
resize
(
0
);
accessChain
.
swizzle
.
resize
(
0
);
for
(
unsigned
int
i
=
0
;
i
<
swizzle
.
size
();
++
i
)
{
for
(
unsigned
int
i
=
0
;
i
<
swizzle
.
size
();
++
i
)
{
...
@@ -2224,24 +2217,18 @@ void Builder::accessChainStore(Id rvalue)
...
@@ -2224,24 +2217,18 @@ void Builder::accessChainStore(Id rvalue)
transferAccessChainSwizzle
(
true
);
transferAccessChainSwizzle
(
true
);
Id
base
=
collapseAccessChain
();
Id
base
=
collapseAccessChain
();
Id
source
=
rvalue
;
// dynamic component should be gone
assert
(
accessChain
.
component
==
NoResult
);
// If swizzle still exists, it is out-of-order or not full, we must load the target vector,
// If swizzle still exists, it is out-of-order or not full, we must load the target vector,
// extract and insert elements to perform writeMask and/or swizzle.
// extract and insert elements to perform writeMask and/or swizzle.
Id
source
=
NoResult
;
if
(
accessChain
.
swizzle
.
size
()
>
0
)
{
if
(
accessChain
.
swizzle
.
size
())
{
Id
tempBaseId
=
createLoad
(
base
);
Id
tempBaseId
=
createLoad
(
base
);
source
=
createLvalueSwizzle
(
getTypeId
(
tempBaseId
),
tempBaseId
,
rvalu
e
,
accessChain
.
swizzle
);
source
=
createLvalueSwizzle
(
getTypeId
(
tempBaseId
),
tempBaseId
,
sourc
e
,
accessChain
.
swizzle
);
}
}
// dynamic component selection
if
(
accessChain
.
component
!=
NoResult
)
{
Id
tempBaseId
=
(
source
==
NoResult
)
?
createLoad
(
base
)
:
source
;
source
=
createVectorInsertDynamic
(
tempBaseId
,
getTypeId
(
tempBaseId
),
rvalue
,
accessChain
.
component
);
}
if
(
source
==
NoResult
)
source
=
rvalue
;
createStore
(
source
,
base
);
createStore
(
source
,
base
);
}
}
...
@@ -2251,7 +2238,7 @@ Id Builder::accessChainLoad(Decoration precision, Id resultType)
...
@@ -2251,7 +2238,7 @@ Id Builder::accessChainLoad(Decoration precision, Id resultType)
Id
id
;
Id
id
;
if
(
accessChain
.
isRValue
)
{
if
(
accessChain
.
isRValue
)
{
// transfer access chain, but
keep it static, so we can
stay in registers
// transfer access chain, but
try to
stay in registers
transferAccessChainSwizzle
(
false
);
transferAccessChainSwizzle
(
false
);
if
(
accessChain
.
indexChain
.
size
()
>
0
)
{
if
(
accessChain
.
indexChain
.
size
()
>
0
)
{
Id
swizzleBase
=
accessChain
.
preSwizzleBaseType
!=
NoType
?
accessChain
.
preSwizzleBaseType
:
resultType
;
Id
swizzleBase
=
accessChain
.
preSwizzleBaseType
!=
NoType
?
accessChain
.
preSwizzleBaseType
:
resultType
;
...
@@ -2299,16 +2286,16 @@ Id Builder::accessChainLoad(Decoration precision, Id resultType)
...
@@ -2299,16 +2286,16 @@ Id Builder::accessChainLoad(Decoration precision, Id resultType)
return
id
;
return
id
;
// Do remaining swizzling
// Do remaining swizzling
// First, static swizzling
if
(
accessChain
.
swizzle
.
size
())
{
// Do the basic swizzle
// static swizzle
if
(
accessChain
.
swizzle
.
size
()
>
0
)
{
Id
swizzledType
=
getScalarTypeId
(
getTypeId
(
id
));
Id
swizzledType
=
getScalarTypeId
(
getTypeId
(
id
));
if
(
accessChain
.
swizzle
.
size
()
>
1
)
if
(
accessChain
.
swizzle
.
size
()
>
1
)
swizzledType
=
makeVectorType
(
swizzledType
,
(
int
)
accessChain
.
swizzle
.
size
());
swizzledType
=
makeVectorType
(
swizzledType
,
(
int
)
accessChain
.
swizzle
.
size
());
id
=
createRvalueSwizzle
(
precision
,
swizzledType
,
id
,
accessChain
.
swizzle
);
id
=
createRvalueSwizzle
(
precision
,
swizzledType
,
id
,
accessChain
.
swizzle
);
}
}
//
dynamic single-component selection
//
Do the dynamic component
if
(
accessChain
.
component
!=
NoResult
)
if
(
accessChain
.
component
!=
NoResult
)
id
=
setPrecision
(
createVectorExtractDynamic
(
id
,
resultType
,
accessChain
.
component
),
precision
);
id
=
setPrecision
(
createVectorExtractDynamic
(
id
,
resultType
,
accessChain
.
component
),
precision
);
...
@@ -2458,26 +2445,66 @@ void Builder::dump(std::vector<unsigned int>& out) const
...
@@ -2458,26 +2445,66 @@ void Builder::dump(std::vector<unsigned int>& out) const
// Protected methods.
// Protected methods.
//
//
// Turn the described access chain in 'accessChain' into an instruction
// Turn the described access chain in 'accessChain' into an instruction
(s)
// computing its address. This *cannot* include complex swizzles, which must
// computing its address. This *cannot* include complex swizzles, which must
// be handled after this is called
, but it does include swizzles that select
// be handled after this is called
.
//
an individual element, as a single address of a scalar type can be
//
//
computed by an OpAccessChain instruction
.
//
Can generate code
.
Id
Builder
::
collapseAccessChain
()
Id
Builder
::
collapseAccessChain
()
{
{
assert
(
accessChain
.
isRValue
==
false
);
assert
(
accessChain
.
isRValue
==
false
);
if
(
accessChain
.
indexChain
.
size
()
>
0
)
{
// did we already emit an access chain for this?
if
(
accessChain
.
instr
==
0
)
{
if
(
accessChain
.
instr
!=
NoResult
)
StorageClass
storageClass
=
(
StorageClass
)
module
.
getStorageClass
(
getTypeId
(
accessChain
.
base
));
accessChain
.
instr
=
createAccessChain
(
storageClass
,
accessChain
.
base
,
accessChain
.
indexChain
);
}
return
accessChain
.
instr
;
return
accessChain
.
instr
;
}
else
// If we have a dynamic component, we can still transfer
// that into a final operand to the access chain. We need to remap the
// dynamic component through the swizzle to get a new dynamic component to
// update.
//
// This was not done in transferAccessChainSwizzle() because it might
// generate code.
remapDynamicSwizzle
();
if
(
accessChain
.
component
!=
NoResult
)
{
// transfer the dynamic component to the access chain
accessChain
.
indexChain
.
push_back
(
accessChain
.
component
);
accessChain
.
component
=
NoResult
;
}
// note that non-trivial swizzling is left pending
// do we have an access chain?
if
(
accessChain
.
indexChain
.
size
()
==
0
)
return
accessChain
.
base
;
return
accessChain
.
base
;
// note that non-trivial swizzling is left pending...
// emit the access chain
StorageClass
storageClass
=
(
StorageClass
)
module
.
getStorageClass
(
getTypeId
(
accessChain
.
base
));
accessChain
.
instr
=
createAccessChain
(
storageClass
,
accessChain
.
base
,
accessChain
.
indexChain
);
return
accessChain
.
instr
;
}
// For a dynamic component selection of a swizzle.
//
// Turn the swizzle and dynamic component into just a dynamic component.
//
// Generates code.
void
Builder
::
remapDynamicSwizzle
()
{
// do we have a swizzle to remap a dynamic component through?
if
(
accessChain
.
component
!=
NoResult
&&
accessChain
.
swizzle
.
size
()
>
1
)
{
// build a vector of the swizzle for the component to map into
std
::
vector
<
Id
>
components
;
for
(
int
c
=
0
;
c
<
accessChain
.
swizzle
.
size
();
++
c
)
components
.
push_back
(
makeUintConstant
(
accessChain
.
swizzle
[
c
]));
Id
mapType
=
makeVectorType
(
makeUintType
(
32
),
(
int
)
accessChain
.
swizzle
.
size
());
Id
map
=
makeCompositeConstant
(
mapType
,
components
);
// use it
accessChain
.
component
=
createVectorExtractDynamic
(
map
,
makeUintType
(
32
),
accessChain
.
component
);
accessChain
.
swizzle
.
clear
();
}
}
}
// clear out swizzle if it is redundant, that is reselecting the same components
// clear out swizzle if it is redundant, that is reselecting the same components
...
@@ -2503,38 +2530,30 @@ void Builder::simplifyAccessChainSwizzle()
...
@@ -2503,38 +2530,30 @@ void Builder::simplifyAccessChainSwizzle()
// To the extent any swizzling can become part of the chain
// To the extent any swizzling can become part of the chain
// of accesses instead of a post operation, make it so.
// of accesses instead of a post operation, make it so.
// If 'dynamic' is true, include transferring
a non-static component index
,
// If 'dynamic' is true, include transferring
the dynamic component
,
// otherwise,
only transfer static indexes
.
// otherwise,
leave it pending
.
//
//
// Also, Boolean vectors are likely to be special. While
// Does not generate code. just updates the access chain.
// for external storage, they should only be integer types,
// function-local bool vectors could use sub-word indexing,
// so keep that as a separate Insert/Extract on a loaded vector.
void
Builder
::
transferAccessChainSwizzle
(
bool
dynamic
)
void
Builder
::
transferAccessChainSwizzle
(
bool
dynamic
)
{
{
// too complex?
if
(
accessChain
.
swizzle
.
size
()
>
1
)
return
;
// non existent?
// non existent?
if
(
accessChain
.
swizzle
.
size
()
==
0
&&
accessChain
.
component
==
NoResult
)
if
(
accessChain
.
swizzle
.
size
()
==
0
&&
accessChain
.
component
==
NoResult
)
return
;
return
;
// single component...
// too complex?
// (this requires either a swizzle, or generating code for a dynamic component)
// skip doing it for Boolean vectors
if
(
accessChain
.
swizzle
.
size
()
>
1
)
if
(
isBoolType
(
getContainedTypeId
(
accessChain
.
preSwizzleBaseType
)))
return
;
return
;
// single component, either in the swizzle and/or dynamic component
if
(
accessChain
.
swizzle
.
size
()
==
1
)
{
if
(
accessChain
.
swizzle
.
size
()
==
1
)
{
// handle static component
assert
(
accessChain
.
component
==
NoResult
);
// handle static component selection
accessChain
.
indexChain
.
push_back
(
makeUintConstant
(
accessChain
.
swizzle
.
front
()));
accessChain
.
indexChain
.
push_back
(
makeUintConstant
(
accessChain
.
swizzle
.
front
()));
accessChain
.
swizzle
.
clear
();
accessChain
.
swizzle
.
clear
();
// note, the only valid remaining dynamic access would be to this one
// component, so don't bother even looking at accessChain.component
accessChain
.
preSwizzleBaseType
=
NoType
;
accessChain
.
preSwizzleBaseType
=
NoType
;
accessChain
.
component
=
NoResult
;
}
else
if
(
dynamic
&&
accessChain
.
component
!=
NoResult
)
{
}
else
if
(
dynamic
&&
accessChain
.
component
!=
NoResult
)
{
assert
(
accessChain
.
swizzle
.
size
()
==
0
);
// handle dynamic component
// handle dynamic component
accessChain
.
indexChain
.
push_back
(
accessChain
.
component
);
accessChain
.
indexChain
.
push_back
(
accessChain
.
component
);
accessChain
.
preSwizzleBaseType
=
NoType
;
accessChain
.
preSwizzleBaseType
=
NoType
;
...
...
SPIRV/SpvBuilder.h
View file @
5c3eed54
...
@@ -533,12 +533,15 @@ public:
...
@@ -533,12 +533,15 @@ public:
// push new swizzle onto the end of any existing swizzle, merging into a single swizzle
// push new swizzle onto the end of any existing swizzle, merging into a single swizzle
void
accessChainPushSwizzle
(
std
::
vector
<
unsigned
>&
swizzle
,
Id
preSwizzleBaseType
);
void
accessChainPushSwizzle
(
std
::
vector
<
unsigned
>&
swizzle
,
Id
preSwizzleBaseType
);
// push a variable component selection onto the access chain; supporting only one, so unsided
// push a dynamic component selection onto the access chain, only applicable with a
// non-trivial swizzle or no swizzle
void
accessChainPushComponent
(
Id
component
,
Id
preSwizzleBaseType
)
void
accessChainPushComponent
(
Id
component
,
Id
preSwizzleBaseType
)
{
{
accessChain
.
component
=
component
;
if
(
accessChain
.
swizzle
.
size
()
!=
1
)
{
if
(
accessChain
.
preSwizzleBaseType
==
NoType
)
accessChain
.
component
=
component
;
accessChain
.
preSwizzleBaseType
=
preSwizzleBaseType
;
if
(
accessChain
.
preSwizzleBaseType
==
NoType
)
accessChain
.
preSwizzleBaseType
=
preSwizzleBaseType
;
}
}
}
// use accessChain and swizzle to store value
// use accessChain and swizzle to store value
...
@@ -577,6 +580,7 @@ public:
...
@@ -577,6 +580,7 @@ public:
Id
findScalarConstant
(
Op
typeClass
,
Op
opcode
,
Id
typeId
,
unsigned
v1
,
unsigned
v2
)
const
;
Id
findScalarConstant
(
Op
typeClass
,
Op
opcode
,
Id
typeId
,
unsigned
v1
,
unsigned
v2
)
const
;
Id
findCompositeConstant
(
Op
typeClass
,
const
std
::
vector
<
Id
>&
comps
)
const
;
Id
findCompositeConstant
(
Op
typeClass
,
const
std
::
vector
<
Id
>&
comps
)
const
;
Id
collapseAccessChain
();
Id
collapseAccessChain
();
void
remapDynamicSwizzle
();
void
transferAccessChainSwizzle
(
bool
dynamic
);
void
transferAccessChainSwizzle
(
bool
dynamic
);
void
simplifyAccessChainSwizzle
();
void
simplifyAccessChainSwizzle
();
void
createAndSetNoPredecessorBlock
(
const
char
*
);
void
createAndSetNoPredecessorBlock
(
const
char
*
);
...
...
Test/baseResults/spv.400.frag.out
View file @
5c3eed54
...
@@ -1368,18 +1368,18 @@ spv.400.frag
...
@@ -1368,18 +1368,18 @@ spv.400.frag
997: 10(float) Select 995 996 21
997: 10(float) Select 995 996 21
998: 39(float) FConvert 997
998: 39(float) FConvert 997
999: 39(float) FAdd 994 998
999: 39(float) FAdd 994 998
1000:
437(bvec2) Load 439(bvec2v)
1000:
429(ptr) AccessChain 439(bvec2v) 33
1001: 428(bool)
CompositeExtract 1000
0
1001: 428(bool)
Load 100
0
1002: 10(float) Select 1001 996 21
1002: 10(float) Select 1001 996 21
1003: 39(float) FConvert 1002
1003: 39(float) FConvert 1002
1004: 39(float) FAdd 999 1003
1004: 39(float) FAdd 999 1003
1005:
446(bvec3) Load 448(bvec3v)
1005:
429(ptr) AccessChain 448(bvec3v) 33
1006: 428(bool)
CompositeExtract 1005 0
1006: 428(bool)
Load 1005
1007: 10(float) Select 1006 996 21
1007: 10(float) Select 1006 996 21
1008: 39(float) FConvert 1007
1008: 39(float) FConvert 1007
1009: 39(float) FAdd 1004 1008
1009: 39(float) FAdd 1004 1008
1010:
455(bvec4) Load 457(bvec4v)
1010:
429(ptr) AccessChain 457(bvec4v) 33
1011: 428(bool)
CompositeExtract 1010
0
1011: 428(bool)
Load 101
0
1012: 10(float) Select 1011 996 21
1012: 10(float) Select 1011 996 21
1013: 39(float) FConvert 1012
1013: 39(float) FConvert 1012
1014: 39(float) FAdd 1009 1013
1014: 39(float) FAdd 1009 1013
...
...
Test/baseResults/spv.accessChain.frag.out
View file @
5c3eed54
spv.accessChain.frag
spv.accessChain.frag
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80003
// Generated by (magic number): 80003
// Id's are bound by 2
06
// Id's are bound by 2
22
Capability Shader
Capability Shader
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 6
5 158
EntryPoint Fragment 4 "main" 6
9 170
ExecutionMode 4 OriginUpperLeft
ExecutionMode 4 OriginUpperLeft
Source GLSL 420
Source GLSL 420
Name 4 "main"
Name 4 "main"
...
@@ -50,12 +50,12 @@ spv.accessChain.frag
...
@@ -50,12 +50,12 @@ spv.accessChain.frag
Name 62 "GetColor13(struct-S-vf31;i1;"
Name 62 "GetColor13(struct-S-vf31;i1;"
Name 60 "i"
Name 60 "i"
Name 61 "comp"
Name 61 "comp"
Name 6
5 "OutColor
"
Name 6
6 "GetColor14(struct-S-vf31;i1;
"
Name
153 "s
"
Name
64 "i
"
Name
158 "u
"
Name
65 "comp
"
Name
159 "param
"
Name
69 "OutColor
"
Name 16
3 "param
"
Name 16
5 "s
"
Name 1
67 "param
"
Name 1
70 "u
"
Name 171 "param"
Name 171 "param"
Name 175 "param"
Name 175 "param"
Name 179 "param"
Name 179 "param"
...
@@ -65,8 +65,12 @@ spv.accessChain.frag
...
@@ -65,8 +65,12 @@ spv.accessChain.frag
Name 195 "param"
Name 195 "param"
Name 199 "param"
Name 199 "param"
Name 203 "param"
Name 203 "param"
Decorate 65(OutColor) Location 0
Name 207 "param"
Decorate 158(u) Flat
Name 211 "param"
Name 215 "param"
Name 219 "param"
Decorate 69(OutColor) Location 0
Decorate 170(u) Flat
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeFloat 32
6: TypeFloat 32
...
@@ -76,25 +80,27 @@ spv.accessChain.frag
...
@@ -76,25 +80,27 @@ spv.accessChain.frag
13: TypeInt 32 1
13: TypeInt 32 1
14: TypePointer Function 13(int)
14: TypePointer Function 13(int)
15: TypeFunction 2 8(S) 14(ptr)
15: TypeFunction 2 8(S) 14(ptr)
64: TypePointer Output 7(fvec3)
68: TypePointer Output 7(fvec3)
65(OutColor): 64(ptr) Variable Output
69(OutColor): 68(ptr) Variable Output
66: 13(int) Constant 0
70: 13(int) Constant 0
67: TypeInt 32 0
71: TypeInt 32 0
68: 67(int) Constant 0
72: 71(int) Constant 0
95: TypeVector 6(float) 2
99: TypeVector 6(float) 2
109: 67(int) Constant 2
113: 71(int) Constant 2
136: TypePointer Output 6(float)
140: TypePointer Output 6(float)
150: 6(float) Constant 0
147: 71(int) Constant 1
151: 7(fvec3) ConstantComposite 150 150 150
148: TypeVector 71(int) 2
152: TypePointer Function 8(S)
149: 148(ivec2) ConstantComposite 113 147
157: TypePointer Input 13(int)
158: TypeVector 71(int) 3
158(u): 157(ptr) Variable Input
159: 158(ivec3) ConstantComposite 113 147 72
162: 6(float) Constant 0
163: 7(fvec3) ConstantComposite 162 162 162
164: TypePointer Function 8(S)
169: TypePointer Input 13(int)
170(u): 169(ptr) Variable Input
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
153(s): 152(ptr) Variable Function
165(s): 164(ptr) Variable Function
159(param): 14(ptr) Variable Function
163(param): 14(ptr) Variable Function
167(param): 14(ptr) Variable Function
171(param): 14(ptr) Variable Function
171(param): 14(ptr) Variable Function
175(param): 14(ptr) Variable Function
175(param): 14(ptr) Variable Function
179(param): 14(ptr) Variable Function
179(param): 14(ptr) Variable Function
...
@@ -104,224 +110,242 @@ spv.accessChain.frag
...
@@ -104,224 +110,242 @@ spv.accessChain.frag
195(param): 14(ptr) Variable Function
195(param): 14(ptr) Variable Function
199(param): 14(ptr) Variable Function
199(param): 14(ptr) Variable Function
203(param): 14(ptr) Variable Function
203(param): 14(ptr) Variable Function
Store 65(OutColor) 151
207(param): 14(ptr) Variable Function
154: 8(S) Load 153(s)
211(param): 14(ptr) Variable Function
155: 2 FunctionCall 11(GetColor1(struct-S-vf31;) 154
215(param): 14(ptr) Variable Function
156: 8(S) Load 153(s)
219(param): 14(ptr) Variable Function
160: 13(int) Load 158(u)
Store 69(OutColor) 163
Store 159(param) 160
166: 8(S) Load 165(s)
161: 2 FunctionCall 18(GetColor2(struct-S-vf31;i1;) 156 159(param)
167: 2 FunctionCall 11(GetColor1(struct-S-vf31;) 166
162: 8(S) Load 153(s)
168: 8(S) Load 165(s)
164: 13(int) Load 158(u)
172: 13(int) Load 170(u)
Store 163(param) 164
165: 2 FunctionCall 22(GetColor3(struct-S-vf31;i1;) 162 163(param)
166: 8(S) Load 153(s)
168: 13(int) Load 158(u)
Store 167(param) 168
169: 2 FunctionCall 26(GetColor4(struct-S-vf31;i1;) 166 167(param)
170: 8(S) Load 153(s)
172: 13(int) Load 158(u)
Store 171(param) 172
Store 171(param) 172
173: 2 FunctionCall
30(GetColor5(struct-S-vf31;i1;) 170
171(param)
173: 2 FunctionCall
18(GetColor2(struct-S-vf31;i1;) 168
171(param)
174: 8(S) Load 1
53
(s)
174: 8(S) Load 1
65
(s)
176: 13(int) Load 1
58
(u)
176: 13(int) Load 1
70
(u)
Store 175(param) 176
Store 175(param) 176
177: 2 FunctionCall
34(GetColor6
(struct-S-vf31;i1;) 174 175(param)
177: 2 FunctionCall
22(GetColor3
(struct-S-vf31;i1;) 174 175(param)
178: 8(S) Load 1
53
(s)
178: 8(S) Load 1
65
(s)
180: 13(int) Load 1
58
(u)
180: 13(int) Load 1
70
(u)
Store 179(param) 180
Store 179(param) 180
181: 2 FunctionCall
38(GetColor7
(struct-S-vf31;i1;) 178 179(param)
181: 2 FunctionCall
26(GetColor4
(struct-S-vf31;i1;) 178 179(param)
182: 8(S) Load 1
53
(s)
182: 8(S) Load 1
65
(s)
184: 13(int) Load 1
58
(u)
184: 13(int) Load 1
70
(u)
Store 183(param) 184
Store 183(param) 184
185: 2 FunctionCall
42(GetColor8
(struct-S-vf31;i1;) 182 183(param)
185: 2 FunctionCall
30(GetColor5
(struct-S-vf31;i1;) 182 183(param)
186: 8(S) Load 1
53
(s)
186: 8(S) Load 1
65
(s)
188: 13(int) Load 1
58
(u)
188: 13(int) Load 1
70
(u)
Store 187(param) 188
Store 187(param) 188
189: 2 FunctionCall
46(GetColor9
(struct-S-vf31;i1;) 186 187(param)
189: 2 FunctionCall
34(GetColor6
(struct-S-vf31;i1;) 186 187(param)
190: 8(S) Load 1
53
(s)
190: 8(S) Load 1
65
(s)
192: 13(int) Load 1
58
(u)
192: 13(int) Load 1
70
(u)
Store 191(param) 192
Store 191(param) 192
193: 2 FunctionCall
50(GetColor10
(struct-S-vf31;i1;) 190 191(param)
193: 2 FunctionCall
38(GetColor7
(struct-S-vf31;i1;) 190 191(param)
194: 8(S) Load 1
53
(s)
194: 8(S) Load 1
65
(s)
196: 13(int) Load 1
58
(u)
196: 13(int) Load 1
70
(u)
Store 195(param) 196
Store 195(param) 196
197: 2 FunctionCall
54(GetColor11
(struct-S-vf31;i1;) 194 195(param)
197: 2 FunctionCall
42(GetColor8
(struct-S-vf31;i1;) 194 195(param)
198: 8(S) Load 1
53
(s)
198: 8(S) Load 1
65
(s)
200: 13(int) Load 1
58
(u)
200: 13(int) Load 1
70
(u)
Store 199(param) 200
Store 199(param) 200
201: 2 FunctionCall
58(GetColor12
(struct-S-vf31;i1;) 198 199(param)
201: 2 FunctionCall
46(GetColor9
(struct-S-vf31;i1;) 198 199(param)
202: 8(S) Load 1
53
(s)
202: 8(S) Load 1
65
(s)
204: 13(int) Load 1
58
(u)
204: 13(int) Load 1
70
(u)
Store 203(param) 204
Store 203(param) 204
205: 2 FunctionCall 62(GetColor13(struct-S-vf31;i1;) 202 203(param)
205: 2 FunctionCall 50(GetColor10(struct-S-vf31;i1;) 202 203(param)
206: 8(S) Load 165(s)
208: 13(int) Load 170(u)
Store 207(param) 208
209: 2 FunctionCall 54(GetColor11(struct-S-vf31;i1;) 206 207(param)
210: 8(S) Load 165(s)
212: 13(int) Load 170(u)
Store 211(param) 212
213: 2 FunctionCall 58(GetColor12(struct-S-vf31;i1;) 210 211(param)
214: 8(S) Load 165(s)
216: 13(int) Load 170(u)
Store 215(param) 216
217: 2 FunctionCall 62(GetColor13(struct-S-vf31;i1;) 214 215(param)
218: 8(S) Load 165(s)
220: 13(int) Load 170(u)
Store 219(param) 220
221: 2 FunctionCall 66(GetColor14(struct-S-vf31;i1;) 218 219(param)
Return
Return
FunctionEnd
FunctionEnd
11(GetColor1(struct-S-vf31;): 2 Function None 9
11(GetColor1(struct-S-vf31;): 2 Function None 9
10(i): 8(S) FunctionParameter
10(i): 8(S) FunctionParameter
12: Label
12: Label
69
: 6(float) CompositeExtract 10(i) 0 0
73
: 6(float) CompositeExtract 10(i) 0 0
7
0: 7(fvec3) Load 65
(OutColor)
7
4: 7(fvec3) Load 69
(OutColor)
7
1: 7(fvec3) CompositeConstruct 69 69 69
7
5: 7(fvec3) CompositeConstruct 73 73 73
7
2: 7(fvec3) FAdd 70 71
7
6: 7(fvec3) FAdd 74 75
Store 6
5(OutColor) 72
Store 6
9(OutColor) 76
Return
Return
FunctionEnd
FunctionEnd
18(GetColor2(struct-S-vf31;i1;): 2 Function None 15
18(GetColor2(struct-S-vf31;i1;): 2 Function None 15
16(i): 8(S) FunctionParameter
16(i): 8(S) FunctionParameter
17(comp): 14(ptr) FunctionParameter
17(comp): 14(ptr) FunctionParameter
19: Label
19: Label
7
3
: 13(int) Load 17(comp)
7
7
: 13(int) Load 17(comp)
7
4
: 7(fvec3) CompositeExtract 16(i) 0
7
8
: 7(fvec3) CompositeExtract 16(i) 0
7
5: 6(float) VectorExtractDynamic 74 73
7
9: 6(float) VectorExtractDynamic 78 77
76: 7(fvec3) Load 65
(OutColor)
80: 7(fvec3) Load 69
(OutColor)
77: 7(fvec3) CompositeConstruct 75 75 75
81: 7(fvec3) CompositeConstruct 79 79 79
78: 7(fvec3) FAdd 76 77
82: 7(fvec3) FAdd 80 81
Store 6
5(OutColor) 78
Store 6
9(OutColor) 82
Return
Return
FunctionEnd
FunctionEnd
22(GetColor3(struct-S-vf31;i1;): 2 Function None 15
22(GetColor3(struct-S-vf31;i1;): 2 Function None 15
20(i): 8(S) FunctionParameter
20(i): 8(S) FunctionParameter
21(comp): 14(ptr) FunctionParameter
21(comp): 14(ptr) FunctionParameter
23: Label
23: Label
79
: 13(int) Load 21(comp)
83
: 13(int) Load 21(comp)
8
0
: 7(fvec3) CompositeExtract 20(i) 0
8
4
: 7(fvec3) CompositeExtract 20(i) 0
8
1: 6(float) VectorExtractDynamic 80 79
8
5: 6(float) VectorExtractDynamic 84 83
8
2: 7(fvec3) Load 65
(OutColor)
8
6: 7(fvec3) Load 69
(OutColor)
8
3: 7(fvec3) CompositeConstruct 81 81 81
8
7: 7(fvec3) CompositeConstruct 85 85 85
8
4: 7(fvec3) FAdd 82 83
8
8: 7(fvec3) FAdd 86 87
Store 6
5(OutColor) 84
Store 6
9(OutColor) 88
Return
Return
FunctionEnd
FunctionEnd
26(GetColor4(struct-S-vf31;i1;): 2 Function None 15
26(GetColor4(struct-S-vf31;i1;): 2 Function None 15
24(i): 8(S) FunctionParameter
24(i): 8(S) FunctionParameter
25(comp): 14(ptr) FunctionParameter
25(comp): 14(ptr) FunctionParameter
27: Label
27: Label
8
5
: 13(int) Load 25(comp)
8
9
: 13(int) Load 25(comp)
86
: 7(fvec3) CompositeExtract 24(i) 0
90
: 7(fvec3) CompositeExtract 24(i) 0
87: 6(float) VectorExtractDynamic 86 85
91: 6(float) VectorExtractDynamic 90 89
88: 7(fvec3) Load 65
(OutColor)
92: 7(fvec3) Load 69
(OutColor)
89: 7(fvec3) CompositeConstruct 87 87 87
93: 7(fvec3) CompositeConstruct 91 91 91
9
0: 7(fvec3) FAdd 88 89
9
4: 7(fvec3) FAdd 92 93
Store 6
5(OutColor) 90
Store 6
9(OutColor) 94
Return
Return
FunctionEnd
FunctionEnd
30(GetColor5(struct-S-vf31;i1;): 2 Function None 15
30(GetColor5(struct-S-vf31;i1;): 2 Function None 15
28(i): 8(S) FunctionParameter
28(i): 8(S) FunctionParameter
29(comp): 14(ptr) FunctionParameter
29(comp): 14(ptr) FunctionParameter
31: Label
31: Label
9
1
: 7(fvec3) CompositeExtract 28(i) 0
9
5
: 7(fvec3) CompositeExtract 28(i) 0
9
2: 7(fvec3) Load 65
(OutColor)
9
6: 7(fvec3) Load 69
(OutColor)
9
3: 7(fvec3) FAdd 92 91
9
7: 7(fvec3) FAdd 96 95
Store 6
5(OutColor) 93
Store 6
9(OutColor) 97
Return
Return
FunctionEnd
FunctionEnd
34(GetColor6(struct-S-vf31;i1;): 2 Function None 15
34(GetColor6(struct-S-vf31;i1;): 2 Function None 15
32(i): 8(S) FunctionParameter
32(i): 8(S) FunctionParameter
33(comp): 14(ptr) FunctionParameter
33(comp): 14(ptr) FunctionParameter
35: Label
35: Label
9
4
: 13(int) Load 33(comp)
9
8
: 13(int) Load 33(comp)
96
: 7(fvec3) CompositeExtract 32(i) 0
100
: 7(fvec3) CompositeExtract 32(i) 0
97: 95(fvec2) VectorShuffle 96 96
1 0
101: 99(fvec2) VectorShuffle 100 100
1 0
98: 6(float) VectorExtractDynamic 97 94
102: 6(float) VectorExtractDynamic 101 98
99: 7(fvec3) Load 65
(OutColor)
103: 7(fvec3) Load 69
(OutColor)
10
0: 7(fvec3) CompositeConstruct 98 98 98
10
4: 7(fvec3) CompositeConstruct 102 102 102
10
1: 7(fvec3) FAdd 99 100
10
5: 7(fvec3) FAdd 103 104
Store 6
5(OutColor) 101
Store 6
9(OutColor) 105
Return
Return
FunctionEnd
FunctionEnd
38(GetColor7(struct-S-vf31;i1;): 2 Function None 15
38(GetColor7(struct-S-vf31;i1;): 2 Function None 15
36(i): 8(S) FunctionParameter
36(i): 8(S) FunctionParameter
37(comp): 14(ptr) FunctionParameter
37(comp): 14(ptr) FunctionParameter
39: Label
39: Label
10
2
: 7(fvec3) CompositeExtract 36(i) 0
10
6
: 7(fvec3) CompositeExtract 36(i) 0
10
3: 95(fvec2) VectorShuffle 102 102
0 1
10
7: 99(fvec2) VectorShuffle 106 106
0 1
10
4: 7(fvec3) Load 65
(OutColor)
10
8: 7(fvec3) Load 69
(OutColor)
10
5: 95(fvec2) VectorShuffle 104 104
0 1
10
9: 99(fvec2) VectorShuffle 108 108
0 1
1
06: 95(fvec2) FAdd 105 103
1
10: 99(fvec2) FAdd 109 107
1
07: 7(fvec3) Load 65
(OutColor)
1
11: 7(fvec3) Load 69
(OutColor)
1
08: 7(fvec3) VectorShuffle 107 106
3 4 2
1
12: 7(fvec3) VectorShuffle 111 110
3 4 2
Store 6
5(OutColor) 108
Store 6
9(OutColor) 112
Return
Return
FunctionEnd
FunctionEnd
42(GetColor8(struct-S-vf31;i1;): 2 Function None 15
42(GetColor8(struct-S-vf31;i1;): 2 Function None 15
40(i): 8(S) FunctionParameter
40(i): 8(S) FunctionParameter
41(comp): 14(ptr) FunctionParameter
41(comp): 14(ptr) FunctionParameter
43: Label
43: Label
11
0
: 6(float) CompositeExtract 40(i) 0 2
11
4
: 6(float) CompositeExtract 40(i) 0 2
11
1: 7(fvec3) Load 65
(OutColor)
11
5: 7(fvec3) Load 69
(OutColor)
11
2: 7(fvec3) CompositeConstruct 110 110 110
11
6: 7(fvec3) CompositeConstruct 114 114 114
11
3: 7(fvec3) FAdd 111 112
11
7: 7(fvec3) FAdd 115 116
Store 6
5(OutColor) 113
Store 6
9(OutColor) 117
Return
Return
FunctionEnd
FunctionEnd
46(GetColor9(struct-S-vf31;i1;): 2 Function None 15
46(GetColor9(struct-S-vf31;i1;): 2 Function None 15
44(i): 8(S) FunctionParameter
44(i): 8(S) FunctionParameter
45(comp): 14(ptr) FunctionParameter
45(comp): 14(ptr) FunctionParameter
47: Label
47: Label
11
4
: 7(fvec3) CompositeExtract 44(i) 0
11
8
: 7(fvec3) CompositeExtract 44(i) 0
11
5: 7(fvec3) Load 65
(OutColor)
11
9: 7(fvec3) Load 69
(OutColor)
1
16: 7(fvec3) VectorShuffle 115 115
2 0 1
1
20: 7(fvec3) VectorShuffle 119 119
2 0 1
1
17: 7(fvec3) FAdd 116 114
1
21: 7(fvec3) FAdd 120 118
1
18: 7(fvec3) Load 65
(OutColor)
1
22: 7(fvec3) Load 69
(OutColor)
1
19: 7(fvec3) VectorShuffle 118 117
4 5 3
1
23: 7(fvec3) VectorShuffle 122 121
4 5 3
Store 6
5(OutColor) 119
Store 6
9(OutColor) 123
Return
Return
FunctionEnd
FunctionEnd
50(GetColor10(struct-S-vf31;i1;): 2 Function None 15
50(GetColor10(struct-S-vf31;i1;): 2 Function None 15
48(i): 8(S) FunctionParameter
48(i): 8(S) FunctionParameter
49(comp): 14(ptr) FunctionParameter
49(comp): 14(ptr) FunctionParameter
51: Label
51: Label
12
0
: 7(fvec3) CompositeExtract 48(i) 0
12
4
: 7(fvec3) CompositeExtract 48(i) 0
12
1: 95(fvec2) VectorShuffle 120 120
0 1
12
5: 99(fvec2) VectorShuffle 124 124
0 1
12
2: 7(fvec3) Load 65
(OutColor)
12
6: 7(fvec3) Load 69
(OutColor)
12
3: 95(fvec2) VectorShuffle 122 122
2 1
12
7: 99(fvec2) VectorShuffle 126 126
2 1
12
4: 95(fvec2) FAdd 123 121
12
8: 99(fvec2) FAdd 127 125
12
5: 7(fvec3) Load 65
(OutColor)
12
9: 7(fvec3) Load 69
(OutColor)
1
26: 7(fvec3) VectorShuffle 125 124
0 4 3
1
30: 7(fvec3) VectorShuffle 129 128
0 4 3
Store 6
5(OutColor) 126
Store 6
9(OutColor) 130
Return
Return
FunctionEnd
FunctionEnd
54(GetColor11(struct-S-vf31;i1;): 2 Function None 15
54(GetColor11(struct-S-vf31;i1;): 2 Function None 15
52(i): 8(S) FunctionParameter
52(i): 8(S) FunctionParameter
53(comp): 14(ptr) FunctionParameter
53(comp): 14(ptr) FunctionParameter
55: Label
55: Label
1
27
: 7(fvec3) CompositeExtract 52(i) 0
1
31
: 7(fvec3) CompositeExtract 52(i) 0
1
28: 95(fvec2) VectorShuffle 127 127
0 1
1
32: 99(fvec2) VectorShuffle 131 131
0 1
1
29: 7(fvec3) Load 65
(OutColor)
1
33: 7(fvec3) Load 69
(OutColor)
13
0: 95(fvec2) VectorShuffle 129 129
0 2
13
4: 99(fvec2) VectorShuffle 133 133
0 2
13
1: 95(fvec2) FAdd 130 128
13
5: 99(fvec2) FAdd 134 132
13
2: 7(fvec3) Load 65
(OutColor)
13
6: 7(fvec3) Load 69
(OutColor)
13
3: 7(fvec3) VectorShuffle 132 131
3 1 4
13
7: 7(fvec3) VectorShuffle 136 135
3 1 4
Store 6
5(OutColor) 133
Store 6
9(OutColor) 137
Return
Return
FunctionEnd
FunctionEnd
58(GetColor12(struct-S-vf31;i1;): 2 Function None 15
58(GetColor12(struct-S-vf31;i1;): 2 Function None 15
56(i): 8(S) FunctionParameter
56(i): 8(S) FunctionParameter
57(comp): 14(ptr) FunctionParameter
57(comp): 14(ptr) FunctionParameter
59: Label
59: Label
13
4
: 13(int) Load 57(comp)
13
8
: 13(int) Load 57(comp)
13
5
: 6(float) CompositeExtract 56(i) 0 0
13
9
: 6(float) CompositeExtract 56(i) 0 0
1
37: 136(ptr) AccessChain 65(OutColor) 134
1
41: 140(ptr) AccessChain 69(OutColor) 138
1
38: 6(float) Load 137
1
42: 6(float) Load 141
1
39: 6(float) FAdd 138 135
1
43: 6(float) FAdd 142 139
14
0: 136(ptr) AccessChain 65(OutColor) 134
14
4: 140(ptr) AccessChain 69(OutColor) 138
Store 14
0 139
Store 14
4 143
Return
Return
FunctionEnd
FunctionEnd
62(GetColor13(struct-S-vf31;i1;): 2 Function None 15
62(GetColor13(struct-S-vf31;i1;): 2 Function None 15
60(i): 8(S) FunctionParameter
60(i): 8(S) FunctionParameter
61(comp): 14(ptr) FunctionParameter
61(comp): 14(ptr) FunctionParameter
63: Label
63: Label
141: 13(int) Load 61(comp)
145: 13(int) Load 61(comp)
142: 6(float) CompositeExtract 60(i) 0 0
146: 6(float) CompositeExtract 60(i) 0 0
143: 7(fvec3) Load 65(OutColor)
150: 71(int) VectorExtractDynamic 149 145
144: 95(fvec2) VectorShuffle 143 143 2 1
151: 140(ptr) AccessChain 69(OutColor) 150
145: 6(float) VectorExtractDynamic 144 141
152: 6(float) Load 151
146: 6(float) FAdd 145 142
153: 6(float) FAdd 152 146
147: 7(fvec3) Load 65(OutColor)
154: 71(int) VectorExtractDynamic 149 145
148: 7(fvec3) VectorShuffle 147 147 2 1 2
155: 140(ptr) AccessChain 69(OutColor) 154
149: 7(fvec3) VectorInsertDynamic 148 146 141
Store 155 153
Store 65(OutColor) 149
Return
FunctionEnd
66(GetColor14(struct-S-vf31;i1;): 2 Function None 15
64(i): 8(S) FunctionParameter
65(comp): 14(ptr) FunctionParameter
67: Label
156: 13(int) Load 65(comp)
157: 6(float) CompositeExtract 64(i) 0 0
160: 71(int) VectorExtractDynamic 159 156
161: 140(ptr) AccessChain 69(OutColor) 160
Store 161 157
Return
Return
FunctionEnd
FunctionEnd
Test/baseResults/spv.boolInBlock.frag.out
View file @
5c3eed54
spv.boolInBlock.frag
spv.boolInBlock.frag
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80003
// Generated by (magic number): 80003
// Id's are bound by 10
7
// Id's are bound by 10
2
Capability Shader
Capability Shader
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 7
5
EntryPoint Fragment 4 "main" 7
4
ExecutionMode 4 OriginUpperLeft
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
Source GLSL 450
Name 4 "main"
Name 4 "main"
...
@@ -14,24 +14,24 @@ spv.boolInBlock.frag
...
@@ -14,24 +14,24 @@ spv.boolInBlock.frag
Name 12 "paramb4"
Name 12 "paramb4"
Name 13 "paramb2"
Name 13 "paramb2"
Name 17 "b1"
Name 17 "b1"
Name 2
4
"Buffer"
Name 2
5
"Buffer"
MemberName 2
4
(Buffer) 0 "b2"
MemberName 2
5
(Buffer) 0 "b2"
Name 2
6
""
Name 2
7
""
Name
39
"Uniform"
Name
40
"Uniform"
MemberName
39
(Uniform) 0 "b4"
MemberName
40
(Uniform) 0 "b4"
Name 4
1
""
Name 4
2
""
Name 6
2
"param"
Name 6
0
"param"
Name 6
7
"param"
Name 6
6
"param"
Name 7
5
"fragColor"
Name 7
4
"fragColor"
MemberDecorate 2
4
(Buffer) 0 Offset 0
MemberDecorate 2
5
(Buffer) 0 Offset 0
Decorate 2
4
(Buffer) BufferBlock
Decorate 2
5
(Buffer) BufferBlock
Decorate 2
6
DescriptorSet 0
Decorate 2
7
DescriptorSet 0
Decorate 2
6
Binding 1
Decorate 2
7
Binding 1
MemberDecorate
39
(Uniform) 0 Offset 0
MemberDecorate
40
(Uniform) 0 Offset 0
Decorate
39
(Uniform) Block
Decorate
40
(Uniform) Block
Decorate 4
1
DescriptorSet 0
Decorate 4
2
DescriptorSet 0
Decorate 4
1
Binding 0
Decorate 4
2
Binding 0
Decorate 7
5
(fragColor) Location 0
Decorate 7
4
(fragColor) Location 0
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeBool
6: TypeBool
...
@@ -41,111 +41,106 @@ spv.boolInBlock.frag
...
@@ -41,111 +41,106 @@ spv.boolInBlock.frag
10: TypePointer Function 9(bvec2)
10: TypePointer Function 9(bvec2)
11: TypeFunction 2 8(ptr) 10(ptr)
11: TypeFunction 2 8(ptr) 10(ptr)
16: TypePointer Function 6(bool)
16: TypePointer Function 6(bool)
22: TypeInt 32 0
18: TypeInt 32 0
23: TypeVector 22(int) 2
19: 18(int) Constant 2
24(Buffer): TypeStruct 23(ivec2)
24: TypeVector 18(int) 2
25: TypePointer Uniform 24(Buffer)
25(Buffer): TypeStruct 24(ivec2)
26: 25(ptr) Variable Uniform
26: TypePointer Uniform 25(Buffer)
27: TypeInt 32 1
27: 26(ptr) Variable Uniform
28: 27(int) Constant 0
28: TypeInt 32 1
29: 6(bool) ConstantFalse
29: 28(int) Constant 0
30: 9(bvec2) ConstantComposite 29 29
30: 6(bool) ConstantFalse
31: 22(int) Constant 1
31: 9(bvec2) ConstantComposite 30 30
32: 23(ivec2) ConstantComposite 31 31
32: 18(int) Constant 1
33: 22(int) Constant 0
33: 24(ivec2) ConstantComposite 32 32
34: 23(ivec2) ConstantComposite 33 33
34: 18(int) Constant 0
36: TypePointer Uniform 23(ivec2)
35: 24(ivec2) ConstantComposite 34 34
38: TypeVector 22(int) 4
37: TypePointer Uniform 24(ivec2)
39(Uniform): TypeStruct 38(ivec4)
39: TypeVector 18(int) 4
40: TypePointer Uniform 39(Uniform)
40(Uniform): TypeStruct 39(ivec4)
41: 40(ptr) Variable Uniform
41: TypePointer Uniform 40(Uniform)
42: TypePointer Uniform 38(ivec4)
42: 41(ptr) Variable Uniform
65: 38(ivec4) ConstantComposite 33 33 33 33
43: TypePointer Uniform 18(int)
72: TypeFloat 32
61: TypePointer Uniform 39(ivec4)
73: TypeVector 72(float) 4
64: 39(ivec4) ConstantComposite 34 34 34 34
74: TypePointer Output 73(fvec4)
71: TypeFloat 32
75(fragColor): 74(ptr) Variable Output
72: TypeVector 71(float) 4
87: 72(float) Constant 0
73: TypePointer Output 72(fvec4)
88: 72(float) Constant 1065353216
74(fragColor): 73(ptr) Variable Output
84: 71(float) Constant 0
85: 71(float) Constant 1065353216
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
62(param): 8(ptr) Variable Function
60(param): 8(ptr) Variable Function
67(param): 10(ptr) Variable Function
66(param): 10(ptr) Variable Function
35: 23(ivec2) Select 30 32 34
36: 24(ivec2) Select 31 33 35
37: 36(ptr) AccessChain 26 28
38: 37(ptr) AccessChain 27 29
Store 37 35
Store 38 36
43: 42(ptr) AccessChain 41 28
44: 43(ptr) AccessChain 42 29 19
44: 38(ivec4) Load 43
45: 18(int) Load 44
45: 22(int) CompositeExtract 44 2
46: 6(bool) INotEqual 45 34
46: 6(bool) INotEqual 45 33
SelectionMerge 48 None
SelectionMerge 48 None
BranchConditional 46 47 48
BranchConditional 46 47 48
47: Label
47: Label
49: 42(ptr) AccessChain 41 28
49: 43(ptr) AccessChain 42 29 34
50: 38(ivec4) Load 49
50: 18(int) Load 49
51: 22(int) CompositeExtract 50 0
51: 6(bool) INotEqual 50 34
52: 6(bool) INotEqual 51 33
52: 9(bvec2) CompositeConstruct 51 51
53: 9(bvec2) CompositeConstruct 52 52
53: 24(ivec2) Select 52 33 35
54: 23(ivec2) Select 53 32 34
54: 37(ptr) AccessChain 27 29
55: 36(ptr) AccessChain 26 28
Store 54 53
Store 55 54
Branch 48
Branch 48
48: Label
48: Label
56: 36(ptr) AccessChain 26 28
55: 43(ptr) AccessChain 27 29 34
57: 23(ivec2) Load 56
56: 18(int) Load 55
58: 22(int) CompositeExtract 57 0
57: 6(bool) INotEqual 56 34
59: 6(bool) INotEqual 58 33
SelectionMerge 59 None
SelectionMerge 61 None
BranchConditional 57 58 59
BranchConditional 59 60 61
58: Label
60: Label
62: 61(ptr) AccessChain 42 29
63: 42(ptr) AccessChain 41 28
63: 39(ivec4) Load 62
64: 38(ivec4) Load 63
65: 7(bvec4) INotEqual 63 64
66: 7(bvec4) INotEqual 64 65
Store 60(param) 65
Store 62(param) 66
67: 2 FunctionCall 14(foo(vb4;vb2;) 60(param) 66(param)
68: 2 FunctionCall 14(foo(vb4;vb2;) 62(param) 67(param)
68: 9(bvec2) Load 66(param)
69: 9(bvec2) Load 67(param)
69: 24(ivec2) Select 68 33 35
70: 23(ivec2) Select 69 32 34
70: 37(ptr) AccessChain 27 29
71: 36(ptr) AccessChain 26 28
Store 70 69
Store 71 70
Branch 59
Branch 61
59: Label
61: Label
75: 43(ptr) AccessChain 42 29 34
76: 42(ptr) AccessChain 41 28
76: 18(int) Load 75
77: 38(ivec4) Load 76
77: 6(bool) INotEqual 76 34
78: 22(int) CompositeExtract 77 0
SelectionMerge 79 None
79: 6(bool) INotEqual 78 33
BranchConditional 77 78 79
SelectionMerge 81 None
78: Label
BranchConditional 79 80 81
80: 43(ptr) AccessChain 42 29 32
80: Label
81: 18(int) Load 80
82: 42(ptr) AccessChain 41 28
82: 6(bool) INotEqual 81 34
83: 38(ivec4) Load 82
Branch 79
84: 22(int) CompositeExtract 83 1
79: Label
85: 6(bool) INotEqual 84 33
83: 6(bool) Phi 77 59 82 78
Branch 81
86: 71(float) Select 83 85 84
81: Label
87: 72(fvec4) CompositeConstruct 86 86 86 86
86: 6(bool) Phi 79 61 85 80
Store 74(fragColor) 87
89: 72(float) Select 86 88 87
88: 43(ptr) AccessChain 42 29 34
90: 73(fvec4) CompositeConstruct 89 89 89 89
89: 18(int) Load 88
Store 75(fragColor) 90
90: 6(bool) INotEqual 89 34
91: 42(ptr) AccessChain 41 28
91: 6(bool) LogicalNot 90
92: 38(ivec4) Load 91
SelectionMerge 93 None
93: 22(int) CompositeExtract 92 0
BranchConditional 91 92 93
94: 6(bool) INotEqual 93 33
92: Label
95: 6(bool) LogicalNot 94
94: 43(ptr) AccessChain 42 29 32
SelectionMerge 97 None
95: 18(int) Load 94
BranchConditional 95 96 97
96: 6(bool) INotEqual 95 34
96: Label
Branch 93
98: 42(ptr) AccessChain 41 28
93: Label
99: 38(ivec4) Load 98
97: 6(bool) Phi 90 79 96 92
100: 22(int) CompositeExtract 99 1
98: 71(float) Select 97 85 84
101: 6(bool) INotEqual 100 33
99: 72(fvec4) CompositeConstruct 98 98 98 98
Branch 97
100: 72(fvec4) Load 74(fragColor)
97: Label
101: 72(fvec4) FSub 100 99
102: 6(bool) Phi 94 81 101 96
Store 74(fragColor) 101
103: 72(float) Select 102 88 87
104: 73(fvec4) CompositeConstruct 103 103 103 103
105: 73(fvec4) Load 75(fragColor)
106: 73(fvec4) FSub 105 104
Store 75(fragColor) 106
Return
Return
FunctionEnd
FunctionEnd
14(foo(vb4;vb2;): 2 Function None 11
14(foo(vb4;vb2;): 2 Function None 11
...
@@ -153,11 +148,11 @@ spv.boolInBlock.frag
...
@@ -153,11 +148,11 @@ spv.boolInBlock.frag
13(paramb2): 10(ptr) FunctionParameter
13(paramb2): 10(ptr) FunctionParameter
15: Label
15: Label
17(b1): 16(ptr) Variable Function
17(b1): 16(ptr) Variable Function
18: 7(bvec4) Load 12(paramb4)
20: 16(ptr) AccessChain 12(paramb4) 19
19: 6(bool) CompositeExtract 18 2
21: 6(bool) Load 20
Store 17(b1)
19
Store 17(b1)
21
2
0
: 6(bool) Load 17(b1)
2
2
: 6(bool) Load 17(b1)
2
1: 9(bvec2) CompositeConstruct 20 20
2
3: 9(bvec2) CompositeConstruct 22 22
Store 13(paramb2) 2
1
Store 13(paramb2) 2
3
Return
Return
FunctionEnd
FunctionEnd
Test/baseResults/spv.conversion.frag.out
View file @
5c3eed54
...
@@ -119,8 +119,8 @@ spv.conversion.frag
...
@@ -119,8 +119,8 @@ spv.conversion.frag
315: 13(int) Constant 1
315: 13(int) Constant 1
321: TypePointer Output 95(fvec4)
321: TypePointer Output 95(fvec4)
322(gl_FragColor): 321(ptr) Variable Output
322(gl_FragColor): 321(ptr) Variable Output
3
6
7: 13(int) Constant 2
3
3
7: 13(int) Constant 2
3
8
0: 13(int) Constant 3
3
5
0: 13(int) Constant 3
427: TypePointer Private 6(bool)
427: TypePointer Private 6(bool)
428(u_b): 427(ptr) Variable Private
428(u_b): 427(ptr) Variable Private
429: TypePointer Private 23(bvec2)
429: TypePointer Private 23(bvec2)
...
@@ -440,8 +440,8 @@ spv.conversion.frag
...
@@ -440,8 +440,8 @@ spv.conversion.frag
Branch 300
Branch 300
300: Label
300: Label
306: 16(float) Load 297
306: 16(float) Load 297
308:
23(bvec2) Load 25(b2)
308:
7(ptr) AccessChain 25(b2) 14
309: 6(bool)
CompositeExtract 308 0
309: 6(bool)
Load 308
SelectionMerge 311 None
SelectionMerge 311 None
BranchConditional 309 310 314
BranchConditional 309 310 314
310: Label
310: Label
...
@@ -462,64 +462,64 @@ spv.conversion.frag
...
@@ -462,64 +462,64 @@ spv.conversion.frag
Branch 296
Branch 296
296: Label
296: Label
324: 6(bool) Load 8(b)
324: 6(bool) Load 8(b)
325:
23(bvec2) Load 25(b2)
325:
7(ptr) AccessChain 25(b2) 14
326: 6(bool)
CompositeExtract 325 0
326: 6(bool)
Load 325
327: 6(bool) LogicalOr 324 326
327: 6(bool) LogicalOr 324 326
328:
23(bvec2) Load 25(b2)
328:
7(ptr) AccessChain 25(b2) 315
329: 6(bool)
CompositeExtract 328 1
329: 6(bool)
Load 328
330: 6(bool) LogicalOr 327 329
330: 6(bool) LogicalOr 327 329
331:
31(bvec3) Load 33(b3)
331:
7(ptr) AccessChain 33(b3) 14
332: 6(bool)
CompositeExtract 331 0
332: 6(bool)
Load 331
333: 6(bool) LogicalOr 330 332
333: 6(bool) LogicalOr 330 332
334:
31(bvec3) Load 33(b3)
334:
7(ptr) AccessChain 33(b3) 315
335: 6(bool)
CompositeExtract 334 1
335: 6(bool)
Load 334
336: 6(bool) LogicalOr 333 335
336: 6(bool) LogicalOr 333 335
33
7: 31(bvec3) Load 33(b3)
33
8: 7(ptr) AccessChain 33(b3) 337
33
8: 6(bool) CompositeExtract 337 2
33
9: 6(bool) Load 338
3
39: 6(bool) LogicalOr 336 338
3
40: 6(bool) LogicalOr 336 339
34
0: 43(bvec4) Load 45(b4)
34
1: 7(ptr) AccessChain 45(b4) 14
34
1: 6(bool) CompositeExtract 340 0
34
2: 6(bool) Load 341
34
2: 6(bool) LogicalOr 339 341
34
3: 6(bool) LogicalOr 340 342
34
3: 43(bvec4) Load 45(b4)
34
4: 7(ptr) AccessChain 45(b4) 315
34
4: 6(bool) CompositeExtract 343 1
34
5: 6(bool) Load 344
34
5: 6(bool) LogicalOr 342 344
34
6: 6(bool) LogicalOr 343 345
34
6: 43(bvec4) Load 45(b4)
34
7: 7(ptr) AccessChain 45(b4) 337
34
7: 6(bool) CompositeExtract 346 2
34
8: 6(bool) Load 347
34
8: 6(bool) LogicalOr 345 347
34
9: 6(bool) LogicalOr 346 348
3
49: 43(bvec4) Load 45(b4)
3
51: 7(ptr) AccessChain 45(b4) 350
35
0: 6(bool) CompositeExtract 349 3
35
2: 6(bool) Load 351
35
1: 6(bool) LogicalOr 348 350
35
3: 6(bool) LogicalOr 349 352
SelectionMerge 35
3
None
SelectionMerge 35
5
None
BranchConditional 35
1 352
415
BranchConditional 35
3 354
415
35
2
: Label
35
4
: Label
35
4
: 9(int) Load 58(i)
35
6
: 9(int) Load 58(i)
35
5
: 57(ptr) AccessChain 68(i2) 14
35
7
: 57(ptr) AccessChain 68(i2) 14
35
6: 9(int) Load 355
35
8: 9(int) Load 357
35
7: 9(int) IAdd 354 356
35
9: 9(int) IAdd 356 358
3
58
: 57(ptr) AccessChain 68(i2) 315
3
60
: 57(ptr) AccessChain 68(i2) 315
3
59: 9(int) Load 358
3
61: 9(int) Load 360
36
0: 9(int) IAdd 357 359
36
2: 9(int) IAdd 359 361
36
1
: 57(ptr) AccessChain 81(i3) 14
36
3
: 57(ptr) AccessChain 81(i3) 14
36
2: 9(int) Load 361
36
4: 9(int) Load 363
36
3: 9(int) IAdd 360 362
36
5: 9(int) IAdd 362 364
36
4
: 57(ptr) AccessChain 81(i3) 315
36
6
: 57(ptr) AccessChain 81(i3) 315
36
5: 9(int) Load 364
36
7: 9(int) Load 366
36
6: 9(int) IAdd 363 365
36
8: 9(int) IAdd 365 367
36
8: 57(ptr) AccessChain 81(i3) 36
7
36
9: 57(ptr) AccessChain 81(i3) 33
7
3
69: 9(int) Load 368
3
70: 9(int) Load 369
37
0: 9(int) IAdd 366 369
37
1: 9(int) IAdd 368 370
37
1
: 57(ptr) AccessChain 94(i4) 14
37
2
: 57(ptr) AccessChain 94(i4) 14
37
2: 9(int) Load 371
37
3: 9(int) Load 372
37
3: 9(int) IAdd 370 372
37
4: 9(int) IAdd 371 373
37
4
: 57(ptr) AccessChain 94(i4) 315
37
5
: 57(ptr) AccessChain 94(i4) 315
37
5: 9(int) Load 374
37
6: 9(int) Load 375
37
6: 9(int) IAdd 373 375
37
7: 9(int) IAdd 374 376
37
7: 57(ptr) AccessChain 94(i4) 36
7
37
8: 57(ptr) AccessChain 94(i4) 33
7
37
8: 9(int) Load 377
37
9: 9(int) Load 378
3
79: 9(int) IAdd 376 378
3
80: 9(int) IAdd 377 379
381: 57(ptr) AccessChain 94(i4) 3
8
0
381: 57(ptr) AccessChain 94(i4) 3
5
0
382: 9(int) Load 381
382: 9(int) Load 381
383: 9(int) IAdd 3
79
382
383: 9(int) IAdd 3
80
382
384: 16(float) ConvertSToF 383
384: 16(float) ConvertSToF 383
385: 16(float) Load 106(f)
385: 16(float) Load 106(f)
386: 16(float) FAdd 384 385
386: 16(float) FAdd 384 385
...
@@ -535,7 +535,7 @@ spv.conversion.frag
...
@@ -535,7 +535,7 @@ spv.conversion.frag
396: 105(ptr) AccessChain 114(f3) 315
396: 105(ptr) AccessChain 114(f3) 315
397: 16(float) Load 396
397: 16(float) Load 396
398: 16(float) FAdd 395 397
398: 16(float) FAdd 395 397
399: 105(ptr) AccessChain 114(f3) 3
6
7
399: 105(ptr) AccessChain 114(f3) 3
3
7
400: 16(float) Load 399
400: 16(float) Load 399
401: 16(float) FAdd 398 400
401: 16(float) FAdd 398 400
402: 105(ptr) AccessChain 118(f4) 14
402: 105(ptr) AccessChain 118(f4) 14
...
@@ -544,19 +544,19 @@ spv.conversion.frag
...
@@ -544,19 +544,19 @@ spv.conversion.frag
405: 105(ptr) AccessChain 118(f4) 315
405: 105(ptr) AccessChain 118(f4) 315
406: 16(float) Load 405
406: 16(float) Load 405
407: 16(float) FAdd 404 406
407: 16(float) FAdd 404 406
408: 105(ptr) AccessChain 118(f4) 3
6
7
408: 105(ptr) AccessChain 118(f4) 3
3
7
409: 16(float) Load 408
409: 16(float) Load 408
410: 16(float) FAdd 407 409
410: 16(float) FAdd 407 409
411: 105(ptr) AccessChain 118(f4) 3
8
0
411: 105(ptr) AccessChain 118(f4) 3
5
0
412: 16(float) Load 411
412: 16(float) Load 411
413: 16(float) FAdd 410 412
413: 16(float) FAdd 410 412
414: 95(fvec4) CompositeConstruct 413 413 413 413
414: 95(fvec4) CompositeConstruct 413 413 413 413
Store 323 414
Store 323 414
Branch 35
3
Branch 35
5
415: Label
415: Label
Store 323 151
Store 323 151
Branch 35
3
Branch 35
5
35
3
: Label
35
5
: Label
416: 95(fvec4) Load 323
416: 95(fvec4) Load 323
Store 322(gl_FragColor) 416
Store 322(gl_FragColor) 416
Store 417(cv2) 102
Store 417(cv2) 102
...
...
Test/baseResults/spv.types.frag.out
View file @
5c3eed54
...
@@ -6,7 +6,7 @@ spv.types.frag
...
@@ -6,7 +6,7 @@ spv.types.frag
Capability Shader
Capability Shader
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 9
1 93 100 102 109 111 118 120 127 129 136 138 145 147 154 156 160
EntryPoint Fragment 4 "main" 9
6 98 105 107 114 116 123 125 132 134 141 143 150 152 159 161 165
ExecutionMode 4 OriginUpperLeft
ExecutionMode 4 OriginUpperLeft
Source GLSL 140
Source GLSL 140
Name 4 "main"
Name 4 "main"
...
@@ -15,47 +15,47 @@ spv.types.frag
...
@@ -15,47 +15,47 @@ spv.types.frag
Name 12 "i_b"
Name 12 "i_b"
Name 17 "b2"
Name 17 "b2"
Name 19 "u_b2"
Name 19 "u_b2"
Name 2
2
"i_b2"
Name 2
4
"i_b2"
Name 3
5
"b3"
Name 3
8
"b3"
Name
37
"u_b3"
Name
40
"u_b3"
Name 4
0
"i_b3"
Name 4
3
"i_b3"
Name
59
"b4"
Name
63
"b4"
Name 6
1
"u_b4"
Name 6
5
"u_b4"
Name 6
4
"i_b4"
Name 6
8
"i_b4"
Name
89
"i"
Name
94
"i"
Name 9
1
"u_i"
Name 9
6
"u_i"
Name 9
3
"i_i"
Name 9
8
"i_i"
Name
98
"i2"
Name
103
"i2"
Name 10
0
"u_i2"
Name 10
5
"u_i2"
Name 10
2
"i_i2"
Name 10
7
"i_i2"
Name 1
07
"i3"
Name 1
12
"i3"
Name 1
09
"u_i3"
Name 1
14
"u_i3"
Name 11
1
"i_i3"
Name 11
6
"i_i3"
Name 1
16
"i4"
Name 1
21
"i4"
Name 1
18
"u_i4"
Name 1
23
"u_i4"
Name 12
0
"i_i4"
Name 12
5
"i_i4"
Name 1
25
"f"
Name 1
30
"f"
Name 1
27
"u_f"
Name 1
32
"u_f"
Name 1
29
"i_f"
Name 1
34
"i_f"
Name 13
4
"f2"
Name 13
9
"f2"
Name 1
36
"u_f2"
Name 1
41
"u_f2"
Name 1
38
"i_f2"
Name 1
43
"i_f2"
Name 14
3
"f3"
Name 14
8
"f3"
Name 1
45
"u_f3"
Name 1
50
"u_f3"
Name 1
47
"i_f3"
Name 1
52
"i_f3"
Name 15
2
"f4"
Name 15
7
"f4"
Name 15
4
"u_f4"
Name 15
9
"u_f4"
Name 1
56
"i_f4"
Name 1
61
"i_f4"
Name 16
0
"gl_FragColor"
Name 16
5
"gl_FragColor"
Decorate 9
1
(u_i) Flat
Decorate 9
6
(u_i) Flat
Decorate 9
3
(i_i) Flat
Decorate 9
8
(i_i) Flat
Decorate 10
0
(u_i2) Flat
Decorate 10
5
(u_i2) Flat
Decorate 10
2
(i_i2) Flat
Decorate 10
7
(i_i2) Flat
Decorate 1
09
(u_i3) Flat
Decorate 1
14
(u_i3) Flat
Decorate 11
1
(i_i3) Flat
Decorate 11
6
(i_i3) Flat
Decorate 1
18
(u_i4) Flat
Decorate 1
23
(u_i4) Flat
Decorate 12
0
(i_i4) Flat
Decorate 12
5
(i_i4) Flat
Decorate 16
0
(gl_FragColor) Location 0
Decorate 16
5
(gl_FragColor) Location 0
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeBool
6: TypeBool
...
@@ -67,271 +67,271 @@ spv.types.frag
...
@@ -67,271 +67,271 @@ spv.types.frag
16: TypePointer Function 15(bvec2)
16: TypePointer Function 15(bvec2)
18: TypePointer Private 15(bvec2)
18: TypePointer Private 15(bvec2)
19(u_b2): 18(ptr) Variable Private
19(u_b2): 18(ptr) Variable Private
22(i_b2): 18(ptr) Variable Private
20: TypeInt 32 0
33: TypeVector 6(bool) 3
21: 20(int) Constant 0
34: TypePointer Function 33(bvec3)
24(i_b2): 18(ptr) Variable Private
36: TypePointer Private 33(bvec3)
28: 20(int) Constant 1
37(u_b3): 36(ptr) Variable Private
36: TypeVector 6(bool) 3
40(i_b3): 36(ptr) Variable Private
37: TypePointer Function 36(bvec3)
57: TypeVector 6(bool) 4
39: TypePointer Private 36(bvec3)
58: TypePointer Function 57(bvec4)
40(u_b3): 39(ptr) Variable Private
60: TypePointer Private 57(bvec4)
43(i_b3): 39(ptr) Variable Private
61(u_b4): 60(ptr) Variable Private
53: 20(int) Constant 2
64(i_b4): 60(ptr) Variable Private
61: TypeVector 6(bool) 4
87: TypeInt 32 1
62: TypePointer Function 61(bvec4)
88: TypePointer Function 87(int
)
64: TypePointer Private 61(bvec4
)
90: TypePointer Input 87(int)
65(u_b4): 64(ptr) Variable Private
91(u_i): 90(ptr) Variable Input
68(i_b4): 64(ptr) Variable Private
93(i_i): 90(ptr) Variable Input
84: 20(int) Constant 3
9
6: TypeVector 87(int) 2
9
2: TypeInt 32 1
9
7: TypePointer Function 96(ivec2
)
9
3: TypePointer Function 92(int
)
9
9: TypePointer Input 96(ivec2
)
9
5: TypePointer Input 92(int
)
100(u_i2): 99
(ptr) Variable Input
96(u_i): 95
(ptr) Variable Input
102(i_i2): 99
(ptr) Variable Input
98(i_i): 95
(ptr) Variable Input
10
5: TypeVector 87(int) 3
10
1: TypeVector 92(int) 2
10
6: TypePointer Function 105(ivec3
)
10
2: TypePointer Function 101(ivec2
)
10
8: TypePointer Input 105(ivec3
)
10
4: TypePointer Input 101(ivec2
)
10
9(u_i3): 108
(ptr) Variable Input
10
5(u_i2): 104
(ptr) Variable Input
1
11(i_i3): 108
(ptr) Variable Input
1
07(i_i2): 104
(ptr) Variable Input
11
4: TypeVector 87(int) 4
11
0: TypeVector 92(int) 3
11
5: TypePointer Function 114(ivec4
)
11
1: TypePointer Function 110(ivec3
)
11
7: TypePointer Input 114(ivec4
)
11
3: TypePointer Input 110(ivec3
)
11
8(u_i4): 117
(ptr) Variable Input
11
4(u_i3): 113
(ptr) Variable Input
1
20(i_i4): 117
(ptr) Variable Input
1
16(i_i3): 113
(ptr) Variable Input
1
23: TypeFloat 32
1
19: TypeVector 92(int) 4
12
4: TypePointer Function 123(float
)
12
0: TypePointer Function 119(ivec4
)
12
6: TypePointer Input 123(float
)
12
2: TypePointer Input 119(ivec4
)
127(u_f): 126
(ptr) Variable Input
123(u_i4): 122
(ptr) Variable Input
129(i_f): 126
(ptr) Variable Input
125(i_i4): 122
(ptr) Variable Input
1
32: TypeVector 123(float)
2
1
28: TypeFloat 3
2
1
33: TypePointer Function 132(fvec2
)
1
29: TypePointer Function 128(float
)
13
5: TypePointer Input 132(fvec2
)
13
1: TypePointer Input 128(float
)
136(u_f2): 135
(ptr) Variable Input
132(u_f): 131
(ptr) Variable Input
138(i_f2): 135
(ptr) Variable Input
134(i_f): 131
(ptr) Variable Input
1
41: TypeVector 123(float) 3
1
37: TypeVector 128(float) 2
1
42: TypePointer Function 141(fvec3
)
1
38: TypePointer Function 137(fvec2
)
14
4: TypePointer Input 141(fvec3
)
14
0: TypePointer Input 137(fvec2
)
14
5(u_f3): 144
(ptr) Variable Input
14
1(u_f2): 140
(ptr) Variable Input
14
7(i_f3): 144
(ptr) Variable Input
14
3(i_f2): 140
(ptr) Variable Input
1
50: TypeVector 123(float) 4
1
46: TypeVector 128(float) 3
1
51: TypePointer Function 150(fvec4
)
1
47: TypePointer Function 146(fvec3
)
1
53: TypePointer Input 150(fvec4
)
1
49: TypePointer Input 146(fvec3
)
15
4(u_f4): 153
(ptr) Variable Input
15
0(u_f3): 149
(ptr) Variable Input
15
6(i_f4): 153
(ptr) Variable Input
15
2(i_f3): 149
(ptr) Variable Input
15
9: TypePointer Output 150(fvec4)
15
5: TypeVector 128(float) 4
160(gl_FragColor): 159(ptr) Variable Output
156: TypePointer Function 155(fvec4)
1
93: TypeInt 32 0
1
58: TypePointer Input 155(fvec4)
194: 193(int) Constant 0
159(u_f4): 158(ptr) Variable Input
198: 193(int) Constant 1
161(i_f4): 158(ptr) Variable Input
208: 193(int) Constant 2
164: TypePointer Output 155(fvec4)
221: 193(int) Constant 3
165(gl_FragColor): 164(ptr) Variable Output
257: 12
3
(float) Constant 1065353216
257: 12
8
(float) Constant 1065353216
258: 15
0
(fvec4) ConstantComposite 257 257 257 257
258: 15
5
(fvec4) ConstantComposite 257 257 257 257
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
8(b): 7(ptr) Variable Function
8(b): 7(ptr) Variable Function
17(b2): 16(ptr) Variable Function
17(b2): 16(ptr) Variable Function
3
5(b3): 34
(ptr) Variable Function
3
8(b3): 37
(ptr) Variable Function
59(b4): 58
(ptr) Variable Function
63(b4): 62
(ptr) Variable Function
89(i): 88
(ptr) Variable Function
94(i): 93
(ptr) Variable Function
98(i2): 97
(ptr) Variable Function
103(i2): 102
(ptr) Variable Function
1
07(i3): 106
(ptr) Variable Function
1
12(i3): 111
(ptr) Variable Function
1
16(i4): 115
(ptr) Variable Function
1
21(i4): 120
(ptr) Variable Function
1
25(f): 124
(ptr) Variable Function
1
30(f): 129
(ptr) Variable Function
13
4(f2): 133
(ptr) Variable Function
13
9(f2): 138
(ptr) Variable Function
14
3(f3): 142
(ptr) Variable Function
14
8(f3): 147
(ptr) Variable Function
15
2(f4): 151
(ptr) Variable Function
15
7(f4): 156
(ptr) Variable Function
16
1: 151
(ptr) Variable Function
16
6: 156
(ptr) Variable Function
11: 6(bool) Load 10(u_b)
11: 6(bool) Load 10(u_b)
13: 6(bool) Load 12(i_b)
13: 6(bool) Load 12(i_b)
14: 6(bool) LogicalAnd 11 13
14: 6(bool) LogicalAnd 11 13
Store 8(b) 14
Store 8(b) 14
20: 15(bvec2) Load 19(u_b2)
22: 9(ptr) AccessChain 19(u_b2) 21
21: 6(bool) CompositeExtract 20 0
23: 6(bool) Load 22
23: 15(bvec2) Load 22(i_b2)
25: 9(ptr) AccessChain 24(i_b2) 21
24: 6(bool) CompositeExtract 23 0
26: 6(bool) Load 25
25: 6(bool) LogicalAnd 21 24
27: 6(bool) LogicalAnd 23 26
26: 15(bvec2) Load 19(u_b2)
29: 9(ptr) AccessChain 19(u_b2) 28
27: 6(bool) CompositeExtract 26 1
30: 6(bool) Load 29
28: 6(bool) LogicalAnd 25 27
31: 6(bool) LogicalAnd 27 30
29: 15(bvec2) Load 22(i_b2)
32: 9(ptr) AccessChain 24(i_b2) 28
30: 6(bool) CompositeExtract 29 1
33: 6(bool) Load 32
31: 6(bool) LogicalAnd 28 30
34: 6(bool) LogicalAnd 31 33
32: 15(bvec2) CompositeConstruct 31 31
35: 15(bvec2) CompositeConstruct 34 34
Store 17(b2) 32
Store 17(b2) 35
38: 33(bvec3) Load 37(u_b3)
41: 9(ptr) AccessChain 40(u_b3) 21
39: 6(bool) CompositeExtract 38 0
42: 6(bool) Load 41
41: 33(bvec3) Load 40(i_b3)
44: 9(ptr) AccessChain 43(i_b3) 21
42: 6(bool) CompositeExtract 41 0
45: 6(bool) Load 44
43: 6(bool) LogicalAnd 39 42
46: 6(bool) LogicalAnd 42 45
44: 33(bvec3) Load 37(u_b3)
47: 9(ptr) AccessChain 40(u_b3) 28
45: 6(bool) CompositeExtract 44 1
48: 6(bool) Load 47
46: 6(bool) LogicalAnd 43 45
47: 33(bvec3) Load 40(i_b3)
48: 6(bool) CompositeExtract 47 1
49: 6(bool) LogicalAnd 46 48
49: 6(bool) LogicalAnd 46 48
50:
33(bvec3) Load 37(u_b3)
50:
9(ptr) AccessChain 43(i_b3) 28
51: 6(bool)
CompositeExtract 50 2
51: 6(bool)
Load 50
52: 6(bool) LogicalAnd 49 51
52: 6(bool) LogicalAnd 49 51
53: 33(bvec3) Load 40(i_b3)
54: 9(ptr) AccessChain 40(u_b3) 53
54: 6(bool) CompositeExtract 53 2
55: 6(bool) Load 54
55: 6(bool) LogicalAnd 52 54
56: 6(bool) LogicalAnd 52 55
56: 33(bvec3) CompositeConstruct 55 55 55
57: 9(ptr) AccessChain 43(i_b3) 53
Store 35(b3) 56
58: 6(bool) Load 57
62: 57(bvec4) Load 61(u_b4)
59: 6(bool) LogicalAnd 56 58
63: 6(bool) CompositeExtract 62 0
60: 36(bvec3) CompositeConstruct 59 59 59
65: 57(bvec4) Load 64(i_b4)
Store 38(b3) 60
66: 6(bool) CompositeExtract 65 0
66: 9(ptr) AccessChain 65(u_b4) 21
67: 6(bool) LogicalAnd 63 66
67: 6(bool) Load 66
68: 57(bvec4) Load 61(u_b4)
69: 9(ptr) AccessChain 68(i_b4) 21
69: 6(bool) CompositeExtract 68 1
70: 6(bool) Load 69
70: 6(bool) LogicalAnd 67 69
71: 6(bool) LogicalAnd 67 70
71: 57(bvec4) Load 64(i_b4)
72: 9(ptr) AccessChain 65(u_b4) 28
72: 6(bool) CompositeExtract 71 1
73: 6(bool) Load 72
73: 6(bool) LogicalAnd 70 72
74: 6(bool) LogicalAnd 71 73
74: 57(bvec4) Load 61(u_b4)
75: 9(ptr) AccessChain 68(i_b4) 28
75: 6(bool) CompositeExtract 74 2
76: 6(bool) Load 75
76: 6(bool) LogicalAnd 73 75
77: 6(bool) LogicalAnd 74 76
77: 57(bvec4) Load 64(i_b4)
78: 9(ptr) AccessChain 65(u_b4) 53
78: 6(bool) CompositeExtract 77 2
79: 6(bool) Load 78
79: 6(bool) LogicalAnd 76 78
80: 6(bool) LogicalAnd 77 79
80: 57(bvec4) Load 61(u_b4)
81: 9(ptr) AccessChain 68(i_b4) 53
81: 6(bool) CompositeExtract 80 3
82: 6(bool) Load 81
82: 6(bool) LogicalAnd 79 81
83: 6(bool) LogicalAnd 80 82
83: 57(bvec4) Load 64(i_b4)
85: 9(ptr) AccessChain 65(u_b4) 84
84: 6(bool) CompositeExtract 83 3
86: 6(bool) Load 85
85: 6(bool) LogicalAnd 82 84
87: 6(bool) LogicalAnd 83 86
86: 57(bvec4) CompositeConstruct 85 85 85 85
88: 9(ptr) AccessChain 68(i_b4) 84
Store 59(b4) 86
89: 6(bool) Load 88
92: 87(int) Load 91(u_i)
90: 6(bool) LogicalAnd 87 89
94: 87(int) Load 93(i_i)
91: 61(bvec4) CompositeConstruct 90 90 90 90
95: 87(int) IAdd 92 94
Store 63(b4) 91
Store 89(i) 95
97: 92(int) Load 96(u_i)
101: 96(ivec2) Load 100(u_i2)
99: 92(int) Load 98(i_i)
103: 96(ivec2) Load 102(i_i2)
100: 92(int) IAdd 97 99
104: 96(ivec2) IAdd 101 103
Store 94(i) 100
Store 98(i2) 104
106: 101(ivec2) Load 105(u_i2)
110: 105(ivec3) Load 109(u_i3)
108: 101(ivec2) Load 107(i_i2)
112: 105(ivec3) Load 111(i_i3)
109: 101(ivec2) IAdd 106 108
113: 105(ivec3) IAdd 110 112
Store 103(i2) 109
Store 107(i3) 113
115: 110(ivec3) Load 114(u_i3)
119: 114(ivec4) Load 118(u_i4)
117: 110(ivec3) Load 116(i_i3)
121: 114(ivec4) Load 120(i_i4)
118: 110(ivec3) IAdd 115 117
122: 114(ivec4) IAdd 119 121
Store 112(i3) 118
Store 116(i4) 122
124: 119(ivec4) Load 123(u_i4)
128: 123(float) Load 127(u_f)
126: 119(ivec4) Load 125(i_i4)
130: 123(float) Load 129(i_f)
127: 119(ivec4) IAdd 124 126
131: 123(float) FAdd 128 130
Store 121(i4) 127
Store 125(f) 131
133: 128(float) Load 132(u_f)
137: 132(fvec2) Load 136(u_f2)
135: 128(float) Load 134(i_f)
139: 132(fvec2) Load 138(i_f2)
136: 128(float) FAdd 133 135
140: 132(fvec2) FAdd 137 139
Store 130(f) 136
Store 134(f2) 140
142: 137(fvec2) Load 141(u_f2)
146: 141(fvec3) Load 145(u_f3)
144: 137(fvec2) Load 143(i_f2)
148: 141(fvec3) Load 147(i_f3)
145: 137(fvec2) FAdd 142 144
149: 141(fvec3) FAdd 146 148
Store 139(f2) 145
Store 143(f3) 149
151: 146(fvec3) Load 150(u_f3)
155: 150(fvec4) Load 154(u_f4)
153: 146(fvec3) Load 152(i_f3)
157: 150(fvec4) Load 156(i_f4)
154: 146(fvec3) FAdd 151 153
158: 150(fvec4) FAdd 155 157
Store 148(f3) 154
Store 152(f4) 158
160: 155(fvec4) Load 159(u_f4)
162: 6(bool) Load 8(b)
162: 155(fvec4) Load 161(i_f4)
163: 15(bvec2) Load 17(b2)
163: 155(fvec4) FAdd 160 162
164: 6(bool) CompositeExtract 163 0
Store 157(f4) 163
165: 6(bool) LogicalOr 162 164
167: 6(bool) Load 8(b)
166: 15(bvec2) Load 17(b2)
168: 7(ptr) AccessChain 17(b2) 21
167: 6(bool) CompositeExtract 166 1
169: 6(bool) Load 168
168: 6(bool) LogicalOr 165 167
170: 6(bool) LogicalOr 167 169
169: 33(bvec3) Load 35(b3)
171: 7(ptr) AccessChain 17(b2) 28
170: 6(bool) CompositeExtract 169 0
172: 6(bool) Load 171
171: 6(bool) LogicalOr 168 170
173: 6(bool) LogicalOr 170 172
172: 33(bvec3) Load 35(b3)
174: 7(ptr) AccessChain 38(b3) 21
173: 6(bool) CompositeExtract 172 1
175: 6(bool) Load 174
174: 6(bool) LogicalOr 171 173
176: 6(bool) LogicalOr 173 175
175: 33(bvec3) Load 35(b3)
177: 7(ptr) AccessChain 38(b3) 28
176: 6(bool) CompositeExtract 175 2
178: 6(bool) Load 177
177: 6(bool) LogicalOr 174 176
179: 6(bool) LogicalOr 176 178
178: 57(bvec4) Load 59(b4)
180: 7(ptr) AccessChain 38(b3) 53
179: 6(bool) CompositeExtract 178 0
181: 6(bool) Load 180
180: 6(bool) LogicalOr 177 179
182: 6(bool) LogicalOr 179 181
181: 57(bvec4) Load 59(b4)
183: 7(ptr) AccessChain 63(b4) 21
182: 6(bool) CompositeExtract 181 1
184: 6(bool) Load 183
183: 6(bool) LogicalOr 180 182
185: 6(bool) LogicalOr 182 184
184: 57(bvec4) Load 59(b4)
186: 7(ptr) AccessChain 63(b4) 28
185: 6(bool) CompositeExtract 184 2
187: 6(bool) Load 186
186: 6(bool) LogicalOr 183 185
188: 6(bool) LogicalOr 185 187
187: 57(bvec4) Load 59(b4)
189: 7(ptr) AccessChain 63(b4) 53
188: 6(bool) CompositeExtract 187 3
190: 6(bool) Load 189
189: 6(bool) LogicalOr 186 188
191: 6(bool) LogicalOr 188 190
SelectionMerge 191 None
192: 7(ptr) AccessChain 63(b4) 84
BranchConditional 189 190 256
193: 6(bool) Load 192
190: Label
194: 6(bool) LogicalOr 191 193
192: 87(int) Load 89(i)
SelectionMerge 196 None
195: 88(ptr) AccessChain 98(i2) 194
BranchConditional 194 195 256
196: 87(int) Load 195
195: Label
197: 87(int) IAdd 192 196
197: 92(int) Load 94(i)
199: 88(ptr) AccessChain 98(i2) 198
198: 93(ptr) AccessChain 103(i2) 21
200: 87(int) Load 199
199: 92(int) Load 198
201: 87(int) IAdd 197 200
200: 92(int) IAdd 197 199
202: 88(ptr) AccessChain 107(i3) 194
201: 93(ptr) AccessChain 103(i2) 28
203: 87(int) Load 202
202: 92(int) Load 201
204: 87(int) IAdd 201 203
203: 92(int) IAdd 200 202
205: 88(ptr) AccessChain 107(i3) 198
204: 93(ptr) AccessChain 112(i3) 21
206: 87(int) Load 205
205: 92(int) Load 204
207: 87(int) IAdd 204 206
206: 92(int) IAdd 203 205
209: 88(ptr) AccessChain 107(i3) 208
207: 93(ptr) AccessChain 112(i3) 28
210: 87(int) Load 209
208: 92(int) Load 207
211: 87(int) IAdd 207 210
209: 92(int) IAdd 206 208
212: 88(ptr) AccessChain 116(i4) 194
210: 93(ptr) AccessChain 112(i3) 53
213: 87(int) Load 212
211: 92(int) Load 210
214: 87(int) IAdd 211 213
212: 92(int) IAdd 209 211
215: 88(ptr) AccessChain 116(i4) 198
213: 93(ptr) AccessChain 121(i4) 21
216: 87(int) Load 215
214: 92(int) Load 213
217: 87(int) IAdd 214 216
215: 92(int) IAdd 212 214
218: 88(ptr) AccessChain 116(i4) 208
216: 93(ptr) AccessChain 121(i4) 28
219: 87(int) Load 218
217: 92(int) Load 216
220: 87(int) IAdd 217 219
218: 92(int) IAdd 215 217
222: 88(ptr) AccessChain 116(i4) 221
219: 93(ptr) AccessChain 121(i4) 53
223: 87(int) Load 222
220: 92(int) Load 219
224: 87(int) IAdd 220 223
221: 92(int) IAdd 218 220
225: 123(float) ConvertSToF 224
222: 93(ptr) AccessChain 121(i4) 84
226: 123(float) Load 125(f)
223: 92(int) Load 222
227: 123(float) FAdd 225 226
224: 92(int) IAdd 221 223
228: 124(ptr) AccessChain 134(f2) 194
225: 128(float) ConvertSToF 224
229: 123(float) Load 228
226: 128(float) Load 130(f)
230: 123(float) FAdd 227 229
227: 128(float) FAdd 225 226
231: 124(ptr) AccessChain 134(f2) 198
228: 129(ptr) AccessChain 139(f2) 21
232: 123(float) Load 231
229: 128(float) Load 228
233: 123(float) FAdd 230 232
230: 128(float) FAdd 227 229
234: 124(ptr) AccessChain 143(f3) 194
231: 129(ptr) AccessChain 139(f2) 28
235: 123(float) Load 234
232: 128(float) Load 231
236: 123(float) FAdd 233 235
233: 128(float) FAdd 230 232
237: 124(ptr) AccessChain 143(f3) 198
234: 129(ptr) AccessChain 148(f3) 21
238: 123(float) Load 237
235: 128(float) Load 234
239: 123(float) FAdd 236 238
236: 128(float) FAdd 233 235
240: 124(ptr) AccessChain 143(f3) 208
237: 129(ptr) AccessChain 148(f3) 28
241: 123(float) Load 240
238: 128(float) Load 237
242: 123(float) FAdd 239 241
239: 128(float) FAdd 236 238
243: 124(ptr) AccessChain 152(f4) 194
240: 129(ptr) AccessChain 148(f3) 53
244: 123(float) Load 243
241: 128(float) Load 240
245: 123(float) FAdd 242 244
242: 128(float) FAdd 239 241
246: 124(ptr) AccessChain 152(f4) 198
243: 129(ptr) AccessChain 157(f4) 21
247: 123(float) Load 246
244: 128(float) Load 243
248: 123(float) FAdd 245 247
245: 128(float) FAdd 242 244
249: 124(ptr) AccessChain 152(f4) 208
246: 129(ptr) AccessChain 157(f4) 28
250: 123(float) Load 249
247: 128(float) Load 246
251: 123(float) FAdd 248 250
248: 128(float) FAdd 245 247
252: 124(ptr) AccessChain 152(f4) 221
249: 129(ptr) AccessChain 157(f4) 53
253: 123(float) Load 252
250: 128(float) Load 249
254: 123(float) FAdd 251 253
251: 128(float) FAdd 248 250
255: 150(fvec4) CompositeConstruct 254 254 254 254
252: 129(ptr) AccessChain 157(f4) 84
Store 161 255
253: 128(float) Load 252
Branch 191
254: 128(float) FAdd 251 253
255: 155(fvec4) CompositeConstruct 254 254 254 254
Store 166 255
Branch 196
256: Label
256: Label
Store 16
1
258
Store 16
6
258
Branch 19
1
Branch 19
6
19
1
: Label
19
6
: Label
259: 15
0(fvec4) Load 161
259: 15
5(fvec4) Load 166
Store 16
0
(gl_FragColor) 259
Store 16
5
(gl_FragColor) 259
Return
Return
FunctionEnd
FunctionEnd
Test/spv.accessChain.frag
View file @
5c3eed54
...
@@ -74,6 +74,11 @@ void GetColor13(const S i, int comp)
...
@@ -74,6 +74,11 @@ void GetColor13(const S i, int comp)
OutColor
.
zy
[
comp
]
+=
i
.
color
.
x
;
OutColor
.
zy
[
comp
]
+=
i
.
color
.
x
;
}
}
void
GetColor14
(
const
S
i
,
int
comp
)
{
OutColor
.
zyx
[
comp
]
=
i
.
color
.
x
;
}
void
main
()
void
main
()
{
{
S
s
;
S
s
;
...
@@ -91,4 +96,5 @@ void main()
...
@@ -91,4 +96,5 @@ void main()
GetColor11
(
s
,
u
);
GetColor11
(
s
,
u
);
GetColor12
(
s
,
u
);
GetColor12
(
s
,
u
);
GetColor13
(
s
,
u
);
GetColor13
(
s
,
u
);
GetColor14
(
s
,
u
);
}
}
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