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

@ -6,42 +6,70 @@ gl_FragCoord origin is upper left
0:3 Function Parameters:
0:? Sequence
0:4 Sequence
0:4 move second child to first child ( temp mediump float)
0:4 'h0' ( temp mediump float)
0:4 move second child to first child ( temp float)
0:4 'h0' ( temp float)
0:4 Constant:
0:4 0.000000
0:5 Sequence
0:5 move second child to first child ( temp mediump 1-component vector of float)
0:5 'h1' ( temp mediump 1-component vector of float)
0:5 move second child to first child ( temp 1-component vector of float)
0:5 'h1' ( temp 1-component vector of float)
0:5 Constant:
0:5 1.000000
0:6 Sequence
0:6 move second child to first child ( temp mediump 2-component vector of float)
0:6 'h2' ( temp mediump 2-component vector of float)
0:6 move second child to first child ( temp 2-component vector of float)
0:6 'h2' ( temp 2-component vector of float)
0:6 Constant:
0:6 2.000000
0:6 2.000000
0:7 Sequence
0:7 move second child to first child ( temp mediump 3-component vector of float)
0:7 'h3' ( temp mediump 3-component vector of float)
0:7 move second child to first child ( temp 3-component vector of float)
0:7 'h3' ( temp 3-component vector of float)
0:7 Constant:
0:7 3.000000
0:7 3.000000
0:7 3.000000
0:8 Sequence
0:8 move second child to first child ( temp mediump 4-component vector of float)
0:8 'h4' ( temp mediump 4-component vector of float)
0:8 move second child to first child ( temp 4-component vector of float)
0:8 'h4' ( temp 4-component vector of float)
0:8 Constant:
0:8 4.000000
0:8 4.000000
0:8 4.000000
0:8 4.000000
0:10 Branch: Return with expression
0:10 Constant:
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:15 Sequence
0:15 move second child to first child ( temp 2X2 matrix of float)
0:15 'h22' ( temp 2X2 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:16 Sequence
0:16 move second child to first child ( temp 2X3 matrix of float)
0:16 'h23' ( temp 2X3 matrix of float)
0:16 Constant:
0:16 4.900000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 4.900000
0:16 0.000000
0:27 Branch: Return with expression
0:27 Construct vec4 ( temp 4-component vector of float)
0:27 add ( temp float)
0:27 add ( temp float)
0:27 direct index ( temp float)
0:27 direct index ( temp 3-component vector of float)
0:27 'h23' ( temp 2X3 matrix of float)
0:27 Constant:
0:27 0 (const int)
0:27 Constant:
0:27 0 (const int)
0:27 direct index ( temp float)
0:27 'h4' ( temp 4-component vector of float)
0:27 Constant:
0:27 1 (const int)
0:27 'h0' ( temp float)
0:3 Function Definition: main( ( temp void)
0:3 Function Parameters:
0:? Sequence
@ -62,42 +90,70 @@ gl_FragCoord origin is upper left
0:3 Function Parameters:
0:? Sequence
0:4 Sequence
0:4 move second child to first child ( temp mediump float)
0:4 'h0' ( temp mediump float)
0:4 move second child to first child ( temp float)
0:4 'h0' ( temp float)
0:4 Constant:
0:4 0.000000
0:5 Sequence
0:5 move second child to first child ( temp mediump 1-component vector of float)
0:5 'h1' ( temp mediump 1-component vector of float)
0:5 move second child to first child ( temp 1-component vector of float)
0:5 'h1' ( temp 1-component vector of float)
0:5 Constant:
0:5 1.000000
0:6 Sequence
0:6 move second child to first child ( temp mediump 2-component vector of float)
0:6 'h2' ( temp mediump 2-component vector of float)
0:6 move second child to first child ( temp 2-component vector of float)
0:6 'h2' ( temp 2-component vector of float)
0:6 Constant:
0:6 2.000000
0:6 2.000000
0:7 Sequence
0:7 move second child to first child ( temp mediump 3-component vector of float)
0:7 'h3' ( temp mediump 3-component vector of float)
0:7 move second child to first child ( temp 3-component vector of float)
0:7 'h3' ( temp 3-component vector of float)
0:7 Constant:
0:7 3.000000
0:7 3.000000
0:7 3.000000
0:8 Sequence
0:8 move second child to first child ( temp mediump 4-component vector of float)
0:8 'h4' ( temp mediump 4-component vector of float)
0:8 move second child to first child ( temp 4-component vector of float)
0:8 'h4' ( temp 4-component vector of float)
0:8 Constant:
0:8 4.000000
0:8 4.000000
0:8 4.000000
0:8 4.000000
0:10 Branch: Return with expression
0:10 Constant:
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:15 Sequence
0:15 move second child to first child ( temp 2X2 matrix of float)
0:15 'h22' ( temp 2X2 matrix of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:16 Sequence
0:16 move second child to first child ( temp 2X3 matrix of float)
0:16 'h23' ( temp 2X3 matrix of float)
0:16 Constant:
0:16 4.900000
0:16 0.000000
0:16 0.000000
0:16 0.000000
0:16 4.900000
0:16 0.000000
0:27 Branch: Return with expression
0:27 Construct vec4 ( temp 4-component vector of float)
0:27 add ( temp float)
0:27 add ( temp float)
0:27 direct index ( temp float)
0:27 direct index ( temp 3-component vector of float)
0:27 'h23' ( temp 2X3 matrix of float)
0:27 Constant:
0:27 0 (const int)
0:27 Constant:
0:27 0 (const int)
0:27 direct index ( temp float)
0:27 'h4' ( temp 4-component vector of float)
0:27 Constant:
0:27 1 (const int)
0:27 'h0' ( temp float)
0:3 Function Definition: main( ( temp void)
0:3 Function Parameters:
0:? Sequence
@ -109,12 +165,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 36
// Id's are bound by 61
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 34
EntryPoint Fragment 4 "main" 59
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
@ -124,13 +180,10 @@ gl_FragCoord origin is upper left
Name 18 "h2"
Name 23 "h3"
Name 27 "h4"
Name 34 "@entryPointOutput"
Decorate 12(h0) RelaxedPrecision
Decorate 14(h1) RelaxedPrecision
Decorate 18(h2) RelaxedPrecision
Decorate 23(h3) RelaxedPrecision
Decorate 27(h4) RelaxedPrecision
Decorate 34(@entryPointOutput) Location 0
Name 32 "h22"
Name 38 "h23"
Name 59 "@entryPointOutput"
Decorate 59(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -150,13 +203,28 @@ gl_FragCoord origin is upper left
26: TypePointer Function 7(fvec4)
28: 6(float) Constant 1082130432
29: 7(fvec4) ConstantComposite 28 28 28 28
30: 7(fvec4) ConstantComposite 13 13 13 13
33: TypePointer Output 7(fvec4)
34(@entryPointOutput): 33(ptr) Variable Output
30: TypeMatrix 16(fvec2) 2
31: TypePointer Function 30
33: 16(fvec2) ConstantComposite 15 19
34: 16(fvec2) ConstantComposite 24 28
35: 30 ConstantComposite 33 34
36: TypeMatrix 21(fvec3) 2
37: TypePointer Function 36
39: 6(float) Constant 1084017869
40: 21(fvec3) ConstantComposite 39 13 13
41: 21(fvec3) ConstantComposite 13 39 13
42: 36 ConstantComposite 40 41
43: TypeInt 32 1
44: 43(int) Constant 0
45: TypeInt 32 0
46: 45(int) Constant 0
49: 45(int) Constant 1
58: TypePointer Output 7(fvec4)
59(@entryPointOutput): 58(ptr) Variable Output
4(main): 2 Function None 3
5: Label
35: 7(fvec4) FunctionCall 9(@main()
Store 34(@entryPointOutput) 35
60: 7(fvec4) FunctionCall 9(@main()
Store 59(@entryPointOutput) 60
Return
FunctionEnd
9(@main(): 7(fvec4) Function None 8
@ -166,10 +234,22 @@ gl_FragCoord origin is upper left
18(h2): 17(ptr) Variable Function
23(h3): 22(ptr) Variable Function
27(h4): 26(ptr) Variable Function
32(h22): 31(ptr) Variable Function
38(h23): 37(ptr) Variable Function
Store 12(h0) 13
Store 14(h1) 15
Store 18(h2) 20
Store 23(h3) 25
Store 27(h4) 29
ReturnValue 30
Store 32(h22) 35
Store 38(h23) 42
47: 11(ptr) AccessChain 38(h23) 44 46
48: 6(float) Load 47
50: 11(ptr) AccessChain 27(h4) 49
51: 6(float) Load 50
52: 6(float) FAdd 48 51
53: 6(float) Load 12(h0)
54: 6(float) FAdd 52 53
55: 7(fvec4) CompositeConstruct 54 54 54 54
ReturnValue 55
FunctionEnd