HLSL: Remove workarounds for assigning to opaques.

This assumes it will be combined with optimizing transforms
that eliminate assignments to opaques.
This commit is contained in:
John Kessenich 2017-09-07 04:33:11 -06:00 committed by GregF
parent dabd1bf2f0
commit 15fa7ef5f5
7 changed files with 313 additions and 234 deletions

View file

@ -1,4 +1,5 @@
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 Constant:
0:11 0.500000
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 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 Constant:
0:11 0.500000
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 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 65
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 44
EntryPoint Vertex 4 "main" 63
Source HLSL 500
Name 4 "main"
Name 17 "lookUp(struct-FxaaTex-p1-t21-f11;"
@ -100,14 +143,21 @@ 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 37 "g_tInputTexture_sampler"
Name 39 "g_tInputTexture"
Name 43 "tex.smpl"
Name 48 "tex.tex"
Name 52 "tex.f"
Name 57 "param"
Name 63 "@entryPointOutput"
Decorate 37(g_tInputTexture_sampler) DescriptorSet 0
Decorate 39(g_tInputTexture) DescriptorSet 0
Decorate 63(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
@ -122,15 +172,25 @@ 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 UniformConstant 34(FxaaTex)
36(flattenTemp): 35(ptr) Variable UniformConstant
37(g_tInputTexture_sampler): 7(ptr) Variable UniformConstant
39(g_tInputTexture): 10(ptr) Variable UniformConstant
41: 8(float) Constant 1056964608
43(tex.smpl): 7(ptr) Variable UniformConstant
44: TypeInt 32 1
45: 44(int) Constant 0
48(tex.tex): 10(ptr) Variable UniformConstant
49: 44(int) Constant 1
53: 44(int) Constant 2
54: TypePointer UniformConstant 8(float)
62: TypePointer Output 12(fvec4)
63(@entryPointOutput): 62(ptr) Variable Output
4(main): 2 Function None 3
5: Label
45: 12(fvec4) FunctionCall 20(@main()
Store 44(@entryPointOutput) 45
64: 12(fvec4) FunctionCall 20(@main()
Store 63(@entryPointOutput) 64
Return
FunctionEnd
17(lookUp(struct-FxaaTex-p1-t21-f11;): 12(fvec4) Function None 13
@ -149,11 +209,23 @@ 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
52(tex.f): 11(ptr) Variable Function
57(param): 11(ptr) Variable Function
38: 6 Load 37(g_tInputTexture_sampler)
40: 9 Load 39(g_tInputTexture)
42: 34(FxaaTex) CompositeConstruct 38 40 41
Store 36(flattenTemp) 42
46: 7(ptr) AccessChain 36(flattenTemp) 45
47: 6 Load 46
Store 43(tex.smpl) 47
50: 10(ptr) AccessChain 36(flattenTemp) 49
51: 9 Load 50
Store 48(tex.tex) 51
55: 54(ptr) AccessChain 36(flattenTemp) 53
56: 8(float) Load 55
Store 52(tex.f) 56
58: 8(float) Load 52(tex.f)
Store 57(param) 58
59: 12(fvec4) FunctionCall 17(lookUp(struct-FxaaTex-p1-t21-f11;) 43(tex.smpl) 48(tex.tex) 57(param)
ReturnValue 59
FunctionEnd