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