HLSL: Implement half matrices, and map all half* -> float*.

This commit is contained in:
John Kessenich 2017-06-06 23:35:25 -06:00
parent f6deacd579
commit 96f65521b4
7 changed files with 311 additions and 75 deletions

View file

@ -50,8 +50,8 @@ gl_FragCoord origin is upper left
0:15 'min10float' ( temp mediump float)
0:15 'min16float' ( temp mediump float)
0:16 Sequence
0:16 move second child to first child ( temp mediump float)
0:16 'half' ( temp mediump float)
0:16 move second child to first child ( temp float)
0:16 'half' ( temp float)
0:16 Constant:
0:16 0.500000
0:? Sequence
@ -99,9 +99,17 @@ gl_FragCoord origin is upper left
0:25 'float' ( temp mediump float)
0:25 Function Call: fn(f1; ( temp mediump float)
0:25 'float' ( temp mediump float)
0:27 Branch: Return with expression
0:27 Construct vec4 ( temp 4-component vector of float)
0:27 'float' ( temp float)
0:29 Branch: Return with expression
0:29 Construct vec4 ( temp 4-component vector of float)
0:29 add ( temp float)
0:29 'float' ( temp float)
0:29 direct index ( temp float)
0:29 direct index ( temp 3-component vector of float)
0:29 'half2x3' ( temp 2X3 matrix of float)
0:29 Constant:
0:29 0 (const int)
0:29 Constant:
0:29 0 (const int)
0:9 Function Definition: main( ( temp void)
0:9 Function Parameters:
0:? Sequence
@ -166,8 +174,8 @@ gl_FragCoord origin is upper left
0:15 'min10float' ( temp mediump float)
0:15 'min16float' ( temp mediump float)
0:16 Sequence
0:16 move second child to first child ( temp mediump float)
0:16 'half' ( temp mediump float)
0:16 move second child to first child ( temp float)
0:16 'half' ( temp float)
0:16 Constant:
0:16 0.500000
0:? Sequence
@ -215,9 +223,17 @@ gl_FragCoord origin is upper left
0:25 'float' ( temp mediump float)
0:25 Function Call: fn(f1; ( temp mediump float)
0:25 'float' ( temp mediump float)
0:27 Branch: Return with expression
0:27 Construct vec4 ( temp 4-component vector of float)
0:27 'float' ( temp float)
0:29 Branch: Return with expression
0:29 Construct vec4 ( temp 4-component vector of float)
0:29 add ( temp float)
0:29 'float' ( temp float)
0:29 direct index ( temp float)
0:29 direct index ( temp 3-component vector of float)
0:29 'half2x3' ( temp 2X3 matrix of float)
0:29 Constant:
0:29 0 (const int)
0:29 Constant:
0:29 0 (const int)
0:9 Function Definition: main( ( temp void)
0:9 Function Parameters:
0:? Sequence
@ -229,12 +245,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 97
// Id's are bound by 105
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 95
EntryPoint Fragment 4 "main" 103
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
@ -252,13 +268,13 @@ gl_FragCoord origin is upper left
MemberName 56(foo_t) 0 "float"
Name 58 "float"
Name 86 "param"
Name 95 "@entryPointOutput"
Name 94 "half2x3"
Name 103 "@entryPointOutput"
Decorate 49(min16float) RelaxedPrecision
Decorate 50 RelaxedPrecision
Decorate 51 RelaxedPrecision
Decorate 52(min10float) RelaxedPrecision
Decorate 53 RelaxedPrecision
Decorate 54(half) RelaxedPrecision
Decorate 64 RelaxedPrecision
Decorate 65 RelaxedPrecision
Decorate 66 RelaxedPrecision
@ -278,7 +294,7 @@ gl_FragCoord origin is upper left
Decorate 87 RelaxedPrecision
Decorate 88 RelaxedPrecision
Decorate 89 RelaxedPrecision
Decorate 95(@entryPointOutput) Location 0
Decorate 103(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -303,12 +319,16 @@ gl_FragCoord origin is upper left
56(foo_t): TypeStruct 6(float)
57: TypePointer Function 56(foo_t)
59: 6(float) Constant 1109917696
94: TypePointer Output 12(fvec4)
95(@entryPointOutput): 94(ptr) Variable Output
91: TypeVector 6(float) 3
92: TypeMatrix 91(fvec3) 2
93: TypePointer Function 92
95: 22(int) Constant 0
102: TypePointer Output 12(fvec4)
103(@entryPointOutput): 102(ptr) Variable Output
4(main): 2 Function None 3
5: Label
96: 12(fvec4) FunctionCall 14(@main()
Store 95(@entryPointOutput) 96
104: 12(fvec4) FunctionCall 14(@main()
Store 103(@entryPointOutput) 104
Return
FunctionEnd
10(fn(f1;): 6(float) Function None 8
@ -329,6 +349,7 @@ gl_FragCoord origin is upper left
58(float): 57(ptr) Variable Function
75: 7(ptr) Variable Function
86(param): 7(ptr) Variable Function
94(half2x3): 93(ptr) Variable Function
Store 19(float) 20
27: 6(float) Load 19(float)
29: 21(bool) FOrdNotEqual 27 28
@ -391,6 +412,9 @@ gl_FragCoord origin is upper left
89: 6(float) FAdd 85 88
Store 19(float) 89
90: 6(float) Load 19(float)
91: 12(fvec4) CompositeConstruct 90 90 90 90
ReturnValue 91
96: 7(ptr) AccessChain 94(half2x3) 40 95
97: 6(float) Load 96
98: 6(float) FAdd 90 97
99: 12(fvec4) CompositeConstruct 98 98 98 98
ReturnValue 99
FunctionEnd