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
5a57ca68
Commit
5a57ca68
authored
Sep 29, 2017
by
John Kessenich
Committed by
GitHub
Sep 29, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1078 from greg-lunarg/addopt14
Remove opaque workarounds
parents
dabd1bf2
354a54c6
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1249 additions
and
1043 deletions
+1249
-1043
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+48
-28
hlsl.aliasOpaque.frag.out
Test/baseLegalResults/hlsl.aliasOpaque.frag.out
+25
-21
hlsl.flattenOpaque.frag.out
Test/baseLegalResults/hlsl.flattenOpaque.frag.out
+44
-44
hlsl.flattenOpaqueInit.vert.out
Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out
+20
-41
hlsl.flattenOpaqueInitMix.vert.out
Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out
+27
-21
hlsl.aliasOpaque.frag.out
Test/baseResults/hlsl.aliasOpaque.frag.out
+66
-33
hlsl.array.flatten.frag.out
Test/baseResults/hlsl.array.flatten.frag.out
+161
-150
hlsl.flattenOpaque.frag.out
Test/baseResults/hlsl.flattenOpaque.frag.out
+88
-62
hlsl.flattenOpaqueInit.vert.out
Test/baseResults/hlsl.flattenOpaqueInit.vert.out
+125
-46
hlsl.flattenOpaqueInitMix.vert.out
Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out
+115
-34
hlsl.opaque-type-bug.frag.out
Test/baseResults/hlsl.opaque-type-bug.frag.out
+28
-27
hlsl.structbuffer.append.fn.frag.out
Test/baseResults/hlsl.structbuffer.append.fn.frag.out
+64
-54
hlsl.structbuffer.fn.frag.out
Test/baseResults/hlsl.structbuffer.fn.frag.out
+84
-76
hlsl.structbuffer.fn2.comp.out
Test/baseResults/hlsl.structbuffer.fn2.comp.out
+45
-43
hlsl.texture.struct.frag.out
Test/baseResults/hlsl.texture.struct.frag.out
+230
-217
hlsl.tx.overload.frag.out
Test/baseResults/hlsl.tx.overload.frag.out
+52
-33
intermediate.h
glslang/Include/intermediate.h
+1
-1
localintermediate.h
glslang/MachineIndependent/localintermediate.h
+7
-1
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+19
-108
hlslParseHelper.h
hlsl/hlslParseHelper.h
+0
-3
No files found.
SPIRV/GlslangToSpv.cpp
View file @
5a57ca68
...
...
@@ -158,6 +158,8 @@ protected:
void
declareUseOfStructMember
(
const
glslang
::
TTypeList
&
members
,
int
glslangMember
);
bool
isShaderEntryPoint
(
const
glslang
::
TIntermAggregate
*
node
);
bool
writableParam
(
glslang
::
TStorageQualifier
);
bool
originalParam
(
glslang
::
TStorageQualifier
,
const
glslang
::
TType
&
,
bool
implicitThisParam
);
void
makeFunctions
(
const
glslang
::
TIntermSequence
&
);
void
makeGlobalInitializers
(
const
glslang
::
TIntermSequence
&
);
void
visitFunctions
(
const
glslang
::
TIntermSequence
&
);
...
...
@@ -771,33 +773,41 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
{
if
(
type
.
getQualifier
().
isPipeInput
())
return
spv
::
StorageClassInput
;
else
if
(
type
.
getQualifier
().
isPipeOutput
())
if
(
type
.
getQualifier
().
isPipeOutput
())
return
spv
::
StorageClassOutput
;
else
if
(
type
.
getBasicType
()
==
glslang
::
EbtAtomicUint
)
if
(
glslangIntermediate
->
getSource
()
!=
glslang
::
EShSourceHlsl
||
type
.
getQualifier
().
storage
==
glslang
::
EvqUniform
)
{
if
(
type
.
getBasicType
()
==
glslang
::
EbtAtomicUint
)
return
spv
::
StorageClassAtomicCounter
;
else
if
(
type
.
containsOpaque
())
if
(
type
.
containsOpaque
())
return
spv
::
StorageClassUniformConstant
;
else
if
(
glslangIntermediate
->
usingStorageBuffer
()
&&
type
.
getQualifier
().
storage
==
glslang
::
EvqBuffer
)
{
}
if
(
glslangIntermediate
->
usingStorageBuffer
()
&&
type
.
getQualifier
().
storage
==
glslang
::
EvqBuffer
)
{
builder
.
addExtension
(
spv
::
E_SPV_KHR_storage_buffer_storage_class
);
return
spv
::
StorageClassStorageBuffer
;
}
else
if
(
type
.
getQualifier
().
isUniformOrBuffer
())
{
}
if
(
type
.
getQualifier
().
isUniformOrBuffer
())
{
if
(
type
.
getQualifier
().
layoutPushConstant
)
return
spv
::
StorageClassPushConstant
;
if
(
type
.
getBasicType
()
==
glslang
::
EbtBlock
)
return
spv
::
StorageClassUniform
;
else
return
spv
::
StorageClassUniformConstant
;
}
else
{
}
switch
(
type
.
getQualifier
().
storage
)
{
case
glslang
:
:
EvqShared
:
return
spv
::
StorageClassWorkgroup
;
break
;
case
glslang
:
:
EvqShared
:
return
spv
::
StorageClassWorkgroup
;
case
glslang
:
:
EvqGlobal
:
return
spv
::
StorageClassPrivate
;
case
glslang
:
:
EvqConstReadOnly
:
return
spv
::
StorageClassFunction
;
case
glslang
:
:
EvqTemporary
:
return
spv
::
StorageClassFunction
;
default
:
assert
(
0
);
return
spv
::
StorageClassFunction
;
}
break
;
}
return
spv
::
StorageClassFunction
;
}
// Return whether or not the given type is something that should be tied to a
...
...
@@ -2961,6 +2971,24 @@ bool TGlslangToSpvTraverser::isShaderEntryPoint(const glslang::TIntermAggregate*
return
node
->
getName
().
compare
(
glslangIntermediate
->
getEntryPointMangledName
().
c_str
())
==
0
;
}
// Does parameter need a place to keep writes, separate from the original?
bool
TGlslangToSpvTraverser
::
writableParam
(
glslang
::
TStorageQualifier
qualifier
)
{
return
qualifier
!=
glslang
::
EvqConstReadOnly
;
}
// Is parameter pass-by-original?
bool
TGlslangToSpvTraverser
::
originalParam
(
glslang
::
TStorageQualifier
qualifier
,
const
glslang
::
TType
&
paramType
,
bool
implicitThisParam
)
{
if
(
implicitThisParam
)
// implicit this
return
true
;
if
(
glslangIntermediate
->
getSource
()
==
glslang
::
EShSourceHlsl
)
return
false
;
return
paramType
.
containsOpaque
()
||
// sampler, etc.
(
paramType
.
getBasicType
()
==
glslang
::
EbtBlock
&&
qualifier
==
glslang
::
EvqBuffer
);
// SSBO
}
// Make all the functions, skeletally, without actually visiting their bodies.
void
TGlslangToSpvTraverser
::
makeFunctions
(
const
glslang
::
TIntermSequence
&
glslFunctions
)
{
...
...
@@ -3001,13 +3029,9 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
for
(
int
p
=
0
;
p
<
(
int
)
parameters
.
size
();
++
p
)
{
const
glslang
::
TType
&
paramType
=
parameters
[
p
]
->
getAsTyped
()
->
getType
();
spv
::
Id
typeId
=
convertGlslangToSpvType
(
paramType
);
// can we pass by reference?
if
(
paramType
.
containsOpaque
()
||
// sampler, etc.
(
paramType
.
getBasicType
()
==
glslang
::
EbtBlock
&&
paramType
.
getQualifier
().
storage
==
glslang
::
EvqBuffer
)
||
// SSBO
(
p
==
0
&&
implicitThis
))
// implicit 'this'
if
(
originalParam
(
paramType
.
getQualifier
().
storage
,
paramType
,
implicitThis
&&
p
==
0
))
typeId
=
builder
.
makePointer
(
TranslateStorageClass
(
paramType
),
typeId
);
else
if
(
paramType
.
getQualifier
().
storage
!=
glslang
::
EvqConstReadOnly
)
else
if
(
writableParam
(
paramType
.
getQualifier
().
storage
)
)
typeId
=
builder
.
makePointer
(
spv
::
StorageClassFunction
,
typeId
);
else
rValueParameters
.
insert
(
parameters
[
p
]
->
getAsSymbolNode
()
->
getId
());
...
...
@@ -3567,11 +3591,6 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
const
glslang
::
TIntermSequence
&
glslangArgs
=
node
->
getSequence
();
const
glslang
::
TQualifierList
&
qualifiers
=
node
->
getQualifierList
();
// Encapsulate lvalue logic, used in several places below, for safety.
const
auto
isLValue
=
[](
int
qualifier
,
const
glslang
::
TType
&
paramType
)
->
bool
{
return
qualifier
!=
glslang
::
EvqConstReadOnly
||
paramType
.
containsOpaque
();
};
// See comments in makeFunctions() for details about the semantics for parameter passing.
//
// These imply we need a four step process:
...
...
@@ -3590,8 +3609,9 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
builder
.
clearAccessChain
();
glslangArgs
[
a
]
->
traverse
(
this
);
argTypes
.
push_back
(
&
paramType
);
// keep outputs and opaque objects as l-values, evaluate input-only as r-values
if
(
isLValue
(
qualifiers
[
a
],
paramType
))
{
// keep outputs and pass-by-originals as l-values, evaluate others as r-values
if
(
writableParam
(
qualifiers
[
a
])
||
originalParam
(
qualifiers
[
a
],
paramType
,
function
->
hasImplicitThis
()
&&
a
==
0
))
{
// save l-value
lValues
.
push_back
(
builder
.
getAccessChain
());
}
else
{
...
...
@@ -3610,13 +3630,11 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
for
(
int
a
=
0
;
a
<
(
int
)
glslangArgs
.
size
();
++
a
)
{
const
glslang
::
TType
&
paramType
=
glslangArgs
[
a
]
->
getAsTyped
()
->
getType
();
spv
::
Id
arg
;
if
(
paramType
.
containsOpaque
()
||
(
paramType
.
getBasicType
()
==
glslang
::
EbtBlock
&&
qualifiers
[
a
]
==
glslang
::
EvqBuffer
)
||
(
a
==
0
&&
function
->
hasImplicitThis
()))
{
if
(
originalParam
(
qualifiers
[
a
],
paramType
,
function
->
hasImplicitThis
()
&&
a
==
0
))
{
builder
.
setAccessChain
(
lValues
[
lValueCount
]);
arg
=
builder
.
accessChainGetLValue
();
++
lValueCount
;
}
else
if
(
isLValue
(
qualifiers
[
a
],
paramType
))
{
}
else
if
(
writableParam
(
qualifiers
[
a
]
))
{
// need space to hold the copy
arg
=
builder
.
createVariable
(
spv
::
StorageClassFunction
,
convertGlslangToSpvType
(
paramType
),
"param"
);
if
(
qualifiers
[
a
]
==
glslang
::
EvqIn
||
qualifiers
[
a
]
==
glslang
::
EvqInOut
)
{
...
...
@@ -3643,7 +3661,9 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
lValueCount
=
0
;
for
(
int
a
=
0
;
a
<
(
int
)
glslangArgs
.
size
();
++
a
)
{
const
glslang
::
TType
&
paramType
=
glslangArgs
[
a
]
->
getAsTyped
()
->
getType
();
if
(
isLValue
(
qualifiers
[
a
],
paramType
))
{
if
(
originalParam
(
qualifiers
[
a
],
paramType
,
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
]);
...
...
Test/baseLegalResults/hlsl.aliasOpaque.frag.out
View file @
5a57ca68
hlsl.aliasOpaque.frag
WARNING: AST will form illegal SPIR-V; need to transform to legalize
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by
6
1
// Id's are bound by
8
1
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
46
EntryPoint Fragment 4 "main"
57
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 36 "gss"
Name 37 "gtex"
Name 46 "@entryPointOutput"
Decorate 36(gss) DescriptorSet 0
Decorate 37(gtex) DescriptorSet 0
Decorate 46(@entryPointOutput) Location 0
Name 37 "gss2"
Name 39 "gss"
Name 43 "gtex"
Name 57 "@entryPointOutput"
Decorate 37(gss2) DescriptorSet 0
Decorate 39(gss) DescriptorSet 0
Decorate 43(gtex) DescriptorSet 0
Decorate 57(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer UniformConstant 6
8: TypeFloat 32
10: TypeImage 8(float) 2D sampled format:Unknown
11: TypePointer UniformConstant 10
12: TypeVector 8(float) 4
25: TypeSampledImage 10
27: TypeVector 8(float) 2
28: 8(float) Constant 1045220557
29: 8(float) Constant 1050253722
30: 27(fvec2) ConstantComposite 28 29
36(gss): 7(ptr) Variable UniformConstant
37(gtex): 11(ptr) Variable UniformConstant
39: 8(float) Constant 1077936128
45: TypePointer Output 12(fvec4)
46(@entryPointOutput): 45(ptr) Variable Output
36: TypePointer UniformConstant 6
37(gss2): 36(ptr) Variable UniformConstant
39(gss): 36(ptr) Variable UniformConstant
42: TypePointer UniformConstant 10
43(gtex): 42(ptr) Variable UniformConstant
46: 8(float) Constant 1077936128
56: TypePointer Output 12(fvec4)
57(@entryPointOutput): 56(ptr) Variable Output
4(main): 2 Function None 3
5: Label
56: 10 Load 37(gtex
)
57: 6 Load 36(gss
)
58: 25 SampledImage 56 57
59: 12(fvec4) ImageSampleImplicitLod 5
8 30
60: 12(fvec4) VectorTimesScalar 59 39
Store
46(@entryPointOutput) 6
0
68: 6 Load 39(gss
)
69: 10 Load 43(gtex
)
78: 25 SampledImage 69 68
79: 12(fvec4) ImageSampleImplicitLod 7
8 30
80: 12(fvec4) VectorTimesScalar 79 46
Store
57(@entryPointOutput) 8
0
Return
FunctionEnd
Test/baseLegalResults/hlsl.flattenOpaque.frag.out
View file @
5a57ca68
hlsl.flattenOpaque.frag
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 1
18
// Id's are bound by 1
44
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
83
EntryPoint Fragment 4 "main"
97
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 3
7
"tex"
Name
68
"s.s2D"
Name 7
3
"s2.s2D"
Name
74
"s2.tex"
Name
83
"@entryPointOutput"
Decorate 3
7
(tex) DescriptorSet 0
Decorate
68
(s.s2D) DescriptorSet 0
Decorate 7
3
(s2.s2D) DescriptorSet 0
Decorate
74
(s2.tex) DescriptorSet 0
Decorate
83
(@entryPointOutput) Location 0
Name 3
8
"tex"
Name
70
"s.s2D"
Name 7
9
"s2.s2D"
Name
80
"s2.tex"
Name
97
"@entryPointOutput"
Decorate 3
8
(tex) DescriptorSet 0
Decorate
70
(s.s2D) DescriptorSet 0
Decorate 7
9
(s2.s2D) DescriptorSet 0
Decorate
80
(s2.tex) DescriptorSet 0
Decorate
97
(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer UniformConstant 6
8: TypeFloat 32
9: TypeVector 8(float) 4
14: TypeVector 8(float) 2
21: TypeImage 8(float) 2D sampled format:Unknown
22: TypePointer UniformConstant 21
37(tex): 22(ptr) Variable UniformConstant
40: TypeSampledImage 21
42: 8(float) Constant 1045220557
43: 8(float) Constant 1050253722
44: 14(fvec2) ConstantComposite 42 43
68(s.s2D): 7(ptr) Variable UniformConstant
73(s2.s2D): 7(ptr) Variable UniformConstant
74(s2.tex): 22(ptr) Variable UniformConstant
82: TypePointer Output 9(fvec4)
83(@entryPointOutput): 82(ptr) Variable Output
37: TypePointer UniformConstant 21
38(tex): 37(ptr) Variable UniformConstant
41: TypeSampledImage 21
43: 8(float) Constant 1045220557
44: 8(float) Constant 1050253722
45: 14(fvec2) ConstantComposite 43 44
69: TypePointer UniformConstant 6
70(s.s2D): 69(ptr) Variable UniformConstant
79(s2.s2D): 69(ptr) Variable UniformConstant
80(s2.tex): 37(ptr) Variable UniformConstant
96: TypePointer Output 9(fvec4)
97(@entryPointOutput): 96(ptr) Variable Output
4(main): 2 Function None 3
5: Label
97: 21 Load 37(tex
)
98: 6 Load 68(s.s2D
)
99: 40 SampledImage 97 98
1
00: 9(fvec4) ImageSampleImplicitLod 99 44
1
02: 21 Load 37(tex
)
1
03: 6 Load 68(s.s2D
)
1
04: 40 SampledImage 102 103
1
06: 9(fvec4) ImageSampleImplicitLod 104 44
91: 9(fvec4) FAdd 100 106
1
08: 21 Load 74(s2.tex
)
1
09: 6 Load 73(s2.s2D
)
1
10: 40 SampledImage 108 109
1
11: 9(fvec4) ImageSampleImplicitLod 110 44
93: 9(fvec4) FAdd 91 111
11
3: 21 Load 74(s2.tex
)
11
4: 6 Load 73(s2.s2D
)
1
15: 40 SampledImage 113 114
1
17: 9(fvec4) ImageSampleImplicitLod 115 44
95: 9(fvec4) FAdd 93 117
Store
83(@entryPointOutput) 95
109: 6 Load 70(s.s2D
)
123: 21 Load 38(tex
)
125: 41 SampledImage 123 109
1
26: 9(fvec4) ImageSampleImplicitLod 125 45
1
11: 6 Load 70(s.s2D
)
1
28: 21 Load 38(tex
)
1
30: 41 SampledImage 128 111
1
32: 9(fvec4) ImageSampleImplicitLod 130 45
113: 9(fvec4) FAdd 126 132
1
14: 6 Load 79(s2.s2D
)
1
15: 21 Load 80(s2.tex
)
1
36: 41 SampledImage 115 114
1
37: 9(fvec4) ImageSampleImplicitLod 136 45
117: 9(fvec4) FAdd 113 137
11
8: 6 Load 79(s2.s2D
)
11
9: 21 Load 80(s2.tex
)
1
41: 41 SampledImage 119 118
1
43: 9(fvec4) ImageSampleImplicitLod 141 45
121: 9(fvec4) FAdd 117 143
Store
97(@entryPointOutput) 121
Return
FunctionEnd
Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out
View file @
5a57ca68
hlsl.flattenOpaqueInit.vert
WARNING: 0:20: '=' : cannot do member-wise aliasing for opaque members with this initializer
WARNING: AST will form illegal SPIR-V; need to transform to legalize
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by
76
// Id's are bound by
117
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main"
5
8
EntryPoint Vertex 4 "main"
7
8
Source HLSL 500
Name 4 "main"
Name 17 "FxaaTex"
MemberName 17(FxaaTex) 0 "smpl"
MemberName 17(FxaaTex) 1 "tex"
Name 36 "g_tInputTexture_sampler"
Name 37 "g_tInputTexture"
Name 39 "t"
Name 43 "flattenTemp"
Name 45 "tex2.smpl"
Name 50 "tex2.tex"
Name 58 "@entryPointOutput"
Decorate 36(g_tInputTexture_sampler) DescriptorSet 0
Decorate 37(g_tInputTexture) DescriptorSet 0
Decorate 58(@entryPointOutput) Location 0
Name 38 "g_tInputTexture_sampler"
Name 42 "g_tInputTexture"
Name 78 "@entryPointOutput"
Decorate 38(g_tInputTexture_sampler) DescriptorSet 0
Decorate 42(g_tInputTexture) DescriptorSet 0
Decorate 78(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer UniformConstant 6
8: TypeFloat 32
9: TypeImage 8(float) 2D sampled format:Unknown
10: TypePointer UniformConstant 9
11: TypeVector 8(float) 4
17(FxaaTex): TypeStruct 6 9
26: TypeSampledImage 9
...
...
@@ -39,32 +32,18 @@ WARNING: 0:20: '=' : cannot do member-wise aliasing for opaque members with this
30: 8(float) Constant 1053609165
31: 28(fvec2) ConstantComposite 29 30
32: 8(float) Constant 0
36(g_tInputTexture_sampler): 7(ptr) Variable UniformConstant
37(g_tInputTexture): 10(ptr) Variable UniformConstant
38: TypePointer UniformConstant 17(FxaaTex)
39(t): 38(ptr) Variable UniformConstant
43(flattenTemp): 38(ptr) Variable UniformConstant
45(tex2.smpl): 7(ptr) Variable UniformConstant
46: TypeInt 32 1
47: 46(int) Constant 0
50(tex2.tex): 10(ptr) Variable UniformConstant
51: 46(int) Constant 1
57: TypePointer Output 11(fvec4)
58(@entryPointOutput): 57(ptr) Variable Output
37: TypePointer UniformConstant 6
38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant
41: TypePointer UniformConstant 9
42(g_tInputTexture): 41(ptr) Variable UniformConstant
77: TypePointer Output 11(fvec4)
78(@entryPointOutput): 77(ptr) Variable Output
4(main): 2 Function None 3
5: Label
70: 17(FxaaTex) Load 39(t)
Store 43(flattenTemp) 70
63: 7(ptr) AccessChain 43(flattenTemp) 47
64: 6 Load 63
Store 45(tex2.smpl) 64
65: 10(ptr) AccessChain 43(flattenTemp) 51
66: 9 Load 65
Store 50(tex2.tex) 66
72: 9 Load 37(g_tInputTexture)
73: 6 Load 36(g_tInputTexture_sampler)
74: 26 SampledImage 72 73
75: 11(fvec4) ImageSampleExplicitLod 74 31 Lod 32
Store 58(@entryPointOutput) 75
90: 6 Load 38(g_tInputTexture_sampler)
91: 9 Load 42(g_tInputTexture)
115: 26 SampledImage 91 90
116: 11(fvec4) ImageSampleExplicitLod 115 31 Lod 32
Store 78(@entryPointOutput) 116
Return
FunctionEnd
Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out
View file @
5a57ca68
hlsl.flattenOpaqueInitMix.vert
WARNING: AST will form illegal SPIR-V; need to transform to legalize
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by
6
0
// Id's are bound by
10
0
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main"
44
EntryPoint Vertex 4 "main"
68
Source HLSL 500
Name 4 "main"
Name 36 "g_tInputTexture_sampler"
Name 37 "g_tInputTexture"
Name 44 "@entryPointOutput"
Decorate 36(g_tInputTexture_sampler) DescriptorSet 0
Decorate 37(g_tInputTexture) DescriptorSet 0
Decorate 44(@entryPointOutput) Location 0
Name 34 "FxaaTex"
MemberName 34(FxaaTex) 0 "smpl"
MemberName 34(FxaaTex) 1 "tex"
MemberName 34(FxaaTex) 2 "f"
Name 38 "g_tInputTexture_sampler"
Name 41 "g_tInputTexture"
Name 68 "@entryPointOutput"
Decorate 38(g_tInputTexture_sampler) DescriptorSet 0
Decorate 41(g_tInputTexture) DescriptorSet 0
Decorate 68(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer UniformConstant 6
8: TypeFloat 32
9: TypeImage 8(float) 2D sampled format:Unknown
10: TypePointer UniformConstant 9
12: TypeVector 8(float) 4
24: TypeSampledImage 9
28: TypeVector 8(float) 2
30: 8(float) Constant 0
35: 8(float) Constant 1056964608
36(g_tInputTexture_sampler): 7(ptr) Variable UniformConstant
37(g_tInputTexture): 10(ptr) Variable UniformConstant
43: TypePointer Output 12(fvec4)
44(@entryPointOutput): 43(ptr) Variable Output
34(FxaaTex): TypeStruct 6 9 8(float)
37: TypePointer UniformConstant 6
38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant
40: TypePointer UniformConstant 9
41(g_tInputTexture): 40(ptr) Variable UniformConstant
43: 8(float) Constant 1056964608
67: TypePointer Output 12(fvec4)
68(@entryPointOutput): 67(ptr) Variable Output
4(main): 2 Function None 3
5: Label
53: 9 Load 37(g_tInputTexture
)
54: 6 Load 36(g_tInputTexture_sampler
)
55: 24 SampledImage 53 54
58: 28(fvec2) CompositeConstruct 35 35
59: 12(fvec4) ImageSampleExplicitLod 55 5
8 Lod 30
Store
44(@entryPointOutput) 5
9
79: 6 Load 38(g_tInputTexture_sampler
)
80: 9 Load 41(g_tInputTexture
)
95: 24 SampledImage 80 79
98: 28(fvec2) CompositeConstruct 43 43
99: 12(fvec4) ImageSampleExplicitLod 95 9
8 Lod 30
Store
68(@entryPointOutput) 9
9
Return
FunctionEnd
Test/baseResults/hlsl.aliasOpaque.frag.out
View file @
5a57ca68
hlsl.aliasOpaque.frag
WARNING: AST will form illegal SPIR-V; need to transform to legalize
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
...
...
@@ -21,8 +22,14 @@ gl_FragCoord origin is upper left
0:17 Function Definition: @main( ( temp 4-component vector of float)
0:17 Function Parameters:
0:? Sequence
0:19 move second child to first child ( temp sampler)
0:? 'os.ss' ( temp sampler)
0:19 'gss2' ( uniform sampler)
0:20 move second child to first child ( temp sampler)
0:? 'os.ss' ( temp sampler)
0:20 'gss' ( uniform sampler)
0:21 move second child to first child ( temp texture2D)
0:? 'os.tex' ( temp texture2D)
0:21 'gtex' ( uniform texture2D)
0:22 move second child to first child ( temp float)
0:? 'os.a' ( temp float)
...
...
@@ -30,9 +37,9 @@ gl_FragCoord origin is upper left
0:22 3.000000
0:28 Branch: Return with expression
0:28 Function Call: osCall(struct-OS-p1-f1-t211; ( temp 4-component vector of float)
0:? '
gss' ( uniform
sampler)
0:? '
os.ss' ( temp
sampler)
0:? 'os.a' ( temp float)
0:? '
gtex' ( uniform
texture2D)
0:? '
os.tex' ( temp
texture2D)
0:17 Function Definition: main( ( temp void)
0:17 Function Parameters:
0:? Sequence
...
...
@@ -71,8 +78,14 @@ gl_FragCoord origin is upper left
0:17 Function Definition: @main( ( temp 4-component vector of float)
0:17 Function Parameters:
0:? Sequence
0:19 move second child to first child ( temp sampler)
0:? 'os.ss' ( temp sampler)
0:19 'gss2' ( uniform sampler)
0:20 move second child to first child ( temp sampler)
0:? 'os.ss' ( temp sampler)
0:20 'gss' ( uniform sampler)
0:21 move second child to first child ( temp texture2D)
0:? 'os.tex' ( temp texture2D)
0:21 'gtex' ( uniform texture2D)
0:22 move second child to first child ( temp float)
0:? 'os.a' ( temp float)
...
...
@@ -80,9 +93,9 @@ gl_FragCoord origin is upper left
0:22 3.000000
0:28 Branch: Return with expression
0:28 Function Call: osCall(struct-OS-p1-f1-t211; ( temp 4-component vector of float)
0:? '
gss' ( uniform
sampler)
0:? '
os.ss' ( temp
sampler)
0:? 'os.a' ( temp float)
0:? '
gtex' ( uniform
texture2D)
0:? '
os.tex' ( temp
texture2D)
0:17 Function Definition: main( ( temp void)
0:17 Function Parameters:
0:? Sequence
...
...
@@ -97,12 +110,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by
48
// Id's are bound by
59
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
46
EntryPoint Fragment 4 "main"
57
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
...
...
@@ -111,24 +124,28 @@ gl_FragCoord origin is upper left
Name 15 "s.a"
Name 16 "s.tex"
Name 20 "@main("
Name 35 "gss2"
Name 36 "gss"
Name 37 "gtex"
Name 38 "os.a"
Name 40 "param"
Name 46 "@entryPointOutput"
Decorate 35(gss2) DescriptorSet 0
Decorate 36(gss) DescriptorSet 0
Decorate 37(gtex) DescriptorSet 0
Decorate 46(@entryPointOutput) Location 0
Name 35 "os.ss"
Name 37 "gss2"
Name 39 "gss"
Name 41 "os.tex"
Name 43 "gtex"
Name 45 "os.a"
Name 47 "param"
Name 49 "param"
Name 51 "param"
Name 57 "@entryPointOutput"
Decorate 37(gss2) DescriptorSet 0
Decorate 39(gss) DescriptorSet 0
Decorate 43(gtex) DescriptorSet 0
Decorate 57(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer
UniformConstant
6
7: TypePointer
Function
6
8: TypeFloat 32
9: TypePointer Function 8(float)
10: TypeImage 8(float) 2D sampled format:Unknown
11: TypePointer
UniformConstant
10
11: TypePointer
Function
10
12: TypeVector 8(float) 4
13: TypeFunction 12(fvec4) 7(ptr) 9(ptr) 11(ptr)
19: TypeFunction 12(fvec4)
...
...
@@ -137,16 +154,18 @@ gl_FragCoord origin is upper left
28: 8(float) Constant 1045220557
29: 8(float) Constant 1050253722
30: 27(fvec2) ConstantComposite 28 29
35(gss2): 7(ptr) Variable UniformConstant
36(gss): 7(ptr) Variable UniformConstant
37(gtex): 11(ptr) Variable UniformConstant
39: 8(float) Constant 1077936128
45: TypePointer Output 12(fvec4)
46(@entryPointOutput): 45(ptr) Variable Output
36: TypePointer UniformConstant 6
37(gss2): 36(ptr) Variable UniformConstant
39(gss): 36(ptr) Variable UniformConstant
42: TypePointer UniformConstant 10
43(gtex): 42(ptr) Variable UniformConstant
46: 8(float) Constant 1077936128
56: TypePointer Output 12(fvec4)
57(@entryPointOutput): 56(ptr) Variable Output
4(main): 2 Function None 3
5: Label
47
: 12(fvec4) FunctionCall 20(@main()
Store
46(@entryPointOutput) 47
58
: 12(fvec4) FunctionCall 20(@main()
Store
57(@entryPointOutput) 58
Return
FunctionEnd
17(osCall(struct-OS-p1-f1-t211;): 12(fvec4) Function None 13
...
...
@@ -164,11 +183,25 @@ gl_FragCoord origin is upper left
FunctionEnd
20(@main(): 12(fvec4) Function None 19
21: Label
38(os.a): 9(ptr) Variable Function
40(param): 9(ptr) Variable Function
Store 38(os.a) 39
41: 8(float) Load 38(os.a)
Store 40(param) 41
42: 12(fvec4) FunctionCall 17(osCall(struct-OS-p1-f1-t211;) 36(gss) 40(param) 37(gtex)
ReturnValue 42
35(os.ss): 7(ptr) Variable Function
41(os.tex): 11(ptr) Variable Function
45(os.a): 9(ptr) Variable Function
47(param): 7(ptr) Variable Function
49(param): 9(ptr) Variable Function
51(param): 11(ptr) Variable Function
38: 6 Load 37(gss2)
Store 35(os.ss) 38
40: 6 Load 39(gss)
Store 35(os.ss) 40
44: 10 Load 43(gtex)
Store 41(os.tex) 44
Store 45(os.a) 46
48: 6 Load 35(os.ss)
Store 47(param) 48
50: 8(float) Load 45(os.a)
Store 49(param) 50
52: 10 Load 41(os.tex)
Store 51(param) 52
53: 12(fvec4) FunctionCall 17(osCall(struct-OS-p1-f1-t211;) 47(param) 49(param) 51(param)
ReturnValue 53
FunctionEnd
Test/baseResults/hlsl.array.flatten.frag.out
View file @
5a57ca68
hlsl.array.flatten.frag
WARNING: AST will form illegal SPIR-V; need to transform to legalize
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
...
...
@@ -345,13 +346,13 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 1
37
// Id's are bound by 1
43
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 1
28
EntryPoint Fragment 4 "main" 1
34
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
...
...
@@ -366,60 +367,62 @@ gl_FragCoord origin is upper left
Name 34 "not_flattened_a"
Name 42 "g_tex[1]"
Name 45 "g_samp[1]"
Name 61 "local_sampler_array"
Name 63 "g_samp[0]"
Name 68 "g_samp[2]"
Name 71 "local_texture_array"
Name 72 "g_tex[0]"
Name 77 "g_tex[2]"
Name 83 "local_float_array"
Name 89 "$Global"
MemberName 89($Global) 0 "g_mats"
MemberName 89($Global) 1 "g_mats_explicit"
MemberName 89($Global) 2 "g_floats"
Name 91 ""
Name 105 "aggShadow"
Name 112 "aggShadow"
Name 123 "ps_output"
Name 124 "param"
Name 128 "ps_output.color"
Name 131 "g_tex_explicit[0]"
Name 132 "g_tex_explicit[1]"
Name 133 "g_tex_explicit[2]"
Name 134 "g_samp_explicit[0]"
Name 135 "g_samp_explicit[1]"
Name 136 "g_samp_explicit[2]"
Name 63 "local_sampler_array"
Name 65 "g_samp[0]"
Name 70 "g_samp[2]"
Name 73 "local_texture_array"
Name 74 "g_tex[0]"
Name 79 "g_tex[2]"
Name 85 "local_float_array"
Name 91 "$Global"
MemberName 91($Global) 0 "g_mats"
MemberName 91($Global) 1 "g_mats_explicit"
MemberName 91($Global) 2 "g_floats"
Name 93 ""
Name 107 "aggShadow"
Name 114 "aggShadow"
Name 121 "param"
Name 123 "param"
Name 129 "ps_output"
Name 130 "param"
Name 134 "ps_output.color"
Name 137 "g_tex_explicit[0]"
Name 138 "g_tex_explicit[1]"
Name 139 "g_tex_explicit[2]"
Name 140 "g_samp_explicit[0]"
Name 141 "g_samp_explicit[1]"
Name 142 "g_samp_explicit[2]"
Decorate 42(g_tex[1]) DescriptorSet 0
Decorate 45(g_samp[1]) DescriptorSet 0
Decorate 6
3
(g_samp[0]) DescriptorSet 0
Decorate
68
(g_samp[2]) DescriptorSet 0
Decorate 7
2
(g_tex[0]) DescriptorSet 0
Decorate 7
7
(g_tex[2]) DescriptorSet 0
Decorate 8
6
ArrayStride 48
Decorate 8
7
ArrayStride 48
Decorate
88
ArrayStride 16
MemberDecorate
89
($Global) 0 RowMajor
MemberDecorate
89
($Global) 0 Offset 0
MemberDecorate
89
($Global) 0 MatrixStride 16
MemberDecorate
89
($Global) 1 RowMajor
MemberDecorate
89
($Global) 1 Offset 192
MemberDecorate
89
($Global) 1 MatrixStride 16
MemberDecorate
89
($Global) 2 Offset 384
Decorate
89
($Global) Block
Decorate 9
1
DescriptorSet 0
Decorate 1
28
(ps_output.color) Location 0
Decorate 13
1
(g_tex_explicit[0]) DescriptorSet 0
Decorate 13
1
(g_tex_explicit[0]) Binding 1
Decorate 13
2
(g_tex_explicit[1]) DescriptorSet 0
Decorate 13
2
(g_tex_explicit[1]) Binding 2
Decorate 13
3
(g_tex_explicit[2]) DescriptorSet 0
Decorate 13
3
(g_tex_explicit[2]) Binding 3
Decorate 1
34
(g_samp_explicit[0]) DescriptorSet 0
Decorate 1
34
(g_samp_explicit[0]) Binding 5
Decorate 1
35
(g_samp_explicit[1]) DescriptorSet 0
Decorate 1
35
(g_samp_explicit[1]) Binding 6
Decorate 1
36
(g_samp_explicit[2]) DescriptorSet 0
Decorate 1
36
(g_samp_explicit[2]) Binding 7
Decorate 6
5
(g_samp[0]) DescriptorSet 0
Decorate
70
(g_samp[2]) DescriptorSet 0
Decorate 7
4
(g_tex[0]) DescriptorSet 0
Decorate 7
9
(g_tex[2]) DescriptorSet 0
Decorate 8
8
ArrayStride 48
Decorate 8
9
ArrayStride 48
Decorate
90
ArrayStride 16
MemberDecorate
91
($Global) 0 RowMajor
MemberDecorate
91
($Global) 0 Offset 0
MemberDecorate
91
($Global) 0 MatrixStride 16
MemberDecorate
91
($Global) 1 RowMajor
MemberDecorate
91
($Global) 1 Offset 192
MemberDecorate
91
($Global) 1 MatrixStride 16
MemberDecorate
91
($Global) 2 Offset 384
Decorate
91
($Global) Block
Decorate 9
3
DescriptorSet 0
Decorate 1
34
(ps_output.color) Location 0
Decorate 13
7
(g_tex_explicit[0]) DescriptorSet 0
Decorate 13
7
(g_tex_explicit[0]) Binding 1
Decorate 13
8
(g_tex_explicit[1]) DescriptorSet 0
Decorate 13
8
(g_tex_explicit[1]) Binding 2
Decorate 13
9
(g_tex_explicit[2]) DescriptorSet 0
Decorate 13
9
(g_tex_explicit[2]) Binding 3
Decorate 1
40
(g_samp_explicit[0]) DescriptorSet 0
Decorate 1
40
(g_samp_explicit[0]) Binding 5
Decorate 1
41
(g_samp_explicit[1]) DescriptorSet 0
Decorate 1
41
(g_samp_explicit[1]) Binding 6
Decorate 1
42
(g_samp_explicit[2]) DescriptorSet 0
Decorate 1
42
(g_samp_explicit[2]) Binding 7
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
...
...
@@ -429,10 +432,10 @@ gl_FragCoord origin is upper left
12: TypeInt 32 0
13: 12(int) Constant 3
14: TypeArray 11 13
15: TypePointer
UniformConstant
14
15: TypePointer
Function
14
16: TypeSampler
17: TypeArray 16 13
18: TypePointer
UniformConstant
17
18: TypePointer
Function
17
19: TypeFunction 7(fvec4) 15(ptr) 18(ptr)
24(PS_OUTPUT): TypeStruct 7(fvec4)
25: TypePointer Function 24(PS_OUTPUT)
...
...
@@ -454,48 +457,46 @@ gl_FragCoord origin is upper left
45(g_samp[1]): 44(ptr) Variable UniformConstant
47: TypeSampledImage 11
49: 6(float) Constant 1045220557
61(local_sampler_array): 18(ptr) Variable UniformConstant
62: 30(int) Constant 0
63(g_samp[0]): 44(ptr) Variable UniformConstant
68(g_samp[2]): 44(ptr) Variable UniformConstant
71(local_texture_array): 15(ptr) Variable UniformConstant
72(g_tex[0]): 41(ptr) Variable UniformConstant
77(g_tex[2]): 41(ptr) Variable UniformConstant
80: 12(int) Constant 4
81: TypeArray 6(float) 80
82: TypePointer Function 81
84: TypeVector 6(float) 3
85: TypeMatrix 84(fvec3) 3
86: TypeArray 85 80
87: TypeArray 85 80
88: TypeArray 6(float) 80
89($Global): TypeStruct 86 87 88
90: TypePointer Uniform 89($Global)
91: 90(ptr) Variable Uniform
92: TypePointer Uniform 88
96: TypePointer Function 6(float)
105(aggShadow): 15(ptr) Variable UniformConstant
112(aggShadow): 18(ptr) Variable UniformConstant
121: TypePointer Function 7(fvec4)
127: TypePointer Output 7(fvec4)
128(ps_output.color): 127(ptr) Variable Output
131(g_tex_explicit[0]): 41(ptr) Variable UniformConstant
132(g_tex_explicit[1]): 41(ptr) Variable UniformConstant
133(g_tex_explicit[2]): 41(ptr) Variable UniformConstant
134(g_samp_explicit[0]): 44(ptr) Variable UniformConstant
135(g_samp_explicit[1]): 44(ptr) Variable UniformConstant
136(g_samp_explicit[2]): 44(ptr) Variable UniformConstant
53: TypePointer Function 11
56: TypePointer Function 16
64: 30(int) Constant 0
65(g_samp[0]): 44(ptr) Variable UniformConstant
70(g_samp[2]): 44(ptr) Variable UniformConstant
74(g_tex[0]): 41(ptr) Variable UniformConstant
79(g_tex[2]): 41(ptr) Variable UniformConstant
82: 12(int) Constant 4
83: TypeArray 6(float) 82
84: TypePointer Function 83
86: TypeVector 6(float) 3
87: TypeMatrix 86(fvec3) 3
88: TypeArray 87 82
89: TypeArray 87 82
90: TypeArray 6(float) 82
91($Global): TypeStruct 88 89 90
92: TypePointer Uniform 91($Global)
93: 92(ptr) Variable Uniform
94: TypePointer Uniform 90
98: TypePointer Function 6(float)
127: TypePointer Function 7(fvec4)
133: TypePointer Output 7(fvec4)
134(ps_output.color): 133(ptr) Variable Output
137(g_tex_explicit[0]): 41(ptr) Variable UniformConstant
138(g_tex_explicit[1]): 41(ptr) Variable UniformConstant
139(g_tex_explicit[2]): 41(ptr) Variable UniformConstant
140(g_samp_explicit[0]): 44(ptr) Variable UniformConstant
141(g_samp_explicit[1]): 44(ptr) Variable UniformConstant
142(g_samp_explicit[2]): 44(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
12
3
(ps_output): 25(ptr) Variable Function
1
24
(param): 25(ptr) Variable Function
12
9
(ps_output): 25(ptr) Variable Function
1
30
(param): 25(ptr) Variable Function
Store 34(not_flattened_a) 40
1
25: 2 FunctionCall 28(@main(struct-PS_OUTPUT-vf41;) 124
(param)
1
26:24(PS_OUTPUT) Load 124
(param)
Store 12
3(ps_output) 126
1
29: 121(ptr) AccessChain 123(ps_output) 62
13
0: 7(fvec4) Load 129
Store 1
28(ps_output.color) 130
1
31: 2 FunctionCall 28(@main(struct-PS_OUTPUT-vf41;) 130
(param)
1
32:24(PS_OUTPUT) Load 130
(param)
Store 12
9(ps_output) 132
1
35: 127(ptr) AccessChain 129(ps_output) 64
13
6: 7(fvec4) Load 135
Store 1
34(ps_output.color) 136
Return
FunctionEnd
9(TestFn1(): 7(fvec4) Function None 8
...
...
@@ -510,72 +511,82 @@ gl_FragCoord origin is upper left
20(l_tex): 15(ptr) FunctionParameter
21(l_samp): 18(ptr) FunctionParameter
23: Label
5
3: 41
(ptr) AccessChain 20(l_tex) 36
5
4: 11 Load 53
5
5: 44
(ptr) AccessChain 21(l_samp) 36
5
6: 16 Load 55
5
7: 47 SampledImage 54 56
58: 7(fvec4) ImageSampleImplicitLod 57
49
ReturnValue
58
5
4: 53
(ptr) AccessChain 20(l_tex) 36
5
5: 11 Load 54
5
7: 56
(ptr) AccessChain 21(l_samp) 36
5
8: 16 Load 57
5
9: 47 SampledImage 55 58
60: 7(fvec4) ImageSampleImplicitLod 59
49
ReturnValue
60
FunctionEnd
28(@main(struct-PS_OUTPUT-vf41;): 2 Function None 26
27(ps_output): 25(ptr) FunctionParameter
29: Label
83(local_float_array): 82(ptr) Variable Function
64: 16 Load 63(g_samp[0])
65: 44(ptr) AccessChain 61(local_sampler_array) 62
Store 65 64
66: 16 Load 45(g_samp[1])
67: 44(ptr) AccessChain 61(local_sampler_array) 35
63(local_sampler_array): 18(ptr) Variable Function
73(local_texture_array): 15(ptr) Variable Function
85(local_float_array): 84(ptr) Variable Function
107(aggShadow): 15(ptr) Variable Function
114(aggShadow): 18(ptr) Variable Function
121(param): 15(ptr) Variable Function
123(param): 18(ptr) Variable Function
66: 16 Load 65(g_samp[0])
67: 56(ptr) AccessChain 63(local_sampler_array) 64
Store 67 66
6
9: 16 Load 68(g_samp[2
])
70: 44(ptr) AccessChain 61(local_sampler_array) 36
Store
70 69
7
3: 11 Load 72(g_tex[0
])
7
4: 41(ptr) AccessChain 71(local_texture_array) 62
Store 7
4 73
75: 11 Load
42(g_tex[1
])
76:
41(ptr) AccessChain 71(local_texture_array) 35
6
8: 16 Load 45(g_samp[1
])
69: 56(ptr) AccessChain 63(local_sampler_array) 35
Store
69 68
7
1: 16 Load 70(g_samp[2
])
7
2: 56(ptr) AccessChain 63(local_sampler_array) 36
Store 7
2 71
75: 11 Load
74(g_tex[0
])
76:
53(ptr) AccessChain 73(local_texture_array) 64
Store 76 75
7
8: 11 Load 77(g_tex[2
])
7
9: 41(ptr) AccessChain 71(local_texture_array) 36
Store 7
9 78
93: 92(ptr) AccessChain 91 36
94: 88 Load 93
95: 6(float) CompositeExtract 94
0
9
7: 96(ptr) AccessChain 83(local_float_array) 62
Store 97
95
9
8: 6(float) CompositeExtract 94 1
99: 9
6(ptr) AccessChain 83(local_float_array) 35
Store 99 9
8
100: 6(float) CompositeExtract 9
4 2
101: 9
6(ptr) AccessChain 83(local_float_array) 36
7
7: 11 Load 42(g_tex[1
])
7
8: 53(ptr) AccessChain 73(local_texture_array) 35
Store 7
8 77
80: 11 Load 79(g_tex[2])
81: 53(ptr) AccessChain 73(local_texture_array) 36
Store 81 8
0
9
5: 94(ptr) AccessChain 93 36
96: 90 Load
95
9
7: 6(float) CompositeExtract 96 0
99: 9
8(ptr) AccessChain 85(local_float_array) 64
Store 99 9
7
100: 6(float) CompositeExtract 9
6 1
101: 9
8(ptr) AccessChain 85(local_float_array) 35
Store 101 100
102: 6(float) CompositeExtract 9
4 3
103: 9
6(ptr) AccessChain 83(local_float_array) 37
102: 6(float) CompositeExtract 9
6 2
103: 9
8(ptr) AccessChain 85(local_float_array) 36
Store 103 102
104:
7(fvec4) FunctionCall 9(TestFn1()
10
6: 11 Load 72(g_tex[0])
107: 41(ptr) AccessChain 105(aggShadow) 62
Store 107 106
108: 11 Load
42(g_tex[1
])
109:
41(ptr) AccessChain 105(aggShadow) 35
104:
6(float) CompositeExtract 96 3
10
5: 98(ptr) AccessChain 85(local_float_array) 37
Store 105 104
106: 7(fvec4) FunctionCall 9(TestFn1()
108: 11 Load
74(g_tex[0
])
109:
53(ptr) AccessChain 107(aggShadow) 64
Store 109 108
110: 11 Load
77(g_tex[2
])
111:
41(ptr) AccessChain 105(aggShadow) 36
110: 11 Load
42(g_tex[1
])
111:
53(ptr) AccessChain 107(aggShadow) 35
Store 111 110
11
3: 16 Load 63(g_samp[0
])
11
4: 44(ptr) AccessChain 112(aggShadow) 62
Store 11
4 113
115: 16 Load
45(g_samp[1
])
116:
44(ptr) AccessChain 112(aggShadow) 35
11
2: 11 Load 79(g_tex[2
])
11
3: 53(ptr) AccessChain 107(aggShadow) 36
Store 11
3 112
115: 16 Load
65(g_samp[0
])
116:
56(ptr) AccessChain 114(aggShadow) 64
Store 116 115
117: 16 Load
68(g_samp[2
])
118:
44(ptr) AccessChain 112(aggShadow) 36
117: 16 Load
45(g_samp[1
])
118:
56(ptr) AccessChain 114(aggShadow) 35
Store 118 117
119: 7(fvec4) FunctionCall 22(TestFn2(t11[3];p1[3];) 105(aggShadow) 112(aggShadow)
120: 7(fvec4) FAdd 104 119
122: 121(ptr) AccessChain 27(ps_output) 62
Store 122 120
119: 16 Load 70(g_samp[2])
120: 56(ptr) AccessChain 114(aggShadow) 36
Store 120 119
122: 14 Load 107(aggShadow)
Store 121(param) 122
124: 17 Load 114(aggShadow)
Store 123(param) 124
125: 7(fvec4) FunctionCall 22(TestFn2(t11[3];p1[3];) 121(param) 123(param)
126: 7(fvec4) FAdd 106 125
128: 127(ptr) AccessChain 27(ps_output) 64
Store 128 126
Return
FunctionEnd
Test/baseResults/hlsl.flattenOpaque.frag.out
View file @
5a57ca68
...
...
@@ -179,12 +179,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by
85
// Id's are bound by
99
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
83
EntryPoint Fragment 4 "main"
97
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
...
...
@@ -201,22 +201,28 @@ gl_FragCoord origin is upper left
Name 30 "s.tex"
Name 31 "f2"
Name 35 "@main("
Name 37 "tex"
Name 68 "s.s2D"
Name 70 "param"
Name 73 "s2.s2D"
Name 74 "s2.tex"
Name 77 "param"
Name 83 "@entryPointOutput"
Decorate 37(tex) DescriptorSet 0
Decorate 68(s.s2D) DescriptorSet 0
Decorate 73(s2.s2D) DescriptorSet 0
Decorate 74(s2.tex) DescriptorSet 0
Decorate 83(@entryPointOutput) Location 0
Name 38 "tex"
Name 70 "s.s2D"
Name 71 "param"
Name 74 "param"
Name 76 "param"
Name 79 "s2.s2D"
Name 80 "s2.tex"
Name 81 "param"
Name 83 "param"
Name 87 "param"
Name 89 "param"
Name 91 "param"
Name 97 "@entryPointOutput"
Decorate 38(tex) DescriptorSet 0
Decorate 70(s.s2D) DescriptorSet 0
Decorate 79(s2.s2D) DescriptorSet 0
Decorate 80(s2.tex) DescriptorSet 0
Decorate 97(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer
UniformConstant
6
7: TypePointer
Function
6
8: TypeFloat 32
9: TypeVector 8(float) 4
10: TypeFunction 9(fvec4) 7(ptr)
...
...
@@ -224,80 +230,100 @@ gl_FragCoord origin is upper left
15: TypePointer Function 14(fvec2)
16: TypeFunction 9(fvec4) 7(ptr) 15(ptr)
21: TypeImage 8(float) 2D sampled format:Unknown
22: TypePointer
UniformConstant
21
22: TypePointer
Function
21
23: TypeFunction 9(fvec4) 7(ptr) 22(ptr)
28: TypeFunction 9(fvec4) 7(ptr) 22(ptr) 15(ptr)
34: TypeFunction 9(fvec4)
37(tex): 22(ptr) Variable UniformConstant
40: TypeSampledImage 21
42: 8(float) Constant 1045220557
43: 8(float) Constant 1050253722
44: 14(fvec2) ConstantComposite 42 43
68(s.s2D): 7(ptr) Variable UniformConstant
73(s2.s2D): 7(ptr) Variable UniformConstant
74(s2.tex): 22(ptr) Variable UniformConstant
82: TypePointer Output 9(fvec4)
83(@entryPointOutput): 82(ptr) Variable Output
37: TypePointer UniformConstant 21
38(tex): 37(ptr) Variable UniformConstant
41: TypeSampledImage 21
43: 8(float) Constant 1045220557
44: 8(float) Constant 1050253722
45: 14(fvec2) ConstantComposite 43 44
69: TypePointer UniformConstant 6
70(s.s2D): 69(ptr) Variable UniformConstant
79(s2.s2D): 69(ptr) Variable UniformConstant
80(s2.tex): 37(ptr) Variable UniformConstant
96: TypePointer Output 9(fvec4)
97(@entryPointOutput): 96(ptr) Variable Output
4(main): 2 Function None 3
5: Label
84
: 9(fvec4) FunctionCall 35(@main()
Store
83(@entryPointOutput) 84
98
: 9(fvec4) FunctionCall 35(@main()
Store
97(@entryPointOutput) 98
Return
FunctionEnd
12(osCall1(struct-os-p11;): 9(fvec4) Function None 10
11(s.s2D): 7(ptr) FunctionParameter
13: Label
3
8: 21 Load 37
(tex)
39
: 6 Load 11(s.s2D)
4
1: 40 SampledImage 38 39
4
5: 9(fvec4) ImageSampleImplicitLod 41 44
ReturnValue 4
5
3
9: 21 Load 38
(tex)
40
: 6 Load 11(s.s2D)
4
2: 41 SampledImage 39 40
4
6: 9(fvec4) ImageSampleImplicitLod 42 45
ReturnValue 4
6
FunctionEnd
19(osCall2(struct-os-p11;vf2;): 9(fvec4) Function None 16
17(s.s2D): 7(ptr) FunctionParameter
18(f2): 15(ptr) FunctionParameter
20: Label
4
8: 21 Load 37
(tex)
49
: 6 Load 17(s.s2D)
5
0: 40 SampledImage 48 49
5
1
: 14(fvec2) Load 18(f2)
5
2: 9(fvec4) ImageSampleImplicitLod 50 51
ReturnValue 5
2
4
9: 21 Load 38
(tex)
50
: 6 Load 17(s.s2D)
5
1: 41 SampledImage 49 50
5
2
: 14(fvec2) Load 18(f2)
5
3: 9(fvec4) ImageSampleImplicitLod 51 52
ReturnValue 5
3
FunctionEnd
26(os2Call1(struct-os2-p1-t211;): 9(fvec4) Function None 23
24(s.s2D): 7(ptr) FunctionParameter
25(s.tex): 22(ptr) FunctionParameter
27: Label
5
5
: 21 Load 25(s.tex)
5
6
: 6 Load 24(s.s2D)
5
7: 40 SampledImage 55 56
5
8: 9(fvec4) ImageSampleImplicitLod 57 44
ReturnValue 5
8
5
6
: 21 Load 25(s.tex)
5
7
: 6 Load 24(s.s2D)
5
8: 41 SampledImage 56 57
5
9: 9(fvec4) ImageSampleImplicitLod 58 45
ReturnValue 5
9
FunctionEnd
32(os2Call2(struct-os2-p1-t211;vf2;): 9(fvec4) Function None 28
29(s.s2D): 7(ptr) FunctionParameter
30(s.tex): 22(ptr) FunctionParameter
31(f2): 15(ptr) FunctionParameter
33: Label
6
1
: 21 Load 30(s.tex)
6
2
: 6 Load 29(s.s2D)
6
3: 40 SampledImage 61 62
6
4
: 14(fvec2) Load 31(f2)
6
5: 9(fvec4) ImageSampleImplicitLod 63 64
ReturnValue 6
5
6
2
: 21 Load 30(s.tex)
6
3
: 6 Load 29(s.s2D)
6
4: 41 SampledImage 62 63
6
5
: 14(fvec2) Load 31(f2)
6
6: 9(fvec4) ImageSampleImplicitLod 64 65
ReturnValue 6
6
FunctionEnd
35(@main(): 9(fvec4) Function None 34
36: Label
70(param): 15(ptr) Variable Function
77(param): 15(ptr) Variable Function
69: 9(fvec4) FunctionCall 12(osCall1(struct-os-p11;) 68(s.s2D)
Store 70(param) 44
71: 9(fvec4) FunctionCall 19(osCall2(struct-os-p11;vf2;) 68(s.s2D) 70(param)
72: 9(fvec4) FAdd 69 71
75: 9(fvec4) FunctionCall 26(os2Call1(struct-os2-p1-t211;) 73(s2.s2D) 74(s2.tex)
76: 9(fvec4) FAdd 72 75
Store 77(param) 44
78: 9(fvec4) FunctionCall 32(os2Call2(struct-os2-p1-t211;vf2;) 73(s2.s2D) 74(s2.tex) 77(param)
79: 9(fvec4) FAdd 76 78
ReturnValue 79
71(param): 7(ptr) Variable Function
74(param): 7(ptr) Variable Function
76(param): 15(ptr) Variable Function
81(param): 7(ptr) Variable Function
83(param): 22(ptr) Variable Function
87(param): 7(ptr) Variable Function
89(param): 22(ptr) Variable Function
91(param): 15(ptr) Variable Function
72: 6 Load 70(s.s2D)
Store 71(param) 72
73: 9(fvec4) FunctionCall 12(osCall1(struct-os-p11;) 71(param)
75: 6 Load 70(s.s2D)
Store 74(param) 75
Store 76(param) 45
77: 9(fvec4) FunctionCall 19(osCall2(struct-os-p11;vf2;) 74(param) 76(param)
78: 9(fvec4) FAdd 73 77
82: 6 Load 79(s2.s2D)
Store 81(param) 82
84: 21 Load 80(s2.tex)
Store 83(param) 84
85: 9(fvec4) FunctionCall 26(os2Call1(struct-os2-p1-t211;) 81(param) 83(param)
86: 9(fvec4) FAdd 78 85
88: 6 Load 79(s2.s2D)
Store 87(param) 88
90: 21 Load 80(s2.tex)
Store 89(param) 90
Store 91(param) 45
92: 9(fvec4) FunctionCall 32(os2Call2(struct-os2-p1-t211;vf2;) 87(param) 89(param) 91(param)
93: 9(fvec4) FAdd 86 92
ReturnValue 93
FunctionEnd
Test/baseResults/hlsl.flattenOpaqueInit.vert.out
View file @
5a57ca68
hlsl.flattenOpaqueInit.vert
WARNING: 0:20: '=' : cannot do member-wise aliasing for opaque members with this initializer
WARNING: AST will form illegal SPIR-V; need to transform to legalize
Shader version: 500
0:? Sequence
0:5 Function Definition: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float)
...
...
@@ -19,13 +18,36 @@ Shader version: 500
0:10 Function Definition: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex})
0:10 Function Parameters:
0:? Sequence
0:12 move second child to first child ( temp sampler)
0:? 't.smpl' ( temp sampler)
0:12 'g_tInputTexture_sampler' ( uniform sampler)
0:13 move second child to first child ( temp texture2D)
0:? 't.tex' ( temp texture2D)
0:13 'g_tInputTexture' ( uniform texture2D)
0:14 Branch: Return with expression
0:14 't' ( temp structure{ temp sampler smpl, temp texture2D tex})
0:18 Function Definition: @main( ( temp 4-component vector of float)
0:18 Function Parameters:
0:? Sequence
0:19 Sequence
0:19 Sequence
0:19 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex})
0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex})
0:19 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex})
0:19 'g_tInputTexture_sampler' ( uniform sampler)
0:19 'g_tInputTexture' ( uniform texture2D)
0:19 move second child to first child ( temp sampler)
0:? 'tex1.smpl' ( temp sampler)
0:19 smpl: direct index for structure ( temp sampler)
0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex})
0:19 Constant:
0:19 0 (const int)
0:19 move second child to first child ( temp texture2D)
0:? 'tex1.tex' ( temp texture2D)
0:19 tex: direct index for structure ( temp texture2D)
0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex})
0:19 Constant:
0:19 1 (const int)
0:20 Sequence
0:20 Sequence
0:20 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex})
...
...
@@ -45,8 +67,8 @@ Shader version: 500
0:20 1 (const int)
0:21 Branch: Return with expression
0:21 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float)
0:? '
g_tInputTexture_sampler' ( uniform
sampler)
0:? '
g_tInputTexture' ( uniform
texture2D)
0:? '
tex1.smpl' ( temp
sampler)
0:? '
tex1.tex' ( temp
texture2D)
0:18 Function Definition: main( ( temp void)
0:18 Function Parameters:
0:? Sequence
...
...
@@ -80,13 +102,36 @@ Shader version: 500
0:10 Function Definition: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex})
0:10 Function Parameters:
0:? Sequence
0:12 move second child to first child ( temp sampler)
0:? 't.smpl' ( temp sampler)
0:12 'g_tInputTexture_sampler' ( uniform sampler)
0:13 move second child to first child ( temp texture2D)
0:? 't.tex' ( temp texture2D)
0:13 'g_tInputTexture' ( uniform texture2D)
0:14 Branch: Return with expression
0:14 't' ( temp structure{ temp sampler smpl, temp texture2D tex})
0:18 Function Definition: @main( ( temp 4-component vector of float)
0:18 Function Parameters:
0:? Sequence
0:19 Sequence
0:19 Sequence
0:19 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex})
0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex})
0:19 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex})
0:19 'g_tInputTexture_sampler' ( uniform sampler)
0:19 'g_tInputTexture' ( uniform texture2D)
0:19 move second child to first child ( temp sampler)
0:? 'tex1.smpl' ( temp sampler)
0:19 smpl: direct index for structure ( temp sampler)
0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex})
0:19 Constant:
0:19 0 (const int)
0:19 move second child to first child ( temp texture2D)
0:? 'tex1.tex' ( temp texture2D)
0:19 tex: direct index for structure ( temp texture2D)
0:19 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex})
0:19 Constant:
0:19 1 (const int)
0:20 Sequence
0:20 Sequence
0:20 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex})
...
...
@@ -106,8 +151,8 @@ Shader version: 500
0:20 1 (const int)
0:21 Branch: Return with expression
0:21 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float)
0:? '
g_tInputTexture_sampler' ( uniform
sampler)
0:? '
g_tInputTexture' ( uniform
texture2D)
0:? '
tex1.smpl' ( temp
sampler)
0:? '
tex1.tex' ( temp
texture2D)
0:18 Function Definition: main( ( temp void)
0:18 Function Parameters:
0:? Sequence
...
...
@@ -121,12 +166,12 @@ Shader version: 500
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by
6
0
// Id's are bound by
8
0
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main"
5
8
EntryPoint Vertex 4 "main"
7
8
Source HLSL 500
Name 4 "main"
Name 15 "lookUp(struct-FxaaTex-p1-t211;"
...
...
@@ -137,23 +182,30 @@ Shader version: 500
MemberName 17(FxaaTex) 1 "tex"
Name 19 "fillOpaque("
Name 22 "@main("
Name 36 "g_tInputTexture_sampler"
Name 37 "g_tInputTexture"
Name 39 "t"
Name 43 "flattenTemp"
Name 45 "tex2.smpl"
Name 50 "tex2.tex"
Name 58 "@entryPointOutput"
Decorate 36(g_tInputTexture_sampler) DescriptorSet 0
Decorate 37(g_tInputTexture) DescriptorSet 0
Decorate 58(@entryPointOutput) Location 0
Name 36 "t.smpl"
Name 38 "g_tInputTexture_sampler"
Name 40 "t.tex"
Name 42 "g_tInputTexture"
Name 45 "t"
Name 49 "flattenTemp"
Name 53 "tex1.smpl"
Name 58 "tex1.tex"
Name 62 "flattenTemp"
Name 64 "tex2.smpl"
Name 67 "tex2.tex"
Name 70 "param"
Name 72 "param"
Name 78 "@entryPointOutput"
Decorate 38(g_tInputTexture_sampler) DescriptorSet 0
Decorate 42(g_tInputTexture) DescriptorSet 0
Decorate 78(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer
UniformConstant
6
7: TypePointer
Function
6
8: TypeFloat 32
9: TypeImage 8(float) 2D sampled format:Unknown
10: TypePointer
UniformConstant
9
10: TypePointer
Function
9
11: TypeVector 8(float) 4
12: TypeFunction 11(fvec4) 7(ptr) 10(ptr)
17(FxaaTex): TypeStruct 6 9
...
...
@@ -165,22 +217,20 @@ Shader version: 500
30: 8(float) Constant 1053609165
31: 28(fvec2) ConstantComposite 29 30
32: 8(float) Constant 0
36(g_tInputTexture_sampler): 7(ptr) Variable UniformConstant
37(g_tInputTexture): 10(ptr) Variable UniformConstant
38: TypePointer UniformConstant 17(FxaaTex)
39(t): 38(ptr) Variable UniformConstant
43(flattenTemp): 38(ptr) Variable UniformConstant
45(tex2.smpl): 7(ptr) Variable UniformConstant
46: TypeInt 32 1
47: 46(int) Constant 0
50(tex2.tex): 10(ptr) Variable UniformConstant
51: 46(int) Constant 1
57: TypePointer Output 11(fvec4)
58(@entryPointOutput): 57(ptr) Variable Output
37: TypePointer UniformConstant 6
38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant
41: TypePointer UniformConstant 9
42(g_tInputTexture): 41(ptr) Variable UniformConstant
44: TypePointer Function 17(FxaaTex)
54: TypeInt 32 1
55: 54(int) Constant 0
59: 54(int) Constant 1
77: TypePointer Output 11(fvec4)
78(@entryPointOutput): 77(ptr) Variable Output
4(main): 2 Function None 3
5: Label
5
9: 11(fvec4) FunctionCall 22(@main()
Store
58(@entryPointOutput) 5
9
7
9: 11(fvec4) FunctionCall 22(@main()
Store
78(@entryPointOutput) 7
9
Return
FunctionEnd
15(lookUp(struct-FxaaTex-p1-t211;): 11(fvec4) Function None 12
...
...
@@ -195,19 +245,48 @@ Shader version: 500
FunctionEnd
19(fillOpaque(): 17(FxaaTex) Function None 18
20: Label
40: 17(FxaaTex) Load 39(t)
ReturnValue 40
36(t.smpl): 7(ptr) Variable Function
40(t.tex): 10(ptr) Variable Function
45(t): 44(ptr) Variable Function
39: 6 Load 38(g_tInputTexture_sampler)
Store 36(t.smpl) 39
43: 9 Load 42(g_tInputTexture)
Store 40(t.tex) 43
46: 17(FxaaTex) Load 45(t)
ReturnValue 46
FunctionEnd
22(@main(): 11(fvec4) Function None 21
23: Label
44: 17(FxaaTex) FunctionCall 19(fillOpaque()
Store 43(flattenTemp) 44
48: 7(ptr) AccessChain 43(flattenTemp) 47
49: 6 Load 48
Store 45(tex2.smpl) 49
52: 10(ptr) AccessChain 43(flattenTemp) 51
53: 9 Load 52
Store 50(tex2.tex) 53
54: 11(fvec4) FunctionCall 15(lookUp(struct-FxaaTex-p1-t211;) 36(g_tInputTexture_sampler) 37(g_tInputTexture)
ReturnValue 54
49(flattenTemp): 44(ptr) Variable Function
53(tex1.smpl): 7(ptr) Variable Function
58(tex1.tex): 10(ptr) Variable Function
62(flattenTemp): 44(ptr) Variable Function
64(tex2.smpl): 7(ptr) Variable Function
67(tex2.tex): 10(ptr) Variable Function
70(param): 7(ptr) Variable Function
72(param): 10(ptr) Variable Function
50: 6 Load 38(g_tInputTexture_sampler)
51: 9 Load 42(g_tInputTexture)
52: 17(FxaaTex) CompositeConstruct 50 51
Store 49(flattenTemp) 52
56: 7(ptr) AccessChain 49(flattenTemp) 55
57: 6 Load 56
Store 53(tex1.smpl) 57
60: 10(ptr) AccessChain 49(flattenTemp) 59
61: 9 Load 60
Store 58(tex1.tex) 61
63: 17(FxaaTex) FunctionCall 19(fillOpaque()
Store 62(flattenTemp) 63
65: 7(ptr) AccessChain 62(flattenTemp) 55
66: 6 Load 65
Store 64(tex2.smpl) 66
68: 10(ptr) AccessChain 62(flattenTemp) 59
69: 9 Load 68
Store 67(tex2.tex) 69
71: 6 Load 53(tex1.smpl)
Store 70(param) 71
73: 9 Load 58(tex1.tex)
Store 72(param) 73
74: 11(fvec4) FunctionCall 15(lookUp(struct-FxaaTex-p1-t211;) 70(param) 72(param)
ReturnValue 74
FunctionEnd
Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out
View file @
5a57ca68
hlsl.flattenOpaqueInitMix.vert
WARNING: AST will form illegal SPIR-V; need to transform to legalize
Shader version: 500
0:? Sequence
0:5 Function Definition: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float)
...
...
@@ -19,15 +20,36 @@ Shader version: 500
0:10 Function Parameters:
0:? Sequence
0:11 Sequence
0:? Sequence
0:11 Sequence
0:11 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 'g_tInputTexture_sampler' ( uniform sampler)
0:11 'g_tInputTexture' ( uniform texture2D)
0:11 Constant:
0:11 0.500000
0:11 move second child to first child ( temp sampler)
0:? 'tex.smpl' ( temp sampler)
0:11 smpl: direct index for structure ( temp sampler)
0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 Constant:
0:11 0 (const int)
0:11 move second child to first child ( temp texture2D)
0:? 'tex.tex' ( temp texture2D)
0:11 tex: direct index for structure ( temp texture2D)
0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 Constant:
0:11 1 (const int)
0:11 move second child to first child ( temp float)
0:? 'tex.f' ( temp float)
0:11 f: direct index for structure ( temp float)
0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 Constant:
0:11
0.500000
0:11
2 (const int)
0:12 Branch: Return with expression
0:12 Function Call: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float)
0:? '
g_tInputTexture_sampler' ( uniform
sampler)
0:? '
g_tInputTexture' ( uniform
texture2D)
0:? '
tex.smpl' ( temp
sampler)
0:? '
tex.tex' ( temp
texture2D)
0:? 'tex.f' ( temp float)
0:10 Function Definition: main( ( temp void)
0:10 Function Parameters:
...
...
@@ -64,15 +86,36 @@ Shader version: 500
0:10 Function Parameters:
0:? Sequence
0:11 Sequence
0:? Sequence
0:11 Sequence
0:11 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 Construct structure ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 'g_tInputTexture_sampler' ( uniform sampler)
0:11 'g_tInputTexture' ( uniform texture2D)
0:11 Constant:
0:11 0.500000
0:11 move second child to first child ( temp sampler)
0:? 'tex.smpl' ( temp sampler)
0:11 smpl: direct index for structure ( temp sampler)
0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 Constant:
0:11 0 (const int)
0:11 move second child to first child ( temp texture2D)
0:? 'tex.tex' ( temp texture2D)
0:11 tex: direct index for structure ( temp texture2D)
0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 Constant:
0:11 1 (const int)
0:11 move second child to first child ( temp float)
0:? 'tex.f' ( temp float)
0:11 f: direct index for structure ( temp float)
0:11 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex, temp float f})
0:11 Constant:
0:11
0.500000
0:11
2 (const int)
0:12 Branch: Return with expression
0:12 Function Call: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float)
0:? '
g_tInputTexture_sampler' ( uniform
sampler)
0:? '
g_tInputTexture' ( uniform
texture2D)
0:? '
tex.smpl' ( temp
sampler)
0:? '
tex.tex' ( temp
texture2D)
0:? 'tex.f' ( temp float)
0:10 Function Definition: main( ( temp void)
0:10 Function Parameters:
...
...
@@ -87,12 +130,12 @@ Shader version: 500
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by
46
// Id's are bound by
70
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main"
44
EntryPoint Vertex 4 "main"
68
Source HLSL 500
Name 4 "main"
Name 17 "lookUp(struct-FxaaTex-p1-t21-f11;"
...
...
@@ -100,21 +143,30 @@ Shader version: 500
Name 15 "tex.tex"
Name 16 "tex.f"
Name 20 "@main("
Name 34 "tex.f"
Name 36 "g_tInputTexture_sampler"
Name 37 "g_tInputTexture"
Name 38 "param"
Name 44 "@entryPointOutput"
Decorate 36(g_tInputTexture_sampler) DescriptorSet 0
Decorate 37(g_tInputTexture) DescriptorSet 0
Decorate 44(@entryPointOutput) Location 0
Name 34 "FxaaTex"
MemberName 34(FxaaTex) 0 "smpl"
MemberName 34(FxaaTex) 1 "tex"
MemberName 34(FxaaTex) 2 "f"
Name 36 "flattenTemp"
Name 38 "g_tInputTexture_sampler"
Name 41 "g_tInputTexture"
Name 45 "tex.smpl"
Name 50 "tex.tex"
Name 54 "tex.f"
Name 58 "param"
Name 60 "param"
Name 62 "param"
Name 68 "@entryPointOutput"
Decorate 38(g_tInputTexture_sampler) DescriptorSet 0
Decorate 41(g_tInputTexture) DescriptorSet 0
Decorate 68(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer
UniformConstant
6
7: TypePointer
Function
6
8: TypeFloat 32
9: TypeImage 8(float) 2D sampled format:Unknown
10: TypePointer
UniformConstant
9
10: TypePointer
Function
9
11: TypePointer Function 8(float)
12: TypeVector 8(float) 4
13: TypeFunction 12(fvec4) 7(ptr) 10(ptr) 11(ptr)
...
...
@@ -122,15 +174,23 @@ Shader version: 500
24: TypeSampledImage 9
28: TypeVector 8(float) 2
30: 8(float) Constant 0
35: 8(float) Constant 1056964608
36(g_tInputTexture_sampler): 7(ptr) Variable UniformConstant
37(g_tInputTexture): 10(ptr) Variable UniformConstant
43: TypePointer Output 12(fvec4)
44(@entryPointOutput): 43(ptr) Variable Output
34(FxaaTex): TypeStruct 6 9 8(float)
35: TypePointer Function 34(FxaaTex)
37: TypePointer UniformConstant 6
38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant
40: TypePointer UniformConstant 9
41(g_tInputTexture): 40(ptr) Variable UniformConstant
43: 8(float) Constant 1056964608
46: TypeInt 32 1
47: 46(int) Constant 0
51: 46(int) Constant 1
55: 46(int) Constant 2
67: TypePointer Output 12(fvec4)
68(@entryPointOutput): 67(ptr) Variable Output
4(main): 2 Function None 3
5: Label
45
: 12(fvec4) FunctionCall 20(@main()
Store
44(@entryPointOutput) 45
69
: 12(fvec4) FunctionCall 20(@main()
Store
68(@entryPointOutput) 69
Return
FunctionEnd
17(lookUp(struct-FxaaTex-p1-t21-f11;): 12(fvec4) Function None 13
...
...
@@ -149,11 +209,32 @@ Shader version: 500
FunctionEnd
20(@main(): 12(fvec4) Function None 19
21: Label
34(tex.f): 11(ptr) Variable Function
38(param): 11(ptr) Variable Function
Store 34(tex.f) 35
39: 8(float) Load 34(tex.f)
Store 38(param) 39
40: 12(fvec4) FunctionCall 17(lookUp(struct-FxaaTex-p1-t21-f11;) 36(g_tInputTexture_sampler) 37(g_tInputTexture) 38(param)
ReturnValue 40
36(flattenTemp): 35(ptr) Variable Function
45(tex.smpl): 7(ptr) Variable Function
50(tex.tex): 10(ptr) Variable Function
54(tex.f): 11(ptr) Variable Function
58(param): 7(ptr) Variable Function
60(param): 10(ptr) Variable Function
62(param): 11(ptr) Variable Function
39: 6 Load 38(g_tInputTexture_sampler)
42: 9 Load 41(g_tInputTexture)
44: 34(FxaaTex) CompositeConstruct 39 42 43
Store 36(flattenTemp) 44
48: 7(ptr) AccessChain 36(flattenTemp) 47
49: 6 Load 48
Store 45(tex.smpl) 49
52: 10(ptr) AccessChain 36(flattenTemp) 51
53: 9 Load 52
Store 50(tex.tex) 53
56: 11(ptr) AccessChain 36(flattenTemp) 55
57: 8(float) Load 56
Store 54(tex.f) 57
59: 6 Load 45(tex.smpl)
Store 58(param) 59
61: 9 Load 50(tex.tex)
Store 60(param) 61
63: 8(float) Load 54(tex.f)
Store 62(param) 63
64: 12(fvec4) FunctionCall 17(lookUp(struct-FxaaTex-p1-t21-f11;) 58(param) 60(param) 62(param)
ReturnValue 64
FunctionEnd
Test/baseResults/hlsl.opaque-type-bug.frag.out
View file @
5a57ca68
...
...
@@ -59,7 +59,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 2
6
// Id's are bound by 2
7
Capability Shader
1: ExtInstImport "GLSL.std.450"
...
...
@@ -68,44 +68,45 @@ gl_FragCoord origin is upper left
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 1
4
"TexFunc(t21;vf3;"
Name 1
2
"t2D"
Name 1
3
"RGB"
Name 1
6
"@main("
Name 1
3
"TexFunc(t21;vf3;"
Name 1
1
"t2D"
Name 1
2
"RGB"
Name 1
5
"@main("
Name 20 "MyTexture"
Name 2
1
"final_RGB"
Name 2
2
"param"
Name 2
2
"final_RGB"
Name 2
3
"param"
Decorate 20(MyTexture) DescriptorSet 0
Decorate 20(MyTexture) Binding 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeImage 6(float) 2D sampled format:Unknown
8: Type
Pointer UniformConstant 7
9: Type
Vector 6(float) 3
10: Type
Pointer Function 9(fvec3
)
1
1: TypeFunction 2 8(ptr) 10(ptr)
18:
6(float) Constant 0
19:
9(fvec3) ConstantComposite 18 18 18
20(MyTexture):
8
(ptr) Variable UniformConstant
8: Type
Vector 6(float) 3
9: Type
Pointer Function 8(fvec3)
10: Type
Function 2 7 9(ptr
)
1
7: 6(float) Constant 0
18:
8(fvec3) ConstantComposite 17 17 17
19:
TypePointer UniformConstant 7
20(MyTexture):
19
(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
2
5: 2 FunctionCall 16
(@main()
2
6: 2 FunctionCall 15
(@main()
Return
FunctionEnd
1
4(TexFunc(t21;vf3;): 2 Function None 11
1
2(t2D): 8(ptr)
FunctionParameter
1
3(RGB): 10
(ptr) FunctionParameter
1
5
: Label
Store 1
3(RGB) 19
1
3(TexFunc(t21;vf3;): 2 Function None 10
1
1(t2D): 7
FunctionParameter
1
2(RGB): 9
(ptr) FunctionParameter
1
4
: Label
Store 1
2(RGB) 18
Return
FunctionEnd
16(@main(): 2 Function None 3
17: Label
21(final_RGB): 10(ptr) Variable Function
22(param): 10(ptr) Variable Function
23: 2 FunctionCall 14(TexFunc(t21;vf3;) 20(MyTexture) 22(param)
24: 9(fvec3) Load 22(param)
Store 21(final_RGB) 24
15(@main(): 2 Function None 3
16: Label
22(final_RGB): 9(ptr) Variable Function
23(param): 9(ptr) Variable Function
21: 7 Load 20(MyTexture)
24: 2 FunctionCall 13(TexFunc(t21;vf3;) 21 23(param)
25: 8(fvec3) Load 23(param)
Store 22(final_RGB) 25
Return
FunctionEnd
Test/baseResults/hlsl.structbuffer.append.fn.frag.out
View file @
5a57ca68
...
...
@@ -151,12 +151,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 7
0
// Id's are bound by 7
6
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
58 61
EntryPoint Fragment 4 "main"
64 67
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
...
...
@@ -171,51 +171,55 @@ gl_FragCoord origin is upper left
Name 18 "arg_c@count"
Name 25 "@main(u1;"
Name 24 "pos"
Name 49 "sbuf_a"
Name 50 "sbuf_a@count"
Name 51 "sbuf_c"
Name 52 "sbuf_c@count"
Name 56 "pos"
Name 58 "pos"
Name 61 "@entryPointOutput"
Name 62 "param"
Name 65 "sbuf_a@count"
MemberName 65(sbuf_a@count) 0 "@count"
Name 67 "sbuf_a@count"
Name 68 "sbuf_c@count"
Name 69 "sbuf_unused"
Name 50 "sbuf_a"
Name 52 "sbuf_a@count"
Name 53 "sbuf_c"
Name 54 "sbuf_c@count"
Name 55 "param"
Name 56 "param"
Name 57 "param"
Name 58 "param"
Name 62 "pos"
Name 64 "pos"
Name 67 "@entryPointOutput"
Name 68 "param"
Name 71 "sbuf_a@count"
MemberName 71(sbuf_a@count) 0 "@count"
Name 73 "sbuf_a@count"
Name 74 "sbuf_c@count"
Name 75 "sbuf_unused"
Decorate 8 ArrayStride 16
MemberDecorate 9 0 Offset 0
Decorate 9 BufferBlock
Decorate 12 BufferBlock
Decorate
49
(sbuf_a) DescriptorSet 0
Decorate 5
0
(sbuf_a@count) DescriptorSet 0
Decorate 5
1
(sbuf_c) DescriptorSet 0
Decorate 5
2
(sbuf_c@count) DescriptorSet 0
Decorate
58
(pos) Flat
Decorate
58
(pos) Location 0
Decorate 6
1
(@entryPointOutput) Location 0
MemberDecorate
65
(sbuf_a@count) 0 Offset 0
Decorate
65
(sbuf_a@count) BufferBlock
Decorate
67
(sbuf_a@count) DescriptorSet 0
Decorate
68
(sbuf_c@count) DescriptorSet 0
Decorate
69
(sbuf_unused) DescriptorSet 0
Decorate
50
(sbuf_a) DescriptorSet 0
Decorate 5
2
(sbuf_a@count) DescriptorSet 0
Decorate 5
3
(sbuf_c) DescriptorSet 0
Decorate 5
4
(sbuf_c@count) DescriptorSet 0
Decorate
64
(pos) Flat
Decorate
64
(pos) Location 0
Decorate 6
7
(@entryPointOutput) Location 0
MemberDecorate
71
(sbuf_a@count) 0 Offset 0
Decorate
71
(sbuf_a@count) BufferBlock
Decorate
73
(sbuf_a@count) DescriptorSet 0
Decorate
74
(sbuf_c@count) DescriptorSet 0
Decorate
75
(sbuf_unused) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeRuntimeArray 7(fvec4)
9: TypeStruct 8
10: TypePointer
Uniform
9(struct)
10: TypePointer
Function
9(struct)
11: TypeInt 32 1
12: TypeStruct 11(int)
13: TypePointer
Uniform
12(struct)
13: TypePointer
Function
12(struct)
14: TypeFunction 7(fvec4) 10(ptr) 13(ptr) 10(ptr) 13(ptr)
21: TypeInt 32 0
22: TypePointer Function 21(int)
23: TypeFunction 7(fvec4) 22(ptr)
27: 11(int) Constant 0
28: TypePointer
Uniform
11(int)
28: TypePointer
Function
11(int)
30: 11(int) Constant 1
31: 21(int) Constant 1
32: 21(int) Constant 0
...
...
@@ -224,31 +228,33 @@ gl_FragCoord origin is upper left
36: 6(float) Constant 1077936128
37: 6(float) Constant 1082130432
38: 7(fvec4) ConstantComposite 34 35 36 37
39: TypePointer
Uniform
7(fvec4)
39: TypePointer
Function
7(fvec4)
42: 11(int) Constant 4294967295
49(sbuf_a): 10(ptr) Variable Uniform
50(sbuf_a@count): 13(ptr) Variable Uniform
51(sbuf_c): 10(ptr) Variable Uniform
52(sbuf_c@count): 13(ptr) Variable Uniform
57: TypePointer Input 21(int)
58(pos): 57(ptr) Variable Input
60: TypePointer Output 7(fvec4)
61(@entryPointOutput): 60(ptr) Variable Output
65(sbuf_a@count): TypeStruct 11(int)
66: TypePointer Uniform 65(sbuf_a@count)
67(sbuf_a@count): 66(ptr) Variable Uniform
68(sbuf_c@count): 66(ptr) Variable Uniform
69(sbuf_unused): 10(ptr) Variable Uniform
49: TypePointer Uniform 9(struct)
50(sbuf_a): 49(ptr) Variable Uniform
51: TypePointer Uniform 12(struct)
52(sbuf_a@count): 51(ptr) Variable Uniform
53(sbuf_c): 49(ptr) Variable Uniform
54(sbuf_c@count): 51(ptr) Variable Uniform
63: TypePointer Input 21(int)
64(pos): 63(ptr) Variable Input
66: TypePointer Output 7(fvec4)
67(@entryPointOutput): 66(ptr) Variable Output
71(sbuf_a@count): TypeStruct 11(int)
72: TypePointer Uniform 71(sbuf_a@count)
73(sbuf_a@count): 72(ptr) Variable Uniform
74(sbuf_c@count): 72(ptr) Variable Uniform
75(sbuf_unused): 49(ptr) Variable Uniform
4(main): 2 Function None 3
5: Label
56
(pos): 22(ptr) Variable Function
6
2
(param): 22(ptr) Variable Function
59: 21(int) Load 58
(pos)
Store
56(pos) 59
6
3: 21(int) Load 56
(pos)
Store 6
2(param) 63
64: 7(fvec4) FunctionCall 25(@main(u1;) 62
(param)
Store 6
1(@entryPointOutput) 64
62
(pos): 22(ptr) Variable Function
6
8
(param): 22(ptr) Variable Function
65: 21(int) Load 64
(pos)
Store
62(pos) 65
6
9: 21(int) Load 62
(pos)
Store 6
8(param) 69
70: 7(fvec4) FunctionCall 25(@main(u1;) 68
(param)
Store 6
7(@entryPointOutput) 70
Return
FunctionEnd
19(Fn2(block--vf4[0]1;block--vf4[0]1;): 7(fvec4) Function None 14
...
...
@@ -271,6 +277,10 @@ gl_FragCoord origin is upper left
25(@main(u1;): 7(fvec4) Function None 23
24(pos): 22(ptr) FunctionParameter
26: Label
53: 7(fvec4) FunctionCall 19(Fn2(block--vf4[0]1;block--vf4[0]1;) 49(sbuf_a) 50(sbuf_a@count) 51(sbuf_c) 52(sbuf_c@count)
ReturnValue 53
55(param): 10(ptr) Variable Function
56(param): 13(ptr) Variable Function
57(param): 10(ptr) Variable Function
58(param): 13(ptr) Variable Function
59: 7(fvec4) FunctionCall 19(Fn2(block--vf4[0]1;block--vf4[0]1;) 55(param) 56(param) 57(param) 58(param)
ReturnValue 59
FunctionEnd
Test/baseResults/hlsl.structbuffer.fn.frag.out
View file @
5a57ca68
...
...
@@ -139,12 +139,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by
78
// Id's are bound by
83
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 6
3 66
EntryPoint Fragment 4 "main" 6
8 71
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
...
...
@@ -165,21 +165,24 @@ gl_FragCoord origin is upper left
Name 35 "@main(u1;"
Name 34 "pos"
Name 47 "sbuf2"
Name 48 "sbuf2@count"
Name 50 "sbuf"
Name 52 "param"
Name 49 "sbuf2@count"
Name 52 "sbuf"
Name 54 "param"
Name 55 "param"
Name 61 "pos"
Name 63 "pos"
Name 66 "@entryPointOutput"
Name 67 "param"
Name 70 "sbuf2@count"
MemberName 70(sbuf2@count) 0 "@count"
Name 72 "sbuf2@count"
Name 75 "sbuf3"
MemberName 75(sbuf3) 0 "@data"
Name 77 "sbuf3"
Name 57 "param"
Name 58 "param"
Name 59 "param"
Name 60 "param"
Name 66 "pos"
Name 68 "pos"
Name 71 "@entryPointOutput"
Name 72 "param"
Name 75 "sbuf2@count"
MemberName 75(sbuf2@count) 0 "@count"
Name 77 "sbuf2@count"
Name 80 "sbuf3"
MemberName 80(sbuf3) 0 "@data"
Name 82 "sbuf3"
Decorate 8 ArrayStride 16
MemberDecorate 9 0 NonWritable
MemberDecorate 9 0 Offset 0
...
...
@@ -190,72 +193,74 @@ gl_FragCoord origin is upper left
Decorate 18 BufferBlock
Decorate 21 BufferBlock
Decorate 47(sbuf2) DescriptorSet 0
Decorate 4
8
(sbuf2@count) DescriptorSet 0
Decorate 5
0
(sbuf) DescriptorSet 0
Decorate 5
0
(sbuf) Binding 10
Decorate 6
3
(pos) Flat
Decorate 6
3
(pos) Location 0
Decorate
66
(@entryPointOutput) Location 0
MemberDecorate 7
0
(sbuf2@count) 0 Offset 0
Decorate 7
0
(sbuf2@count) BufferBlock
Decorate 7
2
(sbuf2@count) DescriptorSet 0
Decorate 7
4
ArrayStride 16
MemberDecorate
75
(sbuf3) 0 NonWritable
MemberDecorate
75
(sbuf3) 0 Offset 0
Decorate
75
(sbuf3) BufferBlock
Decorate
77
(sbuf3) DescriptorSet 0
Decorate
77
(sbuf3) Binding 12
Decorate 4
9
(sbuf2@count) DescriptorSet 0
Decorate 5
2
(sbuf) DescriptorSet 0
Decorate 5
2
(sbuf) Binding 10
Decorate 6
8
(pos) Flat
Decorate 6
8
(pos) Location 0
Decorate
71
(@entryPointOutput) Location 0
MemberDecorate 7
5
(sbuf2@count) 0 Offset 0
Decorate 7
5
(sbuf2@count) BufferBlock
Decorate 7
7
(sbuf2@count) DescriptorSet 0
Decorate 7
9
ArrayStride 16
MemberDecorate
80
(sbuf3) 0 NonWritable
MemberDecorate
80
(sbuf3) 0 Offset 0
Decorate
80
(sbuf3) BufferBlock
Decorate
82
(sbuf3) DescriptorSet 0
Decorate
82
(sbuf3) Binding 12
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeVector 6(int) 4
8: TypeRuntimeArray 7(ivec4)
9: TypeStruct 8
10: TypePointer
Uniform
9(struct)
10: TypePointer
Function
9(struct)
11: TypePointer Function 6(int)
12: TypeFunction 7(ivec4) 10(ptr) 11(ptr)
17: TypeRuntimeArray 7(ivec4)
18: TypeStruct 17
19: TypePointer
Uniform
18(struct)
19: TypePointer
Function
18(struct)
20: TypeInt 32 1
21: TypeStruct 20(int)
22: TypePointer
Uniform
21(struct)
22: TypePointer
Function
21(struct)
23: TypePointer Function 7(ivec4)
24: TypeFunction 2 19(ptr) 22(ptr) 11(ptr) 23(ptr)
31: TypeFloat 32
32: TypeVector 31(float) 4
33: TypeFunction 32(fvec4) 11(ptr)
37: 20(int) Constant 0
39: TypePointer Uniform 7(ivec4)
47(sbuf2): 19(ptr) Variable Uniform
48(sbuf2@count): 22(ptr) Variable Uniform
49: 6(int) Constant 2
50(sbuf): 10(ptr) Variable Uniform
51: 6(int) Constant 3
57: 31(float) Constant 0
58: 32(fvec4) ConstantComposite 57 57 57 57
62: TypePointer Input 6(int)
63(pos): 62(ptr) Variable Input
65: TypePointer Output 32(fvec4)
66(@entryPointOutput): 65(ptr) Variable Output
70(sbuf2@count): TypeStruct 20(int)
71: TypePointer Uniform 70(sbuf2@count)
72(sbuf2@count): 71(ptr) Variable Uniform
73: TypeVector 6(int) 3
74: TypeRuntimeArray 73(ivec3)
75(sbuf3): TypeStruct 74
76: TypePointer Uniform 75(sbuf3)
77(sbuf3): 76(ptr) Variable Uniform
46: TypePointer Uniform 18(struct)
47(sbuf2): 46(ptr) Variable Uniform
48: TypePointer Uniform 21(struct)
49(sbuf2@count): 48(ptr) Variable Uniform
50: 6(int) Constant 2
51: TypePointer Uniform 9(struct)
52(sbuf): 51(ptr) Variable Uniform
53: 6(int) Constant 3
62: 31(float) Constant 0
63: 32(fvec4) ConstantComposite 62 62 62 62
67: TypePointer Input 6(int)
68(pos): 67(ptr) Variable Input
70: TypePointer Output 32(fvec4)
71(@entryPointOutput): 70(ptr) Variable Output
75(sbuf2@count): TypeStruct 20(int)
76: TypePointer Uniform 75(sbuf2@count)
77(sbuf2@count): 76(ptr) Variable Uniform
78: TypeVector 6(int) 3
79: TypeRuntimeArray 78(ivec3)
80(sbuf3): TypeStruct 79
81: TypePointer Uniform 80(sbuf3)
82(sbuf3): 81(ptr) Variable Uniform
4(main): 2 Function None 3
5: Label
6
1
(pos): 11(ptr) Variable Function
67
(param): 11(ptr) Variable Function
6
4: 6(int) Load 63
(pos)
Store 6
1(pos) 64
68: 6(int) Load 61
(pos)
Store
67(param) 68
69: 32(fvec4) FunctionCall 35(@main(u1;) 67
(param)
Store
66(@entryPointOutput) 69
6
6
(pos): 11(ptr) Variable Function
72
(param): 11(ptr) Variable Function
6
9: 6(int) Load 68
(pos)
Store 6
6(pos) 69
73: 6(int) Load 66
(pos)
Store
72(param) 73
74: 32(fvec4) FunctionCall 35(@main(u1;) 72
(param)
Store
71(@entryPointOutput) 74
Return
FunctionEnd
15(get(block--vu4[0]1;u1;): 7(ivec4) Function None 12
...
...
@@ -263,9 +268,9 @@ gl_FragCoord origin is upper left
14(bufferOffset): 11(ptr) FunctionParameter
16: Label
38: 6(int) Load 14(bufferOffset)
40: 39
(ptr) AccessChain 13(sb) 37 38
4
1: 7(ivec4) Load 40
ReturnValue 4
1
39: 23
(ptr) AccessChain 13(sb) 37 38
4
0: 7(ivec4) Load 39
ReturnValue 4
0
FunctionEnd
29(set(block--vu4[0]1;u1;vu4;): 2 Function None 24
25(sb): 19(ptr) FunctionParameter
...
...
@@ -273,22 +278,25 @@ gl_FragCoord origin is upper left
27(bufferOffset): 11(ptr) FunctionParameter
28(data): 23(ptr) FunctionParameter
30: Label
4
4
: 6(int) Load 27(bufferOffset)
4
5
: 7(ivec4) Load 28(data)
4
6: 39(ptr) AccessChain 25(sb) 37 44
Store 4
6 45
4
3
: 6(int) Load 27(bufferOffset)
4
4
: 7(ivec4) Load 28(data)
4
5: 23(ptr) AccessChain 25(sb) 37 43
Store 4
5 44
Return
FunctionEnd
35(@main(u1;): 32(fvec4) Function None 33
34(pos): 11(ptr) FunctionParameter
36: Label
5
2(param): 11
(ptr) Variable Function
5
4
(param): 11(ptr) Variable Function
5
5(param): 23
(ptr) Variable Function
Store 52(param) 51
53: 7(ivec4) FunctionCall 15(get(block--vu4[0]1;u1;) 50(sbuf) 52(param)
Store 54(param) 49
5
4(param): 10
(ptr) Variable Function
5
5
(param): 11(ptr) Variable Function
5
7(param): 19
(ptr) Variable Function
58(param): 22(ptr) Variable Function
59(param): 11(ptr) Variable Function
60(param): 23(ptr) Variable Function
Store 55(param) 53
56: 2 FunctionCall 29(set(block--vu4[0]1;u1;vu4;) 47(sbuf2) 48(sbuf2@count) 54(param) 55(param)
ReturnValue 58
56: 7(ivec4) FunctionCall 15(get(block--vu4[0]1;u1;) 54(param) 55(param)
Store 59(param) 50
Store 60(param) 56
61: 2 FunctionCall 29(set(block--vu4[0]1;u1;vu4;) 57(param) 58(param) 59(param) 60(param)
ReturnValue 63
FunctionEnd
Test/baseResults/hlsl.structbuffer.fn2.comp.out
View file @
5a57ca68
...
...
@@ -135,14 +135,14 @@ local_size = (256, 1, 1)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 6
1
// Id's are bound by 6
2
Capability Shader
Capability ImageBuffer
Capability StorageImageExtendedFormats
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 5
6
EntryPoint GLCompute 4 "main" 5
7
ExecutionMode 4 LocalSize 256 1 1
Source HLSL 500
Name 4 "main"
...
...
@@ -155,13 +155,14 @@ local_size = (256, 1, 1)
Name 18 "dispatchId"
Name 22 "result"
Name 25 "byteAddrTemp"
Name 4
3
"result"
Name 4
2
"result"
Name 44 "g_input"
Name 45 "param"
Name 50 "g_output"
Name 54 "dispatchId"
Name 56 "dispatchId"
Name 58 "param"
Name 47 "param"
Name 51 "g_output"
Name 55 "dispatchId"
Name 57 "dispatchId"
Name 59 "param"
Decorate 8 ArrayStride 4
MemberDecorate 9 0 NonWritable
MemberDecorate 9 0 Offset 0
...
...
@@ -169,16 +170,16 @@ local_size = (256, 1, 1)
Decorate 14(buffer) NonWritable
Decorate 44(g_input) DescriptorSet 0
Decorate 44(g_input) Binding 0
Decorate 5
0
(g_output) DescriptorSet 0
Decorate 5
0
(g_output) Binding 1
Decorate 5
6
(dispatchId) BuiltIn GlobalInvocationId
Decorate 5
1
(g_output) DescriptorSet 0
Decorate 5
1
(g_output) Binding 1
Decorate 5
7
(dispatchId) BuiltIn GlobalInvocationId
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypePointer Function 6(int)
8: TypeRuntimeArray 6(int)
9: TypeStruct 8
10: TypePointer
Uniform
9(struct)
10: TypePointer
Function
9(struct)
11: TypeVector 6(int) 2
12: TypeFunction 11(ivec2) 7(ptr) 10(ptr)
17: TypeFunction 2 7(ptr)
...
...
@@ -187,23 +188,23 @@ local_size = (256, 1, 1)
24: TypePointer Function 23(int)
27: 23(int) Constant 2
29: 23(int) Constant 0
3
1: TypePointer Uniform 6(int)
35: 23(int) Constant 1
44(g_input):
10
(ptr) Variable Uniform
4
8
: TypeImage 6(int) Buffer nonsampled format:Rg32ui
49: TypePointer UniformConstant 48
5
0(g_output): 49
(ptr) Variable UniformConstant
5
5
: TypePointer Input 6(int)
5
6(dispatchId): 55
(ptr) Variable Input
3
4: 23(int) Constant 1
43: TypePointer Uniform 9(struct)
44(g_input):
43
(ptr) Variable Uniform
4
9
: TypeImage 6(int) Buffer nonsampled format:Rg32ui
50: TypePointer UniformConstant 49
5
1(g_output): 50
(ptr) Variable UniformConstant
5
6
: TypePointer Input 6(int)
5
7(dispatchId): 56
(ptr) Variable Input
4(main): 2 Function None 3
5: Label
5
4
(dispatchId): 7(ptr) Variable Function
5
8
(param): 7(ptr) Variable Function
5
7: 6(int) Load 56
(dispatchId)
Store 5
4(dispatchId) 57
59: 6(int) Load 54
(dispatchId)
Store 5
8(param) 59
6
0: 2 FunctionCall 19(@main(u1;) 58
(param)
5
5
(dispatchId): 7(ptr) Variable Function
5
9
(param): 7(ptr) Variable Function
5
8: 6(int) Load 57
(dispatchId)
Store 5
5(dispatchId) 58
60: 6(int) Load 55
(dispatchId)
Store 5
9(param) 60
6
1: 2 FunctionCall 19(@main(u1;) 59
(param)
Return
FunctionEnd
15(testLoad(u1;block--u1[0]1;): 11(ivec2) Function None 12
...
...
@@ -216,29 +217,30 @@ local_size = (256, 1, 1)
28: 23(int) ShiftRightLogical 26 27
Store 25(byteAddrTemp) 28
30: 23(int) Load 25(byteAddrTemp)
3
2: 31
(ptr) AccessChain 14(buffer) 29 30
3
3: 6(int) Load 32
3
4
: 23(int) Load 25(byteAddrTemp)
3
6: 23(int) IAdd 34 35
3
7: 31(ptr) AccessChain 14(buffer) 29 36
3
8: 6(int) Load 37
3
9: 11(ivec2) CompositeConstruct 33 38
Store 22(result) 3
9
40
: 11(ivec2) Load 22(result)
ReturnValue
40
3
1: 7
(ptr) AccessChain 14(buffer) 29 30
3
2: 6(int) Load 31
3
3
: 23(int) Load 25(byteAddrTemp)
3
5: 23(int) IAdd 33 34
3
6: 7(ptr) AccessChain 14(buffer) 29 35
3
7: 6(int) Load 36
3
8: 11(ivec2) CompositeConstruct 32 37
Store 22(result) 3
8
39
: 11(ivec2) Load 22(result)
ReturnValue
39
FunctionEnd
19(@main(u1;): 2 Function None 17
18(dispatchId): 7(ptr) FunctionParameter
20: Label
4
3
(result): 21(ptr) Variable Function
4
2
(result): 21(ptr) Variable Function
45(param): 7(ptr) Variable Function
47(param): 10(ptr) Variable Function
46: 6(int) Load 18(dispatchId)
Store 45(param) 46
4
7: 11(ivec2) FunctionCall 15(testLoad(u1;block--u1[0]1;) 45(param) 44(g_input
)
Store 4
3(result) 47
5
1: 48 Load 50
(g_output)
5
2
: 6(int) Load 18(dispatchId)
5
3: 11(ivec2) Load 43
(result)
ImageWrite 5
1 52 53
4
8: 11(ivec2) FunctionCall 15(testLoad(u1;block--u1[0]1;) 45(param) 47(param
)
Store 4
2(result) 48
5
2: 49 Load 51
(g_output)
5
3
: 6(int) Load 18(dispatchId)
5
4: 11(ivec2) Load 42
(result)
ImageWrite 5
2 53 54
Return
FunctionEnd
Test/baseResults/hlsl.texture.struct.frag.out
View file @
5a57ca68
...
...
@@ -839,12 +839,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 2
33
// Id's are bound by 2
40
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 23
1
EntryPoint Fragment 4 "main" 23
8
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
...
...
@@ -867,52 +867,55 @@ gl_FragCoord origin is upper left
Name 71 "@sampleStructTemp"
Name 87 "s1"
Name 88 "@sampleResultShadow"
Name 89 "g_tTex2s1"
Name 97 "@sampleStructTemp"
Name 111 "s2"
Name 112 "@sampleResultShadow"
Name 113 "g_tTex2s2"
Name 121 "@sampleStructTemp"
Name 135 "s3_t"
MemberName 135(s3_t) 0 "c0"
MemberName 135(s3_t) 1 "c1"
Name 137 "s3"
Name 138 "@sampleResultShadow"
Name 139 "g_tTex2s3"
Name 147 "@sampleStructTemp"
Name 159 "s4_t"
MemberName 159(s4_t) 0 "c0"
MemberName 159(s4_t) 1 "c1"
MemberName 159(s4_t) 2 "c2"
Name 161 "s4"
Name 164 "@sampleResultShadow"
Name 167 "g_tTex2s4"
Name 176 "@sampleStructTemp"
Name 193 "s5_t"
MemberName 193(s5_t) 0 "c0"
MemberName 193(s5_t) 1 "c1"
Name 195 "s5"
Name 198 "@sampleResultShadow"
Name 201 "g_tTex2s5"
Name 210 "@sampleStructTemp"
Name 219 "r0"
Name 221 "r1"
Name 223 "r2"
Name 224 "g_tTex2s1a"
Name 231 "@entryPointOutput"
Name 90 "g_tTex2s1"
Name 98 "@sampleStructTemp"
Name 112 "s2"
Name 113 "@sampleResultShadow"
Name 114 "g_tTex2s2"
Name 122 "@sampleStructTemp"
Name 136 "s3_t"
MemberName 136(s3_t) 0 "c0"
MemberName 136(s3_t) 1 "c1"
Name 138 "s3"
Name 139 "@sampleResultShadow"
Name 140 "g_tTex2s3"
Name 148 "@sampleStructTemp"
Name 160 "s4_t"
MemberName 160(s4_t) 0 "c0"
MemberName 160(s4_t) 1 "c1"
MemberName 160(s4_t) 2 "c2"
Name 162 "s4"
Name 165 "@sampleResultShadow"
Name 168 "g_tTex2s4"
Name 177 "@sampleStructTemp"
Name 194 "s5_t"
MemberName 194(s5_t) 0 "c0"
MemberName 194(s5_t) 1 "c1"
Name 196 "s5"
Name 199 "@sampleResultShadow"
Name 202 "g_tTex2s5"
Name 211 "@sampleStructTemp"
Name 220 "r0"
Name 221 "param"
Name 224 "r1"
Name 225 "param"
Name 228 "r2"
Name 229 "g_tTex2s1a"
Name 230 "param"
Name 238 "@entryPointOutput"
Decorate 30(g_sSamp) DescriptorSet 0
Decorate
89
(g_tTex2s1) DescriptorSet 0
Decorate 11
3
(g_tTex2s2) DescriptorSet 0
Decorate 1
39
(g_tTex2s3) DescriptorSet 0
Decorate 16
7
(g_tTex2s4) DescriptorSet 0
Decorate 20
1
(g_tTex2s5) DescriptorSet 0
Decorate 22
4
(g_tTex2s1a) DescriptorSet 0
Decorate 23
1
(@entryPointOutput) Location 0
Decorate
90
(g_tTex2s1) DescriptorSet 0
Decorate 11
4
(g_tTex2s2) DescriptorSet 0
Decorate 1
40
(g_tTex2s3) DescriptorSet 0
Decorate 16
8
(g_tTex2s4) DescriptorSet 0
Decorate 20
2
(g_tTex2s5) DescriptorSet 0
Decorate 22
9
(g_tTex2s1a) DescriptorSet 0
Decorate 23
8
(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeImage 6(float) 2D sampled format:Unknown
8: TypePointer
UniformConstant
7
8: TypePointer
Function
7
9: TypeVector 6(float) 2
10(s1_t): TypeStruct 6(float) 9(fvec2) 6(float)
11: TypeFunction 10(s1_t) 8(ptr)
...
...
@@ -941,54 +944,55 @@ gl_FragCoord origin is upper left
57: 40(int) Constant 2
58: 42(int) Constant 3
70: TypePointer Function 16(s2_t)
89(g_tTex2s1): 8(ptr) Variable UniformConstant
93: 6(float) Constant 1036831949
94: 6(float) Constant 1038174126
95: 9(fvec2) ConstantComposite 93 94
113(g_tTex2s2): 8(ptr) Variable UniformConstant
117: 6(float) Constant 1045220557
118: 6(float) Constant 1045891645
119: 9(fvec2) ConstantComposite 117 118
135(s3_t): TypeStruct 9(fvec2) 6(float)
136: TypePointer Function 135(s3_t)
139(g_tTex2s3): 8(ptr) Variable UniformConstant
143: 6(float) Constant 1050253722
144: 6(float) Constant 1050589266
145: 9(fvec2) ConstantComposite 143 144
158: TypeVector 40(int) 2
159(s4_t): TypeStruct 40(int) 158(ivec2) 40(int)
160: TypePointer Function 159(s4_t)
162: TypeVector 40(int) 4
163: TypePointer Function 162(ivec4)
165: TypeImage 40(int) 2D sampled format:Unknown
166: TypePointer UniformConstant 165
167(g_tTex2s4): 166(ptr) Variable UniformConstant
170: TypeSampledImage 165
172: 6(float) Constant 1053609165
173: 6(float) Constant 1053944709
174: 9(fvec2) ConstantComposite 172 173
177: TypePointer Function 40(int)
193(s5_t): TypeStruct 42(int) 42(int)
194: TypePointer Function 193(s5_t)
196: TypeVector 42(int) 4
197: TypePointer Function 196(ivec4)
199: TypeImage 42(int) 2D sampled format:Unknown
200: TypePointer UniformConstant 199
201(g_tTex2s5): 200(ptr) Variable UniformConstant
204: TypeSampledImage 199
206: 6(float) Constant 1056964608
207: 6(float) Constant 1057132380
208: 9(fvec2) ConstantComposite 206 207
211: TypePointer Function 42(int)
224(g_tTex2s1a): 8(ptr) Variable UniformConstant
226: 6(float) Constant 0
227: 21(fvec4) ConstantComposite 226 226 226 226
230: TypePointer Output 21(fvec4)
231(@entryPointOutput): 230(ptr) Variable Output
89: TypePointer UniformConstant 7
90(g_tTex2s1): 89(ptr) Variable UniformConstant
94: 6(float) Constant 1036831949
95: 6(float) Constant 1038174126
96: 9(fvec2) ConstantComposite 94 95
114(g_tTex2s2): 89(ptr) Variable UniformConstant
118: 6(float) Constant 1045220557
119: 6(float) Constant 1045891645
120: 9(fvec2) ConstantComposite 118 119
136(s3_t): TypeStruct 9(fvec2) 6(float)
137: TypePointer Function 136(s3_t)
140(g_tTex2s3): 89(ptr) Variable UniformConstant
144: 6(float) Constant 1050253722
145: 6(float) Constant 1050589266
146: 9(fvec2) ConstantComposite 144 145
159: TypeVector 40(int) 2
160(s4_t): TypeStruct 40(int) 159(ivec2) 40(int)
161: TypePointer Function 160(s4_t)
163: TypeVector 40(int) 4
164: TypePointer Function 163(ivec4)
166: TypeImage 40(int) 2D sampled format:Unknown
167: TypePointer UniformConstant 166
168(g_tTex2s4): 167(ptr) Variable UniformConstant
171: TypeSampledImage 166
173: 6(float) Constant 1053609165
174: 6(float) Constant 1053944709
175: 9(fvec2) ConstantComposite 173 174
178: TypePointer Function 40(int)
194(s5_t): TypeStruct 42(int) 42(int)
195: TypePointer Function 194(s5_t)
197: TypeVector 42(int) 4
198: TypePointer Function 197(ivec4)
200: TypeImage 42(int) 2D sampled format:Unknown
201: TypePointer UniformConstant 200
202(g_tTex2s5): 201(ptr) Variable UniformConstant
205: TypeSampledImage 200
207: 6(float) Constant 1056964608
208: 6(float) Constant 1057132380
209: 9(fvec2) ConstantComposite 207 208
212: TypePointer Function 42(int)
229(g_tTex2s1a): 89(ptr) Variable UniformConstant
233: 6(float) Constant 0
234: 21(fvec4) ConstantComposite 233 233 233 233
237: TypePointer Output 21(fvec4)
238(@entryPointOutput): 237(ptr) Variable Output
4(main): 2 Function None 3
5: Label
23
2
: 21(fvec4) FunctionCall 23(@main()
Store 23
1(@entryPointOutput) 232
23
9
: 21(fvec4) FunctionCall 23(@main()
Store 23
8(@entryPointOutput) 239
Return
FunctionEnd
13(fn1(t2-tx-struct0-1;): 10(s1_t) Function None 11
...
...
@@ -1053,132 +1057,141 @@ gl_FragCoord origin is upper left
24: Label
87(s1): 38(ptr) Variable Function
88(@sampleResultShadow): 25(ptr) Variable Function
97(@sampleStructTemp): 38(ptr) Variable Function
111(s2): 70(ptr) Variable Function
112(@sampleResultShadow): 25(ptr) Variable Function
121(@sampleStructTemp): 70(ptr) Variable Function
137(s3): 136(ptr) Variable Function
138(@sampleResultShadow): 25(ptr) Variable Function
147(@sampleStructTemp): 136(ptr) Variable Function
161(s4): 160(ptr) Variable Function
164(@sampleResultShadow): 163(ptr) Variable Function
176(@sampleStructTemp): 160(ptr) Variable Function
195(s5): 194(ptr) Variable Function
198(@sampleResultShadow): 197(ptr) Variable Function
210(@sampleStructTemp): 194(ptr) Variable Function
219(r0): 38(ptr) Variable Function
221(r1): 70(ptr) Variable Function
223(r2): 38(ptr) Variable Function
90: 7 Load 89(g_tTex2s1)
91: 28 Load 30(g_sSamp)
92: 32 SampledImage 90 91
96: 21(fvec4) ImageSampleImplicitLod 92 95
Store 88(@sampleResultShadow) 96
98: 44(ptr) AccessChain 88(@sampleResultShadow) 43
99: 6(float) Load 98
100: 44(ptr) AccessChain 97(@sampleStructTemp) 41
Store 100 99
101: 44(ptr) AccessChain 88(@sampleResultShadow) 49
102: 6(float) Load 101
103: 44(ptr) AccessChain 97(@sampleStructTemp) 48 43
Store 103 102
104: 44(ptr) AccessChain 88(@sampleResultShadow) 53
105: 6(float) Load 104
106: 44(ptr) AccessChain 97(@sampleStructTemp) 48 49
Store 106 105
107: 44(ptr) AccessChain 88(@sampleResultShadow) 58
108: 6(float) Load 107
109: 44(ptr) AccessChain 97(@sampleStructTemp) 57
Store 109 108
110: 10(s1_t) Load 97(@sampleStructTemp)
Store 87(s1) 110
114: 7 Load 113(g_tTex2s2)
115: 28 Load 30(g_sSamp)
116: 32 SampledImage 114 115
120: 21(fvec4) ImageSampleImplicitLod 116 119
Store 112(@sampleResultShadow) 120
122: 44(ptr) AccessChain 112(@sampleResultShadow) 43
123: 6(float) Load 122
124: 44(ptr) AccessChain 121(@sampleStructTemp) 41
Store 124 123
125: 44(ptr) AccessChain 112(@sampleResultShadow) 49
126: 6(float) Load 125
127: 44(ptr) AccessChain 121(@sampleStructTemp) 48 43
Store 127 126
128: 44(ptr) AccessChain 112(@sampleResultShadow) 53
129: 6(float) Load 128
130: 44(ptr) AccessChain 121(@sampleStructTemp) 48 49
Store 130 129
131: 44(ptr) AccessChain 112(@sampleResultShadow) 58
132: 6(float) Load 131
133: 44(ptr) AccessChain 121(@sampleStructTemp) 48 53
Store 133 132
134: 16(s2_t) Load 121(@sampleStructTemp)
Store 111(s2) 134
140: 7 Load 139(g_tTex2s3)
141: 28 Load 30(g_sSamp)
142: 32 SampledImage 140 141
146: 21(fvec4) ImageSampleImplicitLod 142 145
Store 138(@sampleResultShadow) 146
148: 44(ptr) AccessChain 138(@sampleResultShadow) 43
149: 6(float) Load 148
150: 44(ptr) AccessChain 147(@sampleStructTemp) 41 43
Store 150 149
151: 44(ptr) AccessChain 138(@sampleResultShadow) 49
152: 6(float) Load 151
153: 44(ptr) AccessChain 147(@sampleStructTemp) 41 49
Store 153 152
154: 44(ptr) AccessChain 138(@sampleResultShadow) 53
155: 6(float) Load 154
156: 44(ptr) AccessChain 147(@sampleStructTemp) 48
Store 156 155
157: 135(s3_t) Load 147(@sampleStructTemp)
Store 137(s3) 157
168: 165 Load 167(g_tTex2s4)
169: 28 Load 30(g_sSamp)
171: 170 SampledImage 168 169
175: 162(ivec4) ImageSampleImplicitLod 171 174
Store 164(@sampleResultShadow) 175
178: 177(ptr) AccessChain 164(@sampleResultShadow) 43
179: 40(int) Load 178
180: 177(ptr) AccessChain 176(@sampleStructTemp) 41
Store 180 179
181: 177(ptr) AccessChain 164(@sampleResultShadow) 49
182: 40(int) Load 181
183: 6(float) ConvertSToF 182
184: 177(ptr) AccessChain 176(@sampleStructTemp) 48 43
Store 184 183
185: 177(ptr) AccessChain 164(@sampleResultShadow) 53
186: 40(int) Load 185
187: 6(float) ConvertSToF 186
188: 177(ptr) AccessChain 176(@sampleStructTemp) 48 49
Store 188 187
189: 177(ptr) AccessChain 164(@sampleResultShadow) 58
190: 40(int) Load 189
191: 177(ptr) AccessChain 176(@sampleStructTemp) 57
Store 191 190
192: 159(s4_t) Load 176(@sampleStructTemp)
Store 161(s4) 192
202: 199 Load 201(g_tTex2s5)
203: 28 Load 30(g_sSamp)
205: 204 SampledImage 202 203
209: 196(ivec4) ImageSampleImplicitLod 205 208
Store 198(@sampleResultShadow) 209
212: 211(ptr) AccessChain 198(@sampleResultShadow) 43
213: 42(int) Load 212
214: 211(ptr) AccessChain 210(@sampleStructTemp) 41
Store 214 213
215: 211(ptr) AccessChain 198(@sampleResultShadow) 49
216: 42(int) Load 215
217: 211(ptr) AccessChain 210(@sampleStructTemp) 48
Store 217 216
218: 193(s5_t) Load 210(@sampleStructTemp)
Store 195(s5) 218
220: 10(s1_t) FunctionCall 13(fn1(t2-tx-struct0-1;) 89(g_tTex2s1)
Store 219(r0) 220
222: 16(s2_t) FunctionCall 19(fn1(t2-tx-struct1-1;) 113(g_tTex2s2)
Store 221(r1) 222
225: 10(s1_t) FunctionCall 13(fn1(t2-tx-struct0-1;) 224(g_tTex2s1a)
Store 223(r2) 225
ReturnValue 227
98(@sampleStructTemp): 38(ptr) Variable Function
112(s2): 70(ptr) Variable Function
113(@sampleResultShadow): 25(ptr) Variable Function
122(@sampleStructTemp): 70(ptr) Variable Function
138(s3): 137(ptr) Variable Function
139(@sampleResultShadow): 25(ptr) Variable Function
148(@sampleStructTemp): 137(ptr) Variable Function
162(s4): 161(ptr) Variable Function
165(@sampleResultShadow): 164(ptr) Variable Function
177(@sampleStructTemp): 161(ptr) Variable Function
196(s5): 195(ptr) Variable Function
199(@sampleResultShadow): 198(ptr) Variable Function
211(@sampleStructTemp): 195(ptr) Variable Function
220(r0): 38(ptr) Variable Function
221(param): 8(ptr) Variable Function
224(r1): 70(ptr) Variable Function
225(param): 8(ptr) Variable Function
228(r2): 38(ptr) Variable Function
230(param): 8(ptr) Variable Function
91: 7 Load 90(g_tTex2s1)
92: 28 Load 30(g_sSamp)
93: 32 SampledImage 91 92
97: 21(fvec4) ImageSampleImplicitLod 93 96
Store 88(@sampleResultShadow) 97
99: 44(ptr) AccessChain 88(@sampleResultShadow) 43
100: 6(float) Load 99
101: 44(ptr) AccessChain 98(@sampleStructTemp) 41
Store 101 100
102: 44(ptr) AccessChain 88(@sampleResultShadow) 49
103: 6(float) Load 102
104: 44(ptr) AccessChain 98(@sampleStructTemp) 48 43
Store 104 103
105: 44(ptr) AccessChain 88(@sampleResultShadow) 53
106: 6(float) Load 105
107: 44(ptr) AccessChain 98(@sampleStructTemp) 48 49
Store 107 106
108: 44(ptr) AccessChain 88(@sampleResultShadow) 58
109: 6(float) Load 108
110: 44(ptr) AccessChain 98(@sampleStructTemp) 57
Store 110 109
111: 10(s1_t) Load 98(@sampleStructTemp)
Store 87(s1) 111
115: 7 Load 114(g_tTex2s2)
116: 28 Load 30(g_sSamp)
117: 32 SampledImage 115 116
121: 21(fvec4) ImageSampleImplicitLod 117 120
Store 113(@sampleResultShadow) 121
123: 44(ptr) AccessChain 113(@sampleResultShadow) 43
124: 6(float) Load 123
125: 44(ptr) AccessChain 122(@sampleStructTemp) 41
Store 125 124
126: 44(ptr) AccessChain 113(@sampleResultShadow) 49
127: 6(float) Load 126
128: 44(ptr) AccessChain 122(@sampleStructTemp) 48 43
Store 128 127
129: 44(ptr) AccessChain 113(@sampleResultShadow) 53
130: 6(float) Load 129
131: 44(ptr) AccessChain 122(@sampleStructTemp) 48 49
Store 131 130
132: 44(ptr) AccessChain 113(@sampleResultShadow) 58
133: 6(float) Load 132
134: 44(ptr) AccessChain 122(@sampleStructTemp) 48 53
Store 134 133
135: 16(s2_t) Load 122(@sampleStructTemp)
Store 112(s2) 135
141: 7 Load 140(g_tTex2s3)
142: 28 Load 30(g_sSamp)
143: 32 SampledImage 141 142
147: 21(fvec4) ImageSampleImplicitLod 143 146
Store 139(@sampleResultShadow) 147
149: 44(ptr) AccessChain 139(@sampleResultShadow) 43
150: 6(float) Load 149
151: 44(ptr) AccessChain 148(@sampleStructTemp) 41 43
Store 151 150
152: 44(ptr) AccessChain 139(@sampleResultShadow) 49
153: 6(float) Load 152
154: 44(ptr) AccessChain 148(@sampleStructTemp) 41 49
Store 154 153
155: 44(ptr) AccessChain 139(@sampleResultShadow) 53
156: 6(float) Load 155
157: 44(ptr) AccessChain 148(@sampleStructTemp) 48
Store 157 156
158: 136(s3_t) Load 148(@sampleStructTemp)
Store 138(s3) 158
169: 166 Load 168(g_tTex2s4)
170: 28 Load 30(g_sSamp)
172: 171 SampledImage 169 170
176: 163(ivec4) ImageSampleImplicitLod 172 175
Store 165(@sampleResultShadow) 176
179: 178(ptr) AccessChain 165(@sampleResultShadow) 43
180: 40(int) Load 179
181: 178(ptr) AccessChain 177(@sampleStructTemp) 41
Store 181 180
182: 178(ptr) AccessChain 165(@sampleResultShadow) 49
183: 40(int) Load 182
184: 6(float) ConvertSToF 183
185: 178(ptr) AccessChain 177(@sampleStructTemp) 48 43
Store 185 184
186: 178(ptr) AccessChain 165(@sampleResultShadow) 53
187: 40(int) Load 186
188: 6(float) ConvertSToF 187
189: 178(ptr) AccessChain 177(@sampleStructTemp) 48 49
Store 189 188
190: 178(ptr) AccessChain 165(@sampleResultShadow) 58
191: 40(int) Load 190
192: 178(ptr) AccessChain 177(@sampleStructTemp) 57
Store 192 191
193: 160(s4_t) Load 177(@sampleStructTemp)
Store 162(s4) 193
203: 200 Load 202(g_tTex2s5)
204: 28 Load 30(g_sSamp)
206: 205 SampledImage 203 204
210: 197(ivec4) ImageSampleImplicitLod 206 209
Store 199(@sampleResultShadow) 210
213: 212(ptr) AccessChain 199(@sampleResultShadow) 43
214: 42(int) Load 213
215: 212(ptr) AccessChain 211(@sampleStructTemp) 41
Store 215 214
216: 212(ptr) AccessChain 199(@sampleResultShadow) 49
217: 42(int) Load 216
218: 212(ptr) AccessChain 211(@sampleStructTemp) 48
Store 218 217
219: 194(s5_t) Load 211(@sampleStructTemp)
Store 196(s5) 219
222: 7 Load 90(g_tTex2s1)
Store 221(param) 222
223: 10(s1_t) FunctionCall 13(fn1(t2-tx-struct0-1;) 221(param)
Store 220(r0) 223
226: 7 Load 114(g_tTex2s2)
Store 225(param) 226
227: 16(s2_t) FunctionCall 19(fn1(t2-tx-struct1-1;) 225(param)
Store 224(r1) 227
231: 7 Load 229(g_tTex2s1a)
Store 230(param) 231
232: 10(s1_t) FunctionCall 13(fn1(t2-tx-struct0-1;) 230(param)
Store 228(r2) 232
ReturnValue 234
FunctionEnd
Test/baseResults/hlsl.tx.overload.frag.out
View file @
5a57ca68
...
...
@@ -135,12 +135,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by
62
// Id's are bound by
73
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
60
EntryPoint Fragment 4 "main"
71
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
...
...
@@ -153,44 +153,51 @@ gl_FragCoord origin is upper left
Name 28 "Func(I21;"
Name 27 "DummyTex"
Name 31 "@main("
Name 44 "tf1"
Name 46 "tf4"
Name 50 "twf1"
Name 54 "twf4"
Name 60 "@entryPointOutput"
Decorate 44(tf1) DescriptorSet 0
Decorate 46(tf4) DescriptorSet 0
Decorate 50(twf1) DescriptorSet 0
Decorate 54(twf4) DescriptorSet 0
Decorate 60(@entryPointOutput) Location 0
Name 45 "tf1"
Name 46 "param"
Name 49 "tf4"
Name 50 "param"
Name 56 "twf1"
Name 57 "param"
Name 63 "twf4"
Name 64 "param"
Name 71 "@entryPointOutput"
Decorate 45(tf1) DescriptorSet 0
Decorate 49(tf4) DescriptorSet 0
Decorate 56(twf1) DescriptorSet 0
Decorate 63(twf4) DescriptorSet 0
Decorate 71(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeImage 6(float) 2D sampled format:Unknown
8: TypePointer
UniformConstant
7
8: TypePointer
Function
7
9: TypeFunction 6(float) 8(ptr)
13: TypeVector 6(float) 4
14: TypeFunction 13(fvec4) 8(ptr)
18: TypeImage 6(float) 2D nonsampled format:R32f
19: TypePointer
UniformConstant
18
19: TypePointer
Function
18
20: TypeFunction 6(float) 19(ptr)
24: TypeImage 6(float) 2D nonsampled format:Rgba32f
25: TypePointer
UniformConstant
24
25: TypePointer
Function
24
26: TypeFunction 13(fvec4) 25(ptr)
30: TypeFunction 13(fvec4)
33: 6(float) Constant 1065353216
36: 6(float) Constant 0
37: 13(fvec4) ConstantComposite 36 36 36 36
44(tf1): 8(ptr) Variable UniformConstant
46(tf4): 8(ptr) Variable UniformConstant
50(twf1): 19(ptr) Variable UniformConstant
54(twf4): 25(ptr) Variable UniformConstant
59: TypePointer Output 13(fvec4)
60(@entryPointOutput): 59(ptr) Variable Output
44: TypePointer UniformConstant 7
45(tf1): 44(ptr) Variable UniformConstant
49(tf4): 44(ptr) Variable UniformConstant
55: TypePointer UniformConstant 18
56(twf1): 55(ptr) Variable UniformConstant
62: TypePointer UniformConstant 24
63(twf4): 62(ptr) Variable UniformConstant
70: TypePointer Output 13(fvec4)
71(@entryPointOutput): 70(ptr) Variable Output
4(main): 2 Function None 3
5: Label
61
: 13(fvec4) FunctionCall 31(@main()
Store
60(@entryPointOutput) 61
72
: 13(fvec4) FunctionCall 31(@main()
Store
71(@entryPointOutput) 72
Return
FunctionEnd
11(Func(t211;): 6(float) Function None 9
...
...
@@ -215,14 +222,26 @@ gl_FragCoord origin is upper left
FunctionEnd
31(@main(): 13(fvec4) Function None 30
32: Label
45: 6(float) FunctionCall 11(Func(t211;) 44(tf1)
47: 13(fvec4) FunctionCall 16(Func(t21;) 46(tf4)
48: 13(fvec4) CompositeConstruct 45 45 45 45
49: 13(fvec4) FAdd 48 47
51: 6(float) FunctionCall 22(Func(I211;) 50(twf1)
52: 13(fvec4) CompositeConstruct 51 51 51 51
53: 13(fvec4) FAdd 49 52
55: 13(fvec4) FunctionCall 28(Func(I21;) 54(twf4)
56: 13(fvec4) FAdd 53 55
ReturnValue 56
46(param): 8(ptr) Variable Function
50(param): 8(ptr) Variable Function
57(param): 19(ptr) Variable Function
64(param): 25(ptr) Variable Function
47: 7 Load 45(tf1)
Store 46(param) 47
48: 6(float) FunctionCall 11(Func(t211;) 46(param)
51: 7 Load 49(tf4)
Store 50(param) 51
52: 13(fvec4) FunctionCall 16(Func(t21;) 50(param)
53: 13(fvec4) CompositeConstruct 48 48 48 48
54: 13(fvec4) FAdd 53 52
58: 18 Load 56(twf1)
Store 57(param) 58
59: 6(float) FunctionCall 22(Func(I211;) 57(param)
60: 13(fvec4) CompositeConstruct 59 59 59 59
61: 13(fvec4) FAdd 54 60
65: 24 Load 63(twf4)
Store 64(param) 65
66: 13(fvec4) FunctionCall 28(Func(I21;) 64(param)
67: 13(fvec4) FAdd 61 66
ReturnValue 67
FunctionEnd
glslang/Include/intermediate.h
View file @
5a57ca68
...
...
@@ -1286,7 +1286,7 @@ protected:
};
typedef
TVector
<
TIntermNode
*>
TIntermSequence
;
typedef
TVector
<
int
>
TQualifierList
;
typedef
TVector
<
TStorageQualifier
>
TQualifierList
;
//
// Nodes that operate on an arbitrary sized set of children.
//
...
...
glslang/MachineIndependent/localintermediate.h
View file @
5a57ca68
...
...
@@ -234,7 +234,8 @@ public:
hlslOffsets
(
false
),
useStorageBuffer
(
false
),
hlslIoMapping
(
false
),
textureSamplerTransformMode
(
EShTexSampTransKeep
)
textureSamplerTransformMode
(
EShTexSampTransKeep
),
needToLegalize
(
false
)
{
localSize
[
0
]
=
1
;
localSize
[
1
]
=
1
;
...
...
@@ -610,6 +611,9 @@ public:
void
addProcessArgument
(
const
std
::
string
&
arg
)
{
processes
.
addArgument
(
arg
);
}
const
std
::
vector
<
std
::
string
>&
getProcesses
()
const
{
return
processes
.
getProcesses
();
}
void
setNeedsLegalization
()
{
needToLegalize
=
true
;
}
bool
needsLegalization
()
const
{
return
needToLegalize
;
}
const
char
*
const
implicitThisName
;
protected
:
...
...
@@ -708,6 +712,8 @@ protected:
// for OpModuleProcessed, or equivalent
TProcesses
processes
;
bool
needToLegalize
;
private
:
void
operator
=
(
TIntermediate
&
);
// prevent assignments
};
...
...
hlsl/hlslParseHelper.cpp
View file @
5a57ca68
...
...
@@ -166,11 +166,6 @@ bool HlslParseContext::shouldConvertLValue(const TIntermNode* node) const
if
(
lhsAsAggregate
!=
nullptr
&&
lhsAsAggregate
->
getOp
()
==
EOpImageLoad
)
return
true
;
// If it's a syntactic write to a sampler, we will use that to establish
// a compile-time alias.
if
(
node
->
getAsTyped
()
->
getBasicType
()
==
EbtSampler
)
return
true
;
return
false
;
}
...
...
@@ -239,6 +234,13 @@ bool HlslParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, T
}
}
// We tolerate samplers as l-values, even though they are nominally
// illegal, because we expect a later optimization to eliminate them.
if
(
node
->
getType
().
getBasicType
()
==
EbtSampler
)
{
intermediate
.
setNeedsLegalization
();
return
false
;
}
// Let the base class check errors
return
TParseContextBase
::
lValueErrorCheck
(
loc
,
op
,
node
);
}
...
...
@@ -274,10 +276,6 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char*
// *** If we get here, we're going to apply some conversion to an l-value.
// Spin off sampler aliasing
if
(
node
->
getAsTyped
()
->
getBasicType
()
==
EbtSampler
)
return
handleSamplerLvalue
(
loc
,
op
,
node
);
// Helper to create a load.
const
auto
makeLoad
=
[
&
](
TIntermSymbol
*
rhsTmp
,
TIntermTyped
*
object
,
TIntermTyped
*
coord
,
const
TType
&
derefType
)
{
TIntermAggregate
*
loadOp
=
new
TIntermAggregate
(
EOpImageLoad
);
...
...
@@ -524,58 +522,6 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char*
return
node
;
}
// Deal with sampler aliasing: turning assignments into aliases
// Return a placeholder node for higher-level code that think assignments must
// generate code.
TIntermTyped
*
HlslParseContext
::
handleSamplerLvalue
(
const
TSourceLoc
&
loc
,
const
char
*
op
,
TIntermTyped
*&
node
)
{
// Can only alias an assignment: "s1 = s2"
TIntermBinary
*
binary
=
node
->
getAsBinaryNode
();
if
(
binary
==
nullptr
||
node
->
getAsOperator
()
->
getOp
()
!=
EOpAssign
||
binary
->
getLeft
()
->
getAsSymbolNode
()
==
nullptr
||
binary
->
getRight
()
->
getAsSymbolNode
()
==
nullptr
)
{
error
(
loc
,
"can't modify sampler"
,
op
,
""
);
return
node
;
}
if
(
controlFlowNestingLevel
>
0
)
warn
(
loc
,
"sampler or image aliased under control flow; consumption must be in same path"
,
op
,
""
);
TIntermTyped
*
set
=
setOpaqueLvalue
(
binary
->
getLeft
(),
binary
->
getRight
());
if
(
set
==
nullptr
)
warn
(
loc
,
"could not create alias for sampler"
,
op
,
""
);
else
node
=
set
;
return
node
;
}
// Do an opaque assignment that needs to turn into an alias.
// Return nullptr if it can't be done, otherwise return a placeholder
// node for higher-level code that think assignments must generate code.
TIntermTyped
*
HlslParseContext
::
setOpaqueLvalue
(
TIntermTyped
*
leftTyped
,
TIntermTyped
*
rightTyped
)
{
// Best is if we are aliasing a flattened struct member "S.s1 = s2",
// in which case we want to update the flattening information with the alias,
// making everything else work seamlessly.
TIntermSymbol
*
left
=
leftTyped
->
getAsSymbolNode
();
TIntermSymbol
*
right
=
rightTyped
->
getAsSymbolNode
();
for
(
auto
fit
=
flattenMap
.
begin
();
fit
!=
flattenMap
.
end
();
++
fit
)
{
for
(
auto
mit
=
fit
->
second
.
members
.
begin
();
mit
!=
fit
->
second
.
members
.
end
();
++
mit
)
{
if
((
*
mit
)
->
getUniqueId
()
==
left
->
getId
())
{
// found it: update with alias to the existing variable, and don't emit any code
(
*
mit
)
=
new
TVariable
(
&
right
->
getName
(),
right
->
getType
());
(
*
mit
)
->
setUniqueId
(
right
->
getId
());
// replace node (rest of compiler expects either an error or code to generate)
// with pointless access
return
right
;
}
}
}
return
nullptr
;
}
void
HlslParseContext
::
handlePragma
(
const
TSourceLoc
&
loc
,
const
TVector
<
TString
>&
tokens
)
{
if
(
pragmaCallback
)
...
...
@@ -2513,41 +2459,6 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc
return
assignList
;
}
// For a declaration with an initializer, where the initialized symbol is flattened,
// and possibly contains opaque values, such that the initializer should never exist
// as emitted code, because even creating the initializer would write opaques.
//
// If possible, decompose this into individual member-wise assignments, which themselves
// are expected to then not exist for opaque types, because they will turn into aliases.
//
// Return a node that contains the non-aliased assignments that must continue to exist.
TIntermTyped
*
HlslParseContext
::
executeFlattenedInitializer
(
const
TSourceLoc
&
loc
,
TIntermSymbol
*
symbol
,
TIntermAggregate
&
initializer
)
{
// We need individual RHS initializers per member to do this
const
TTypeList
*
typeList
=
symbol
->
getType
().
getStruct
();
if
(
typeList
==
nullptr
||
initializer
.
getSequence
().
size
()
!=
typeList
->
size
())
{
warn
(
loc
,
"cannot do member-wise aliasing for opaque members with this initializer"
,
"="
,
""
);
return
handleAssign
(
loc
,
EOpAssign
,
symbol
,
&
initializer
);
}
TIntermAggregate
*
initList
=
nullptr
;
// synthesize an access to each member, and then an assignment to it
for
(
int
member
=
0
;
member
<
(
int
)
typeList
->
size
();
++
member
)
{
TIntermTyped
*
memberInitializer
=
initializer
.
getSequence
()[
member
]
->
getAsTyped
();
TIntermTyped
*
flattenedMember
=
flattenAccess
(
symbol
,
member
);
if
(
flattenedMember
->
getType
().
containsOpaque
())
setOpaqueLvalue
(
flattenedMember
,
memberInitializer
);
else
initList
=
intermediate
.
growAggregate
(
initList
,
handleAssign
(
loc
,
EOpAssign
,
flattenedMember
,
memberInitializer
));
}
if
(
initList
)
initList
->
setOperator
(
EOpSequence
);
return
initList
;
}
// Some simple source assignments need to be flattened to a sequence
// of AST assignments. Catch these and flatten, otherwise, pass through
// to intermediate.addAssign().
...
...
@@ -2560,6 +2471,10 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
if
(
left
==
nullptr
||
right
==
nullptr
)
return
nullptr
;
// writing to opaques will require fixing transforms
if
(
left
->
getType
().
containsOpaque
())
intermediate
.
setNeedsLegalization
();
if
(
left
->
getAsOperator
()
&&
left
->
getAsOperator
()
->
getOp
()
==
EOpMatrixSwizzle
)
return
handleAssignToMatrixSwizzle
(
loc
,
op
,
left
,
right
);
...
...
@@ -2720,7 +2635,8 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
const
int
elementsL
=
left
->
getType
().
isArray
()
?
left
->
getType
().
getOuterArraySize
()
:
1
;
const
int
elementsR
=
right
->
getType
().
isArray
()
?
right
->
getType
().
getOuterArraySize
()
:
1
;
// The arrays may not be the same size, e.g, if the size has been forced for EbvTessLevelInner or Outer.
// The arrays might not be the same size,
// e.g., if the size has been forced for EbvTessLevelInner/Outer.
const
int
elementsToCopy
=
std
::
min
(
elementsL
,
elementsR
);
// array case
...
...
@@ -7616,21 +7532,11 @@ TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TInterm
// normal assigning of a value to a variable...
specializationCheck
(
loc
,
initializer
->
getType
(),
"initializer"
);
TIntermSymbol
*
intermSymbol
=
intermediate
.
addSymbol
(
*
variable
,
loc
);
// If we are flattening, it could be due to setting opaques, which must be handled
// as aliases, and the 'initializer' node cannot actually be emitted, because it
// itself stores the result of the constructor, and we can't store to opaques.
// handleAssign() will emit the initializer.
TIntermNode
*
initNode
=
nullptr
;
if
(
flattened
&&
intermSymbol
->
getType
().
containsOpaque
())
return
executeFlattenedInitializer
(
loc
,
intermSymbol
,
*
initializer
->
getAsAggregate
());
else
{
initNode
=
handleAssign
(
loc
,
EOpAssign
,
intermSymbol
,
initializer
);
TIntermNode
*
initNode
=
handleAssign
(
loc
,
EOpAssign
,
intermSymbol
,
initializer
);
if
(
initNode
==
nullptr
)
assignError
(
loc
,
"="
,
intermSymbol
->
getCompleteString
(),
initializer
->
getCompleteString
());
return
initNode
;
}
}
return
nullptr
;
}
...
...
@@ -9517,6 +9423,11 @@ void HlslParseContext::finish()
error
(
mipsOperatorMipArg
.
back
().
loc
,
"unterminated mips operator:"
,
""
,
""
);
}
// Communicate out (esp. for command line) that we formed AST that will make
// illegal AST SPIR-V and it needs transforms to legalize it.
if
(
intermediate
.
needsLegalization
())
infoSink
.
info
<<
"WARNING: AST will form illegal SPIR-V; need to transform to legalize"
;
removeUnusedStructBufferCounters
();
addPatchConstantInvocation
();
fixTextureShadowModes
();
...
...
hlsl/hlslParseHelper.h
View file @
5a57ca68
...
...
@@ -88,7 +88,6 @@ public:
void
remapNonEntryPointIO
(
TFunction
&
function
);
TIntermNode
*
handleReturnValue
(
const
TSourceLoc
&
,
TIntermTyped
*
);
void
handleFunctionArgument
(
TFunction
*
,
TIntermTyped
*&
arguments
,
TIntermTyped
*
newArg
);
TIntermTyped
*
executeFlattenedInitializer
(
const
TSourceLoc
&
,
TIntermSymbol
*
,
TIntermAggregate
&
);
TIntermTyped
*
handleAssign
(
const
TSourceLoc
&
,
TOperator
,
TIntermTyped
*
left
,
TIntermTyped
*
right
);
TIntermTyped
*
handleAssignToMatrixSwizzle
(
const
TSourceLoc
&
,
TOperator
,
TIntermTyped
*
left
,
TIntermTyped
*
right
);
TIntermTyped
*
handleFunctionCall
(
const
TSourceLoc
&
,
TFunction
*
,
TIntermTyped
*
);
...
...
@@ -191,8 +190,6 @@ public:
// Apply L-value conversions. E.g, turning a write to a RWTexture into an ImageStore.
TIntermTyped
*
handleLvalue
(
const
TSourceLoc
&
,
const
char
*
op
,
TIntermTyped
*&
node
);
TIntermTyped
*
handleSamplerLvalue
(
const
TSourceLoc
&
,
const
char
*
op
,
TIntermTyped
*&
node
);
TIntermTyped
*
setOpaqueLvalue
(
TIntermTyped
*
left
,
TIntermTyped
*
right
);
bool
lValueErrorCheck
(
const
TSourceLoc
&
,
const
char
*
op
,
TIntermTyped
*
)
override
;
TLayoutFormat
getLayoutFromTxType
(
const
TSourceLoc
&
,
const
TType
&
);
...
...
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