
This PR adds a CreateParseContext() fn analogous to CreateBuiltInParseables(), to create a language specific built in parser. (This code was present before but not encapsualted in a fn). This can now be used to create a source language specific parser for builtins. Along with this, the code creating HLSL intrinsic prototypes can now produce them in HLSL syntax, rather than GLSL syntax. This relaxes certain prior restrictions at the parser level. Lower layers (e.g, SPIR-V) may still have such restrictions, such as around Nx1 matrices: this code does not impact that. This PR also fleshes out matrix types for bools and ints, both of which were partially in place before. This was easier than maintaining the restrictions in the HLSL prototype generator to avoid creating protoypes with those types. Many tests change because the result type from intrinsics moves from "global" to "temp". Several new tests are added for the new types.
170 lines
7.6 KiB
Plaintext
170 lines
7.6 KiB
Plaintext
hlsl.intrinsics.double.frag
|
|
Shader version: 450
|
|
gl_FragCoord origin is upper left
|
|
0:? Sequence
|
|
0:5 Function Definition: PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; (temp float)
|
|
0:5 Function Parameters:
|
|
0:5 'inDV1a' (layout(location=0 ) in double)
|
|
0:5 'inDV1b' (layout(location=1 ) in double)
|
|
0:5 'inDV1c' (layout(location=2 ) in double)
|
|
0:5 'inDV2' (layout(location=3 ) in 2-component vector of double)
|
|
0:5 'inDV3' (layout(location=4 ) in 3-component vector of double)
|
|
0:5 'inDV4' (layout(location=6 ) in 4-component vector of double)
|
|
0:5 'inU1a' (layout(location=8 ) in uint)
|
|
0:5 'inU1b' (layout(location=9 ) in uint)
|
|
0:? Sequence
|
|
0:6 Sequence
|
|
0:6 move second child to first child (temp double)
|
|
0:6 'r00' (temp double)
|
|
0:6 fma (temp double)
|
|
0:6 'inDV1a' (layout(location=0 ) in double)
|
|
0:6 'inDV1b' (layout(location=1 ) in double)
|
|
0:6 'inDV1c' (layout(location=2 ) in double)
|
|
0:7 Sequence
|
|
0:7 move second child to first child (temp double)
|
|
0:7 'r01' (temp double)
|
|
0:7 uint64BitsToDouble (temp double)
|
|
0:7 Construct uvec2 (temp 2-component vector of uint)
|
|
0:7 'inU1a' (layout(location=8 ) in uint)
|
|
0:7 'inU1b' (layout(location=9 ) in uint)
|
|
0:9 Sequence
|
|
0:9 move second child to first child (temp float)
|
|
0:? '@entryPointOutput' (layout(location=0 ) out float)
|
|
0:9 Constant:
|
|
0:9 0.000000
|
|
0:9 Branch: Return
|
|
0:? Linker Objects
|
|
0:? '@entryPointOutput' (layout(location=0 ) out float)
|
|
0:? 'inDV1a' (layout(location=0 ) in double)
|
|
0:? 'inDV1b' (layout(location=1 ) in double)
|
|
0:? 'inDV1c' (layout(location=2 ) in double)
|
|
0:? 'inDV2' (layout(location=3 ) in 2-component vector of double)
|
|
0:? 'inDV3' (layout(location=4 ) in 3-component vector of double)
|
|
0:? 'inDV4' (layout(location=6 ) in 4-component vector of double)
|
|
0:? 'inU1a' (layout(location=8 ) in uint)
|
|
0:? 'inU1b' (layout(location=9 ) in uint)
|
|
|
|
|
|
Linked fragment stage:
|
|
|
|
|
|
Shader version: 450
|
|
gl_FragCoord origin is upper left
|
|
0:? Sequence
|
|
0:5 Function Definition: PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; (temp float)
|
|
0:5 Function Parameters:
|
|
0:5 'inDV1a' (layout(location=0 ) in double)
|
|
0:5 'inDV1b' (layout(location=1 ) in double)
|
|
0:5 'inDV1c' (layout(location=2 ) in double)
|
|
0:5 'inDV2' (layout(location=3 ) in 2-component vector of double)
|
|
0:5 'inDV3' (layout(location=4 ) in 3-component vector of double)
|
|
0:5 'inDV4' (layout(location=6 ) in 4-component vector of double)
|
|
0:5 'inU1a' (layout(location=8 ) in uint)
|
|
0:5 'inU1b' (layout(location=9 ) in uint)
|
|
0:? Sequence
|
|
0:6 Sequence
|
|
0:6 move second child to first child (temp double)
|
|
0:6 'r00' (temp double)
|
|
0:6 fma (temp double)
|
|
0:6 'inDV1a' (layout(location=0 ) in double)
|
|
0:6 'inDV1b' (layout(location=1 ) in double)
|
|
0:6 'inDV1c' (layout(location=2 ) in double)
|
|
0:7 Sequence
|
|
0:7 move second child to first child (temp double)
|
|
0:7 'r01' (temp double)
|
|
0:7 uint64BitsToDouble (temp double)
|
|
0:7 Construct uvec2 (temp 2-component vector of uint)
|
|
0:7 'inU1a' (layout(location=8 ) in uint)
|
|
0:7 'inU1b' (layout(location=9 ) in uint)
|
|
0:9 Sequence
|
|
0:9 move second child to first child (temp float)
|
|
0:? '@entryPointOutput' (layout(location=0 ) out float)
|
|
0:9 Constant:
|
|
0:9 0.000000
|
|
0:9 Branch: Return
|
|
0:? Linker Objects
|
|
0:? '@entryPointOutput' (layout(location=0 ) out float)
|
|
0:? 'inDV1a' (layout(location=0 ) in double)
|
|
0:? 'inDV1b' (layout(location=1 ) in double)
|
|
0:? 'inDV1c' (layout(location=2 ) in double)
|
|
0:? 'inDV2' (layout(location=3 ) in 2-component vector of double)
|
|
0:? 'inDV3' (layout(location=4 ) in 3-component vector of double)
|
|
0:? 'inDV4' (layout(location=6 ) in 4-component vector of double)
|
|
0:? 'inU1a' (layout(location=8 ) in uint)
|
|
0:? 'inU1b' (layout(location=9 ) in uint)
|
|
|
|
// Module Version 10000
|
|
// Generated by (magic number): 80001
|
|
// Id's are bound by 41
|
|
|
|
Capability Shader
|
|
Capability Float64
|
|
1: ExtInstImport "GLSL.std.450"
|
|
MemoryModel Logical GLSL450
|
|
EntryPoint Fragment 4 "PixelShaderFunction" 10 12 14 20 22 29 34 37 40
|
|
ExecutionMode 4 OriginUpperLeft
|
|
Name 4 "PixelShaderFunction"
|
|
Name 8 "r00"
|
|
Name 10 "inDV1a"
|
|
Name 12 "inDV1b"
|
|
Name 14 "inDV1c"
|
|
Name 17 "r01"
|
|
Name 20 "inU1a"
|
|
Name 22 "inU1b"
|
|
Name 29 "@entryPointOutput"
|
|
Name 34 "inDV2"
|
|
Name 37 "inDV3"
|
|
Name 40 "inDV4"
|
|
Decorate 10(inDV1a) Location 0
|
|
Decorate 12(inDV1b) Location 1
|
|
Decorate 14(inDV1c) Location 2
|
|
Decorate 20(inU1a) Location 8
|
|
Decorate 22(inU1b) Location 9
|
|
Decorate 29(@entryPointOutput) Location 0
|
|
Decorate 34(inDV2) Location 3
|
|
Decorate 37(inDV3) Location 4
|
|
Decorate 40(inDV4) Location 6
|
|
2: TypeVoid
|
|
3: TypeFunction 2
|
|
6: TypeFloat 64
|
|
7: TypePointer Function 6(float)
|
|
9: TypePointer Input 6(float)
|
|
10(inDV1a): 9(ptr) Variable Input
|
|
12(inDV1b): 9(ptr) Variable Input
|
|
14(inDV1c): 9(ptr) Variable Input
|
|
18: TypeInt 32 0
|
|
19: TypePointer Input 18(int)
|
|
20(inU1a): 19(ptr) Variable Input
|
|
22(inU1b): 19(ptr) Variable Input
|
|
24: TypeVector 18(int) 2
|
|
27: TypeFloat 32
|
|
28: TypePointer Output 27(float)
|
|
29(@entryPointOutput): 28(ptr) Variable Output
|
|
30: 27(float) Constant 0
|
|
32: TypeVector 6(float) 2
|
|
33: TypePointer Input 32(fvec2)
|
|
34(inDV2): 33(ptr) Variable Input
|
|
35: TypeVector 6(float) 3
|
|
36: TypePointer Input 35(fvec3)
|
|
37(inDV3): 36(ptr) Variable Input
|
|
38: TypeVector 6(float) 4
|
|
39: TypePointer Input 38(fvec4)
|
|
40(inDV4): 39(ptr) Variable Input
|
|
4(PixelShaderFunction): 2 Function None 3
|
|
5: Label
|
|
8(r00): 7(ptr) Variable Function
|
|
17(r01): 7(ptr) Variable Function
|
|
11: 6(float) Load 10(inDV1a)
|
|
13: 6(float) Load 12(inDV1b)
|
|
15: 6(float) Load 14(inDV1c)
|
|
16: 6(float) ExtInst 1(GLSL.std.450) 50(Fma) 11 13 15
|
|
Store 8(r00) 16
|
|
21: 18(int) Load 20(inU1a)
|
|
23: 18(int) Load 22(inU1b)
|
|
25: 24(ivec2) CompositeConstruct 21 23
|
|
26: 6(float) Bitcast 25
|
|
Store 17(r01) 26
|
|
Store 29(@entryPointOutput) 30
|
|
Return
|
|
FunctionEnd
|