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
d2e9829a
Unverified
Commit
d2e9829a
authored
May 04, 2018
by
John Kessenich
Committed by
GitHub
May 04, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1370 from KhronosGroup/fix-param-types
Fix #944: Convert argument type to match formal parameter type.
parents
115c3b14
d3ed90be
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
273 additions
and
270 deletions
+273
-270
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+19
-14
spvIR.h
SPIRV/spvIR.h
+2
-1
spv.debugInfo.1.1.frag.out
Test/baseResults/spv.debugInfo.1.1.frag.out
+100
-104
spv.debugInfo.frag.out
Test/baseResults/spv.debugInfo.frag.out
+101
-105
spv.multiStructFuncall.frag.out
Test/baseResults/spv.multiStructFuncall.frag.out
+51
-46
No files found.
SPIRV/GlslangToSpv.cpp
View file @
d2e9829a
...
...
@@ -170,7 +170,7 @@ protected:
void
declareUseOfStructMember
(
const
glslang
::
TTypeList
&
members
,
int
glslangMember
);
bool
isShaderEntryPoint
(
const
glslang
::
TIntermAggregate
*
node
);
bool
writableParam
(
glslang
::
TStorageQualifier
);
bool
writableParam
(
glslang
::
TStorageQualifier
)
const
;
bool
originalParam
(
glslang
::
TStorageQualifier
,
const
glslang
::
TType
&
,
bool
implicitThisParam
);
void
makeFunctions
(
const
glslang
::
TIntermSequence
&
);
void
makeGlobalInitializers
(
const
glslang
::
TIntermSequence
&
);
...
...
@@ -3241,7 +3241,7 @@ bool TGlslangToSpvTraverser::isShaderEntryPoint(const glslang::TIntermAggregate*
// Does parameter need a place to keep writes, separate from the original?
// Assumes called after originalParam(), which filters out block/buffer/opaque-based
// qualifiers such that we should have only in/out/inout/constreadonly here.
bool
TGlslangToSpvTraverser
::
writableParam
(
glslang
::
TStorageQualifier
qualifier
)
bool
TGlslangToSpvTraverser
::
writableParam
(
glslang
::
TStorageQualifier
qualifier
)
const
{
assert
(
qualifier
==
glslang
::
EvqIn
||
qualifier
==
glslang
::
EvqOut
||
...
...
@@ -3954,18 +3954,17 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
// 3. Make the call
// 4. Copy back the results
// 1. Evaluate the arguments
// 1. Evaluate the arguments
and their types
std
::
vector
<
spv
::
Builder
::
AccessChain
>
lValues
;
std
::
vector
<
spv
::
Id
>
rValues
;
std
::
vector
<
const
glslang
::
TType
*>
argTypes
;
for
(
int
a
=
0
;
a
<
(
int
)
glslangArgs
.
size
();
++
a
)
{
const
glslang
::
TType
&
paramType
=
glslangArgs
[
a
]
->
getAsTyped
()
->
getType
(
);
argTypes
.
push_back
(
&
glslangArgs
[
a
]
->
getAsTyped
()
->
getType
()
);
// build l-value
builder
.
clearAccessChain
();
glslangArgs
[
a
]
->
traverse
(
this
);
argTypes
.
push_back
(
&
paramType
);
// keep outputs and pass-by-originals as l-values, evaluate others as r-values
if
(
originalParam
(
qualifiers
[
a
],
paramType
,
function
->
hasImplicitThis
()
&&
a
==
0
)
||
if
(
originalParam
(
qualifiers
[
a
],
*
argTypes
[
a
]
,
function
->
hasImplicitThis
()
&&
a
==
0
)
||
writableParam
(
qualifiers
[
a
]))
{
// save l-value
lValues
.
push_back
(
builder
.
getAccessChain
());
...
...
@@ -3983,26 +3982,33 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
int
rValueCount
=
0
;
std
::
vector
<
spv
::
Id
>
spvArgs
;
for
(
int
a
=
0
;
a
<
(
int
)
glslangArgs
.
size
();
++
a
)
{
const
glslang
::
TType
&
paramType
=
glslangArgs
[
a
]
->
getAsTyped
()
->
getType
();
spv
::
Id
arg
;
if
(
originalParam
(
qualifiers
[
a
],
paramType
,
function
->
hasImplicitThis
()
&&
a
==
0
))
{
if
(
originalParam
(
qualifiers
[
a
],
*
argTypes
[
a
]
,
function
->
hasImplicitThis
()
&&
a
==
0
))
{
builder
.
setAccessChain
(
lValues
[
lValueCount
]);
arg
=
builder
.
accessChainGetLValue
();
++
lValueCount
;
}
else
if
(
writableParam
(
qualifiers
[
a
]))
{
// need space to hold the copy
arg
=
builder
.
createVariable
(
spv
::
StorageClassFunction
,
convertGlslangToSpvType
(
paramType
),
"param"
);
arg
=
builder
.
createVariable
(
spv
::
StorageClassFunction
,
builder
.
getContainedTypeId
(
function
->
getParamType
(
a
)
),
"param"
);
if
(
qualifiers
[
a
]
==
glslang
::
EvqIn
||
qualifiers
[
a
]
==
glslang
::
EvqInOut
)
{
// need to copy the input into output space
builder
.
setAccessChain
(
lValues
[
lValueCount
]);
spv
::
Id
copy
=
accessChainLoad
(
*
argTypes
[
a
]);
builder
.
clearAccessChain
();
builder
.
setAccessChainLValue
(
arg
);
multiTypeStore
(
paramType
,
copy
);
multiTypeStore
(
*
argTypes
[
a
]
,
copy
);
}
++
lValueCount
;
}
else
{
arg
=
rValues
[
rValueCount
];
// process r-value, which involves a copy for a type mismatch
if
(
function
->
getParamType
(
a
)
!=
convertGlslangToSpvType
(
*
argTypes
[
a
]))
{
spv
::
Id
argCopy
=
builder
.
createVariable
(
spv
::
StorageClassFunction
,
function
->
getParamType
(
a
),
"arg"
);
builder
.
clearAccessChain
();
builder
.
setAccessChainLValue
(
argCopy
);
multiTypeStore
(
*
argTypes
[
a
],
rValues
[
rValueCount
]);
arg
=
builder
.
createLoad
(
argCopy
);
}
else
arg
=
rValues
[
rValueCount
];
++
rValueCount
;
}
spvArgs
.
push_back
(
arg
);
...
...
@@ -4015,14 +4021,13 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
// 4. Copy back out an "out" arguments.
lValueCount
=
0
;
for
(
int
a
=
0
;
a
<
(
int
)
glslangArgs
.
size
();
++
a
)
{
const
glslang
::
TType
&
paramType
=
glslangArgs
[
a
]
->
getAsTyped
()
->
getType
();
if
(
originalParam
(
qualifiers
[
a
],
paramType
,
function
->
hasImplicitThis
()
&&
a
==
0
))
if
(
originalParam
(
qualifiers
[
a
],
*
argTypes
[
a
],
function
->
hasImplicitThis
()
&&
a
==
0
))
++
lValueCount
;
else
if
(
writableParam
(
qualifiers
[
a
]))
{
if
(
qualifiers
[
a
]
==
glslang
::
EvqOut
||
qualifiers
[
a
]
==
glslang
::
EvqInOut
)
{
spv
::
Id
copy
=
builder
.
createLoad
(
spvArgs
[
a
]);
builder
.
setAccessChain
(
lValues
[
lValueCount
]);
multiTypeStore
(
paramType
,
copy
);
multiTypeStore
(
*
argTypes
[
a
]
,
copy
);
}
++
lValueCount
;
}
...
...
SPIRV/spvIR.h
View file @
d2e9829a
...
...
@@ -258,7 +258,8 @@ public:
delete
blocks
[
i
];
}
Id
getId
()
const
{
return
functionInstruction
.
getResultId
();
}
Id
getParamId
(
int
p
)
{
return
parameterInstructions
[
p
]
->
getResultId
();
}
Id
getParamId
(
int
p
)
const
{
return
parameterInstructions
[
p
]
->
getResultId
();
}
Id
getParamType
(
int
p
)
const
{
return
parameterInstructions
[
p
]
->
getTypeId
();
}
void
addBlock
(
Block
*
block
)
{
blocks
.
push_back
(
block
);
}
void
removeBlock
(
Block
*
block
)
...
...
Test/baseResults/spv.debugInfo.1.1.frag.out
View file @
d2e9829a
spv.debugInfo.frag
// Module Version 10300
// Generated by (magic number): 80006
// Id's are bound by 12
6
// Id's are bound by 12
4
Capability Shader
2: ExtInstImport "GLSL.std.450"
...
...
@@ -74,11 +74,9 @@ void main()
Name 54 "ubuf"
MemberName 54(ubuf) 0 "s"
Name 56 ""
Name 57 "S"
MemberName 57(S) 0 "a"
Name 59 "param"
Name 69 "s2d"
Name 99 "i"
Name 57 "param"
Name 67 "s2d"
Name 97 "i"
ModuleProcessed "no-storage-format"
ModuleProcessed "resource-set-binding 3"
ModuleProcessed "auto-map-locations"
...
...
@@ -94,8 +92,8 @@ void main()
MemberDecorate 54(ubuf) 0 Offset 0
Decorate 54(ubuf) Block
Decorate 56 DescriptorSet 3
Decorate 6
9
(s2d) Location 0
Decorate 6
9
(s2d) DescriptorSet 3
Decorate 6
7
(s2d) Location 0
Decorate 6
7
(s2d) DescriptorSet 3
3: TypeVoid
4: TypeFunction 3
7: TypeInt 32 1
...
...
@@ -122,120 +120,118 @@ void main()
54(ubuf): TypeStruct 53(S)
55: TypePointer Uniform 54(ubuf)
56: 55(ptr) Variable Uniform
57(S): TypeStruct 7(int)
58: TypePointer Function 57(S)
60: TypePointer Uniform 53(S)
66: TypeImage 10(float) 2D sampled format:Unknown
67: TypeSampledImage 66
68: TypePointer UniformConstant 67
69(s2d): 68(ptr) Variable UniformConstant
71: TypeVector 10(float) 2
72: 10(float) Constant 1056964608
73: 71(fvec2) ConstantComposite 72 72
77: TypePointer Uniform 7(int)
106: 7(int) Constant 10
111: 7(int) Constant 1
113: TypePointer Output 10(float)
116: 10(float) Constant 1092616192
58: TypePointer Uniform 53(S)
64: TypeImage 10(float) 2D sampled format:Unknown
65: TypeSampledImage 64
66: TypePointer UniformConstant 65
67(s2d): 66(ptr) Variable UniformConstant
69: TypeVector 10(float) 2
70: 10(float) Constant 1056964608
71: 69(fvec2) ConstantComposite 70 70
75: TypePointer Uniform 7(int)
104: 7(int) Constant 10
109: 7(int) Constant 1
111: TypePointer Output 10(float)
114: 10(float) Constant 1092616192
5(main): 3 Function None 4
6: Label
5
9(param): 58
(ptr) Variable Function
9
9
(i): 19(ptr) Variable Function
11
8
: 16(ptr) Variable Function
5
7(param): 9
(ptr) Variable Function
9
7
(i): 19(ptr) Variable Function
11
6
: 16(ptr) Variable Function
Line 1 30 0
61: 60
(ptr) AccessChain 56 18
6
2: 53(S) Load 61
6
3: 7(int) CompositeExtract 62
0
6
4: 19(ptr) AccessChain 59
(param) 18
Store 6
4 63
6
5: 11(fvec4) FunctionCall 14(foo(struct-S-i11;) 59
(param)
Store 52(outv) 6
5
59: 58
(ptr) AccessChain 56 18
6
0: 53(S) Load 59
6
1: 7(int) CompositeExtract 60
0
6
2: 19(ptr) AccessChain 57
(param) 18
Store 6
2 61
6
3: 11(fvec4) FunctionCall 14(foo(struct-S-i11;) 57
(param)
Store 52(outv) 6
3
Line 1 31 0
70: 67 Load 69
(s2d)
7
4: 11(fvec4) ImageSampleImplicitLod 70 73
7
5
: 11(fvec4) Load 52(outv)
7
6: 11(fvec4) FAdd 75 74
Store 52(outv) 7
6
68: 65 Load 67
(s2d)
7
2: 11(fvec4) ImageSampleImplicitLod 68 71
7
3
: 11(fvec4) Load 52(outv)
7
4: 11(fvec4) FAdd 73 72
Store 52(outv) 7
4
Line 1 33 0
7
8: 77
(ptr) AccessChain 56 18 18
7
9: 7(int) Load 78
SelectionMerge 8
3
None
Switch 7
9 82
case 10:
80
case 20:
81
8
2
: Label
7
6: 75
(ptr) AccessChain 56 18 18
7
7: 7(int) Load 76
SelectionMerge 8
1
None
Switch 7
7 80
case 10:
78
case 20:
79
8
0
: Label
Line 1 42 0
9
4
: 11(fvec4) Load 52(outv)
9
5
: 11(fvec4) CompositeConstruct 28 28 28 28
9
6: 11(fvec4) FSub 94 95
Store 52(outv) 9
6
9
2
: 11(fvec4) Load 52(outv)
9
3
: 11(fvec4) CompositeConstruct 28 28 28 28
9
4: 11(fvec4) FSub 92 93
Store 52(outv) 9
4
Line 1 43 0
Branch 8
3
80
: Label
Branch 8
1
78
: Label
Line 1 35 0
8
4
: 11(fvec4) Load 52(outv)
8
5
: 11(fvec4) CompositeConstruct 28 28 28 28
8
6: 11(fvec4) FAdd 84 85
Store 52(outv) 8
6
8
2
: 11(fvec4) Load 52(outv)
8
3
: 11(fvec4) CompositeConstruct 28 28 28 28
8
4: 11(fvec4) FAdd 82 83
Store 52(outv) 8
4
Line 1 36 0
Branch 8
3
81
: Label
Branch 8
1
79
: Label
Line 1 38 0
8
8
: 11(fvec4) Load 52(outv)
8
9: 11(fvec4) VectorTimesScalar 88
45
Store 52(outv) 8
9
8
6
: 11(fvec4) Load 52(outv)
8
7: 11(fvec4) VectorTimesScalar 86
45
Store 52(outv) 8
7
Line 1 39 0
90
: 11(fvec4) Load 52(outv)
91
: 11(fvec4) CompositeConstruct 28 28 28 28
9
2: 11(fvec4) FAdd 90 91
Store 52(outv) 9
2
88
: 11(fvec4) Load 52(outv)
89
: 11(fvec4) CompositeConstruct 28 28 28 28
9
0: 11(fvec4) FAdd 88 89
Store 52(outv) 9
0
Line 1 40 0
Branch 8
3
8
3
: Label
Branch 8
1
8
1
: Label
Line 1 46 0
Store 9
9
(i) 18
Branch
100
100
: Label
LoopMerge 10
2 103
None
Branch 10
4
10
4
: Label
10
5: 7(int) Load 99
(i)
10
7: 37(bool) SLessThan 105 106
BranchConditional 10
7 101 102
101
: Label
Store 9
7
(i) 18
Branch
98
98
: Label
LoopMerge 10
0 101
None
Branch 10
2
10
2
: Label
10
3: 7(int) Load 97
(i)
10
5: 37(bool) SLessThan 103 104
BranchConditional 10
5 99 100
99
: Label
Line 1 47 0
10
8
: 11(fvec4) Load 52(outv)
10
9: 11(fvec4) VectorTimesScalar 108
36
Store 52(outv) 10
9
Branch 10
3
10
3
: Label
10
6
: 11(fvec4) Load 52(outv)
10
7: 11(fvec4) VectorTimesScalar 106
36
Store 52(outv) 10
7
Branch 10
1
10
1
: Label
Line 1 46 0
1
10: 7(int) Load 99
(i)
11
2: 7(int) IAdd 110 111
Store 9
9(i) 112
Branch
100
10
2
: Label
1
08: 7(int) Load 97
(i)
11
0: 7(int) IAdd 108 109
Store 9
7(i) 110
Branch
98
10
0
: Label
Line 1 49 0
11
4: 113
(ptr) AccessChain 52(outv) 32
11
5: 10(float) Load 114
11
7: 37(bool) FOrdLessThan 115 116
SelectionMerge 1
20
None
BranchConditional 11
7 119 123
11
9
: Label
11
2: 111
(ptr) AccessChain 52(outv) 32
11
3: 10(float) Load 112
11
5: 37(bool) FOrdLessThan 113 114
SelectionMerge 1
18
None
BranchConditional 11
5 117 121
11
7
: Label
Line 1 50 0
1
21
: 11(fvec4) Load 52(outv)
12
2: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 121
Store 52(outv) 12
2
Store 11
8 122
Branch 1
20
12
3
: Label
1
19
: 11(fvec4) Load 52(outv)
12
0: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 119
Store 52(outv) 12
0
Store 11
6 120
Branch 1
18
12
1
: Label
Line 1 51 0
12
4
: 11(fvec4) Load 52(outv)
12
5: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 124
Store 52(outv) 12
5
Store 11
8 125
Branch 1
20
1
20
: Label
12
2
: 11(fvec4) Load 52(outv)
12
3: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 122
Store 52(outv) 12
3
Store 11
6 123
Branch 1
18
1
18
: Label
Return
FunctionEnd
14(foo(struct-S-i11;): 11(fvec4) Function None 12
...
...
Test/baseResults/spv.debugInfo.frag.out
View file @
d2e9829a
spv.debugInfo.frag
// Module Version 10000
// Generated by (magic number): 80006
// Id's are bound by 12
6
// Id's are bound by 12
4
Capability Shader
2: ExtInstImport "GLSL.std.450"
...
...
@@ -85,11 +85,9 @@ void main()
Name 54 "ubuf"
MemberName 54(ubuf) 0 "s"
Name 56 ""
Name 57 "S"
MemberName 57(S) 0 "a"
Name 59 "param"
Name 69 "s2d"
Name 99 "i"
Name 57 "param"
Name 67 "s2d"
Name 97 "i"
Decorate 24(inv) Location 0
Decorate 52(outv) Location 0
MemberDecorate 53(S) 0 Offset 0
...
...
@@ -97,9 +95,9 @@ void main()
Decorate 54(ubuf) Block
Decorate 56 DescriptorSet 3
Decorate 56 Binding 0
Decorate 6
9
(s2d) Location 0
Decorate 6
9
(s2d) DescriptorSet 3
Decorate 6
9
(s2d) Binding 1
Decorate 6
7
(s2d) Location 0
Decorate 6
7
(s2d) DescriptorSet 3
Decorate 6
7
(s2d) Binding 1
3: TypeVoid
4: TypeFunction 3
7: TypeInt 32 1
...
...
@@ -126,120 +124,118 @@ void main()
54(ubuf): TypeStruct 53(S)
55: TypePointer Uniform 54(ubuf)
56: 55(ptr) Variable Uniform
57(S): TypeStruct 7(int)
58: TypePointer Function 57(S)
60: TypePointer Uniform 53(S)
66: TypeImage 10(float) 2D sampled format:Unknown
67: TypeSampledImage 66
68: TypePointer UniformConstant 67
69(s2d): 68(ptr) Variable UniformConstant
71: TypeVector 10(float) 2
72: 10(float) Constant 1056964608
73: 71(fvec2) ConstantComposite 72 72
77: TypePointer Uniform 7(int)
106: 7(int) Constant 10
111: 7(int) Constant 1
113: TypePointer Output 10(float)
116: 10(float) Constant 1092616192
58: TypePointer Uniform 53(S)
64: TypeImage 10(float) 2D sampled format:Unknown
65: TypeSampledImage 64
66: TypePointer UniformConstant 65
67(s2d): 66(ptr) Variable UniformConstant
69: TypeVector 10(float) 2
70: 10(float) Constant 1056964608
71: 69(fvec2) ConstantComposite 70 70
75: TypePointer Uniform 7(int)
104: 7(int) Constant 10
109: 7(int) Constant 1
111: TypePointer Output 10(float)
114: 10(float) Constant 1092616192
5(main): 3 Function None 4
6: Label
5
9(param): 58
(ptr) Variable Function
9
9
(i): 19(ptr) Variable Function
11
8
: 16(ptr) Variable Function
5
7(param): 9
(ptr) Variable Function
9
7
(i): 19(ptr) Variable Function
11
6
: 16(ptr) Variable Function
Line 1 30 0
61: 60
(ptr) AccessChain 56 18
6
2: 53(S) Load 61
6
3: 7(int) CompositeExtract 62
0
6
4: 19(ptr) AccessChain 59
(param) 18
Store 6
4 63
6
5: 11(fvec4) FunctionCall 14(foo(struct-S-i11;) 59
(param)
Store 52(outv) 6
5
59: 58
(ptr) AccessChain 56 18
6
0: 53(S) Load 59
6
1: 7(int) CompositeExtract 60
0
6
2: 19(ptr) AccessChain 57
(param) 18
Store 6
2 61
6
3: 11(fvec4) FunctionCall 14(foo(struct-S-i11;) 57
(param)
Store 52(outv) 6
3
Line 1 31 0
70: 67 Load 69
(s2d)
7
4: 11(fvec4) ImageSampleImplicitLod 70 73
7
5
: 11(fvec4) Load 52(outv)
7
6: 11(fvec4) FAdd 75 74
Store 52(outv) 7
6
68: 65 Load 67
(s2d)
7
2: 11(fvec4) ImageSampleImplicitLod 68 71
7
3
: 11(fvec4) Load 52(outv)
7
4: 11(fvec4) FAdd 73 72
Store 52(outv) 7
4
Line 1 33 0
7
8: 77
(ptr) AccessChain 56 18 18
7
9: 7(int) Load 78
SelectionMerge 8
3
None
Switch 7
9 82
case 10:
80
case 20:
81
8
2
: Label
7
6: 75
(ptr) AccessChain 56 18 18
7
7: 7(int) Load 76
SelectionMerge 8
1
None
Switch 7
7 80
case 10:
78
case 20:
79
8
0
: Label
Line 1 42 0
9
4
: 11(fvec4) Load 52(outv)
9
5
: 11(fvec4) CompositeConstruct 28 28 28 28
9
6: 11(fvec4) FSub 94 95
Store 52(outv) 9
6
9
2
: 11(fvec4) Load 52(outv)
9
3
: 11(fvec4) CompositeConstruct 28 28 28 28
9
4: 11(fvec4) FSub 92 93
Store 52(outv) 9
4
Line 1 43 0
Branch 8
3
80
: Label
Branch 8
1
78
: Label
Line 1 35 0
8
4
: 11(fvec4) Load 52(outv)
8
5
: 11(fvec4) CompositeConstruct 28 28 28 28
8
6: 11(fvec4) FAdd 84 85
Store 52(outv) 8
6
8
2
: 11(fvec4) Load 52(outv)
8
3
: 11(fvec4) CompositeConstruct 28 28 28 28
8
4: 11(fvec4) FAdd 82 83
Store 52(outv) 8
4
Line 1 36 0
Branch 8
3
81
: Label
Branch 8
1
79
: Label
Line 1 38 0
8
8
: 11(fvec4) Load 52(outv)
8
9: 11(fvec4) VectorTimesScalar 88
45
Store 52(outv) 8
9
8
6
: 11(fvec4) Load 52(outv)
8
7: 11(fvec4) VectorTimesScalar 86
45
Store 52(outv) 8
7
Line 1 39 0
90
: 11(fvec4) Load 52(outv)
91
: 11(fvec4) CompositeConstruct 28 28 28 28
9
2: 11(fvec4) FAdd 90 91
Store 52(outv) 9
2
88
: 11(fvec4) Load 52(outv)
89
: 11(fvec4) CompositeConstruct 28 28 28 28
9
0: 11(fvec4) FAdd 88 89
Store 52(outv) 9
0
Line 1 40 0
Branch 8
3
8
3
: Label
Branch 8
1
8
1
: Label
Line 1 46 0
Store 9
9
(i) 18
Branch
100
100
: Label
LoopMerge 10
2 103
None
Branch 10
4
10
4
: Label
10
5: 7(int) Load 99
(i)
10
7: 37(bool) SLessThan 105 106
BranchConditional 10
7 101 102
101
: Label
Store 9
7
(i) 18
Branch
98
98
: Label
LoopMerge 10
0 101
None
Branch 10
2
10
2
: Label
10
3: 7(int) Load 97
(i)
10
5: 37(bool) SLessThan 103 104
BranchConditional 10
5 99 100
99
: Label
Line 1 47 0
10
8
: 11(fvec4) Load 52(outv)
10
9: 11(fvec4) VectorTimesScalar 108
36
Store 52(outv) 10
9
Branch 10
3
10
3
: Label
10
6
: 11(fvec4) Load 52(outv)
10
7: 11(fvec4) VectorTimesScalar 106
36
Store 52(outv) 10
7
Branch 10
1
10
1
: Label
Line 1 46 0
1
10: 7(int) Load 99
(i)
11
2: 7(int) IAdd 110 111
Store 9
9(i) 112
Branch
100
10
2
: Label
1
08: 7(int) Load 97
(i)
11
0: 7(int) IAdd 108 109
Store 9
7(i) 110
Branch
98
10
0
: Label
Line 1 49 0
11
4: 113
(ptr) AccessChain 52(outv) 32
11
5: 10(float) Load 114
11
7: 37(bool) FOrdLessThan 115 116
SelectionMerge 1
20
None
BranchConditional 11
7 119 123
11
9
: Label
11
2: 111
(ptr) AccessChain 52(outv) 32
11
3: 10(float) Load 112
11
5: 37(bool) FOrdLessThan 113 114
SelectionMerge 1
18
None
BranchConditional 11
5 117 121
11
7
: Label
Line 1 50 0
1
21
: 11(fvec4) Load 52(outv)
12
2: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 121
Store 52(outv) 12
2
Store 11
8 122
Branch 1
20
12
3
: Label
1
19
: 11(fvec4) Load 52(outv)
12
0: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 119
Store 52(outv) 12
0
Store 11
6 120
Branch 1
18
12
1
: Label
Line 1 51 0
12
4
: 11(fvec4) Load 52(outv)
12
5: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 124
Store 52(outv) 12
5
Store 11
8 125
Branch 1
20
1
20
: Label
12
2
: 11(fvec4) Load 52(outv)
12
3: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 122
Store 52(outv) 12
3
Store 11
6 123
Branch 1
18
1
18
: Label
Return
FunctionEnd
14(foo(struct-S-i11;): 11(fvec4) Function None 12
...
...
Test/baseResults/spv.multiStructFuncall.frag.out
View file @
d2e9829a
spv.multiStructFuncall.frag
// Module Version 10000
// Generated by (magic number): 80006
// Id's are bound by 6
3
// Id's are bound by 6
6
Capability Shader
1: ExtInstImport "GLSL.std.450"
...
...
@@ -23,20 +23,21 @@ spv.multiStructFuncall.frag
Name 23 "blockName"
MemberName 23(blockName) 0 "s1"
Name 25 ""
Name 3
3 "s2
"
Name 36 "S
"
MemberName 36(S) 0 "m
"
Name 3
8 "param
"
Name 4
5
"param"
Name 3
1 "S
"
MemberName 31(S) 0 "m
"
Name 32 "arg
"
Name 3
9 "s2
"
Name 4
2
"param"
Name 48 "param"
Name 59 "param"
Name 51 "param"
Name 62 "param"
MemberDecorate 22(S) 0 ColMajor
MemberDecorate 22(S) 0 Offset 0
MemberDecorate 22(S) 0 MatrixStride 16
MemberDecorate 23(blockName) 0 Offset 0
Decorate 23(blockName) BufferBlock
Decorate 25 DescriptorSet 0
MemberDecorate 3
6
(S) 0 ColMajor
MemberDecorate 3
1
(S) 0 ColMajor
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
...
...
@@ -53,48 +54,52 @@ spv.multiStructFuncall.frag
26: TypeInt 32 1
27: 26(int) Constant 0
28: TypePointer Uniform 22(S)
32: TypePointer Private 9(S)
33(s2): 32(ptr) Variable Private
36(S): TypeStruct 8
37: TypePointer Function 36(S)
42: TypePointer Function 8
57: TypePointer Uniform 8
31(S): TypeStruct 8
34: TypePointer Function 8
38: TypePointer Private 9(S)
39(s2): 38(ptr) Variable Private
60: TypePointer Uniform 8
4(main): 2 Function None 3
5: Label
38(param): 37(ptr) Variable Function
45(param): 14(ptr) Variable Function
48(param): 37(ptr) Variable Function
59(param): 14(ptr) Variable Function
32(arg): 14(ptr) Variable Function
42(param): 14(ptr) Variable Function
48(param): 14(ptr) Variable Function
51(param): 14(ptr) Variable Function
62(param): 14(ptr) Variable Function
29: 28(ptr) AccessChain 25 27
30: 22(S) Load 29
31: 2 FunctionCall 12(fooConst(struct-S-mf441;) 30
34: 9(S) Load 33(s2)
35: 2 FunctionCall 12(fooConst(struct-S-mf441;) 34
39: 28(ptr) AccessChain 25 27
40: 22(S) Load 39
41: 8 CompositeExtract 40 0
43: 42(ptr) AccessChain 38(param) 27
Store 43 41
44: 2 FunctionCall 17(foo(struct-S-mf441;) 38(param)
46: 9(S) Load 33(s2)
Store 45(param) 46
47: 2 FunctionCall 17(foo(struct-S-mf441;) 45(param)
49: 28(ptr) AccessChain 25 27
50: 22(S) Load 49
51: 8 CompositeExtract 50 0
52: 42(ptr) AccessChain 48(param) 27
Store 52 51
53: 2 FunctionCall 20(fooOut(struct-S-mf441;) 48(param)
54: 36(S) Load 48(param)
55: 28(ptr) AccessChain 25 27
56: 8 CompositeExtract 54 0
58: 57(ptr) AccessChain 55 27
Store 58 56
60: 9(S) Load 33(s2)
Store 59(param) 60
61: 2 FunctionCall 20(fooOut(struct-S-mf441;) 59(param)
62: 9(S) Load 59(param)
Store 33(s2) 62
33: 8 CompositeExtract 30 0
35: 34(ptr) AccessChain 32(arg) 27
Store 35 33
36: 9(S) Load 32(arg)
37: 2 FunctionCall 12(fooConst(struct-S-mf441;) 36
40: 9(S) Load 39(s2)
41: 2 FunctionCall 12(fooConst(struct-S-mf441;) 40
43: 28(ptr) AccessChain 25 27
44: 22(S) Load 43
45: 8 CompositeExtract 44 0
46: 34(ptr) AccessChain 42(param) 27
Store 46 45
47: 2 FunctionCall 17(foo(struct-S-mf441;) 42(param)
49: 9(S) Load 39(s2)
Store 48(param) 49
50: 2 FunctionCall 17(foo(struct-S-mf441;) 48(param)
52: 28(ptr) AccessChain 25 27
53: 22(S) Load 52
54: 8 CompositeExtract 53 0
55: 34(ptr) AccessChain 51(param) 27
Store 55 54
56: 2 FunctionCall 20(fooOut(struct-S-mf441;) 51(param)
57: 9(S) Load 51(param)
58: 28(ptr) AccessChain 25 27
59: 8 CompositeExtract 57 0
61: 60(ptr) AccessChain 58 27
Store 61 59
63: 9(S) Load 39(s2)
Store 62(param) 63
64: 2 FunctionCall 20(fooOut(struct-S-mf441;) 62(param)
65: 9(S) Load 62(param)
Store 39(s2) 65
Return
FunctionEnd
12(fooConst(struct-S-mf441;): 2 Function None 10
...
...
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