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.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,18 +22,24 @@ 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 'gss2' ( uniform sampler)
0:20 'gss' ( uniform sampler)
0:21 'gtex' ( uniform texture2D)
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)
0:22 Constant:
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,18 +78,24 @@ 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 'gss2' ( uniform sampler)
0:20 'gss' ( uniform sampler)
0:21 'gtex' ( uniform texture2D)
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)
0:22 Constant:
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 53
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 46
EntryPoint Fragment 4 "main" 51
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
@ -111,16 +124,18 @@ 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 36 "gss2"
Name 38 "gss"
Name 40 "os.tex"
Name 41 "gtex"
Name 43 "os.a"
Name 45 "param"
Name 51 "@entryPointOutput"
Decorate 36(gss2) DescriptorSet 0
Decorate 38(gss) DescriptorSet 0
Decorate 41(gtex) DescriptorSet 0
Decorate 51(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
@ -137,16 +152,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
35(os.ss): 7(ptr) Variable UniformConstant
36(gss2): 7(ptr) Variable UniformConstant
38(gss): 7(ptr) Variable UniformConstant
40(os.tex): 11(ptr) Variable UniformConstant
41(gtex): 11(ptr) Variable UniformConstant
44: 8(float) Constant 1077936128
50: TypePointer Output 12(fvec4)
51(@entryPointOutput): 50(ptr) Variable Output
4(main): 2 Function None 3
5: Label
47: 12(fvec4) FunctionCall 20(@main()
Store 46(@entryPointOutput) 47
52: 12(fvec4) FunctionCall 20(@main()
Store 51(@entryPointOutput) 52
Return
FunctionEnd
17(osCall(struct-OS-p1-f1-t211;): 12(fvec4) Function None 13
@ -164,11 +181,17 @@ 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
43(os.a): 9(ptr) Variable Function
45(param): 9(ptr) Variable Function
37: 6 Load 36(gss2)
Store 35(os.ss) 37
39: 6 Load 38(gss)
Store 35(os.ss) 39
42: 10 Load 41(gtex)
Store 40(os.tex) 42
Store 43(os.a) 44
46: 8(float) Load 43(os.a)
Store 45(param) 46
47: 12(fvec4) FunctionCall 17(osCall(struct-OS-p1-f1-t211;) 35(os.ss) 45(param) 40(os.tex)
ReturnValue 47
FunctionEnd