HLSL: Pass opaques by local copy, instead of by interface original.

Also, remove assumption that if something is opaque that it
must be in the UniformConstant storage class.

This allows function declarations to know all parameters will
be in the Function storage class.
This commit is contained in:
John Kessenich 2017-09-08 02:38:07 -06:00 committed by GregF
parent 15fa7ef5f5
commit bed4e4f7e4
12 changed files with 976 additions and 841 deletions

View file

@ -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