
This obsoletes WIP PR #704, which was built on the pre entry point wrapping master. New version here uses entry point wrapping. This is a limited implementation of tessellation shaders. In particular, the following are not functional, and will be added as separate stages to reduce the size of each PR. * patchconstantfunctions accepting per-control-point input values, such as const OutputPatch <hs_out_t, 3> cpv are not implemented. * patchconstantfunctions whose signature requires an aggregate input type such as a structure containing builtin variables. Code to synthesize such calls is not yet present. These restrictions will be relaxed as soon as possible. Simple cases can compile now: see for example Test/hulsl.hull.1.tesc - e.g, writing to inner and outer tessellation factors. PCF invocation is synthesized as an entry point epilogue protected behind a barrier and a test on invocation ID == 0. If there is an existing invocation ID variable it will be used, otherwise one is added to the linkage. The PCF and the shader EP interfaces are unioned and builtins appearing in the PCF but not the EP are also added to the linkage and synthesized as shader inputs. Parameter matching to (eventually arbitrary) PCF signatures is by builtin variable type. Any user variables in the PCF signature will result in an error. Overloaded PCF functions will also result in an error. [domain()], [partitioning()], [outputtopology()], [outputcontrolpoints()], and [patchconstantfunction()] attributes to the shader entry point are in place, with the exception of the Pow2 partitioning mode.
358 lines
18 KiB
Plaintext
358 lines
18 KiB
Plaintext
hlsl.hull.2.tesc
|
|
Shader version: 450
|
|
vertices = 4
|
|
0:? Sequence
|
|
0:26 Function Definition: @main(struct-VS_OUT-vf31[4]; (temp structure{temp 3-component vector of float cpoint})
|
|
0:26 Function Parameters:
|
|
0:26 'ip' (in 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:? Sequence
|
|
0:28 move second child to first child (temp 3-component vector of float)
|
|
0:28 cpoint: direct index for structure (temp 3-component vector of float)
|
|
0:28 'output' (temp structure{temp 3-component vector of float cpoint})
|
|
0:28 Constant:
|
|
0:28 0 (const int)
|
|
0:28 cpoint: direct index for structure (temp 3-component vector of float)
|
|
0:28 direct index (temp structure{temp 3-component vector of float cpoint})
|
|
0:28 'ip' (in 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:28 Constant:
|
|
0:28 0 (const int)
|
|
0:28 Constant:
|
|
0:28 0 (const int)
|
|
0:29 Branch: Return with expression
|
|
0:29 'output' (temp structure{temp 3-component vector of float cpoint})
|
|
0:26 Function Definition: main( (temp void)
|
|
0:26 Function Parameters:
|
|
0:? Sequence
|
|
0:26 move second child to first child (temp 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:? 'ip' (temp 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:? 'ip' (layout(location=0 ) in 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:26 move second child to first child (temp structure{temp 3-component vector of float cpoint})
|
|
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp 3-component vector of float cpoint})
|
|
0:26 Function Call: @main(struct-VS_OUT-vf31[4]; (temp structure{temp 3-component vector of float cpoint})
|
|
0:? 'ip' (temp 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:? Barrier (temp void)
|
|
0:? Test condition and select (temp void)
|
|
0:? Condition
|
|
0:? Compare Equal (temp bool)
|
|
0:? 'InvocationId' (in uint InvocationID)
|
|
0:? Constant:
|
|
0:? 0 (const int)
|
|
0:? true case
|
|
0:? Sequence
|
|
0:? move second child to first child (temp structure{temp 2-element array of float edges})
|
|
0:? '@patchConstantResult' (temp structure{temp 2-element array of float edges})
|
|
0:? Function Call: PCF(u1;vf4; (temp structure{temp 2-element array of float edges})
|
|
0:? 'pid' (in uint PrimitiveID)
|
|
0:? 'pos' (in 4-component vector of float Position)
|
|
0:? Sequence
|
|
0:? move second child to first child (temp float)
|
|
0:? direct index (out float TessLevelOuter)
|
|
0:? '@patchConstantOutput_edges' (out 2-element array of float TessLevelOuter)
|
|
0:? Constant:
|
|
0:? 0 (const int)
|
|
0:? direct index (temp float)
|
|
0:? edges: direct index for structure (temp 2-element array of float)
|
|
0:? '@patchConstantResult' (temp structure{temp 2-element array of float edges})
|
|
0:? Constant:
|
|
0:? 0 (const int)
|
|
0:? Constant:
|
|
0:? 0 (const int)
|
|
0:? move second child to first child (temp float)
|
|
0:? direct index (out float TessLevelOuter)
|
|
0:? '@patchConstantOutput_edges' (out 2-element array of float TessLevelOuter)
|
|
0:? Constant:
|
|
0:? 1 (const int)
|
|
0:? direct index (temp float)
|
|
0:? edges: direct index for structure (temp 2-element array of float)
|
|
0:? '@patchConstantResult' (temp structure{temp 2-element array of float edges})
|
|
0:? Constant:
|
|
0:? 0 (const int)
|
|
0:? Constant:
|
|
0:? 1 (const int)
|
|
0:33 Function Definition: PCF(u1;vf4; (temp structure{temp 2-element array of float edges})
|
|
0:33 Function Parameters:
|
|
0:33 'pid' (in uint)
|
|
0:33 'pos' (in 4-component vector of float)
|
|
0:? Sequence
|
|
0:36 move second child to first child (temp float)
|
|
0:36 direct index (temp float)
|
|
0:36 edges: direct index for structure (temp 2-element array of float)
|
|
0:36 'output' (temp structure{temp 2-element array of float edges})
|
|
0:36 Constant:
|
|
0:36 0 (const int)
|
|
0:36 Constant:
|
|
0:36 0 (const int)
|
|
0:36 Constant:
|
|
0:36 2.000000
|
|
0:37 move second child to first child (temp float)
|
|
0:37 direct index (temp float)
|
|
0:37 edges: direct index for structure (temp 2-element array of float)
|
|
0:37 'output' (temp structure{temp 2-element array of float edges})
|
|
0:37 Constant:
|
|
0:37 0 (const int)
|
|
0:37 Constant:
|
|
0:37 1 (const int)
|
|
0:37 Constant:
|
|
0:37 8.000000
|
|
0:38 Branch: Return with expression
|
|
0:38 'output' (temp structure{temp 2-element array of float edges})
|
|
0:? Linker Objects
|
|
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp 3-component vector of float cpoint})
|
|
0:? 'ip' (layout(location=0 ) in 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:? 'pid' (in uint PrimitiveID)
|
|
0:? 'pos' (in 4-component vector of float Position)
|
|
0:? 'InvocationId' (in uint InvocationID)
|
|
0:? '@patchConstantOutput_edges' (out 2-element array of float TessLevelOuter)
|
|
|
|
|
|
Linked tessellation control stage:
|
|
|
|
|
|
Shader version: 450
|
|
vertices = 4
|
|
0:? Sequence
|
|
0:26 Function Definition: @main(struct-VS_OUT-vf31[4]; (temp structure{temp 3-component vector of float cpoint})
|
|
0:26 Function Parameters:
|
|
0:26 'ip' (in 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:? Sequence
|
|
0:28 move second child to first child (temp 3-component vector of float)
|
|
0:28 cpoint: direct index for structure (temp 3-component vector of float)
|
|
0:28 'output' (temp structure{temp 3-component vector of float cpoint})
|
|
0:28 Constant:
|
|
0:28 0 (const int)
|
|
0:28 cpoint: direct index for structure (temp 3-component vector of float)
|
|
0:28 direct index (temp structure{temp 3-component vector of float cpoint})
|
|
0:28 'ip' (in 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:28 Constant:
|
|
0:28 0 (const int)
|
|
0:28 Constant:
|
|
0:28 0 (const int)
|
|
0:29 Branch: Return with expression
|
|
0:29 'output' (temp structure{temp 3-component vector of float cpoint})
|
|
0:26 Function Definition: main( (temp void)
|
|
0:26 Function Parameters:
|
|
0:? Sequence
|
|
0:26 move second child to first child (temp 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:? 'ip' (temp 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:? 'ip' (layout(location=0 ) in 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:26 move second child to first child (temp structure{temp 3-component vector of float cpoint})
|
|
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp 3-component vector of float cpoint})
|
|
0:26 Function Call: @main(struct-VS_OUT-vf31[4]; (temp structure{temp 3-component vector of float cpoint})
|
|
0:? 'ip' (temp 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:? Barrier (temp void)
|
|
0:? Test condition and select (temp void)
|
|
0:? Condition
|
|
0:? Compare Equal (temp bool)
|
|
0:? 'InvocationId' (in uint InvocationID)
|
|
0:? Constant:
|
|
0:? 0 (const int)
|
|
0:? true case
|
|
0:? Sequence
|
|
0:? move second child to first child (temp structure{temp 2-element array of float edges})
|
|
0:? '@patchConstantResult' (temp structure{temp 2-element array of float edges})
|
|
0:? Function Call: PCF(u1;vf4; (temp structure{temp 2-element array of float edges})
|
|
0:? 'pid' (in uint PrimitiveID)
|
|
0:? 'pos' (in 4-component vector of float Position)
|
|
0:? Sequence
|
|
0:? move second child to first child (temp float)
|
|
0:? direct index (out float TessLevelOuter)
|
|
0:? '@patchConstantOutput_edges' (out 2-element array of float TessLevelOuter)
|
|
0:? Constant:
|
|
0:? 0 (const int)
|
|
0:? direct index (temp float)
|
|
0:? edges: direct index for structure (temp 2-element array of float)
|
|
0:? '@patchConstantResult' (temp structure{temp 2-element array of float edges})
|
|
0:? Constant:
|
|
0:? 0 (const int)
|
|
0:? Constant:
|
|
0:? 0 (const int)
|
|
0:? move second child to first child (temp float)
|
|
0:? direct index (out float TessLevelOuter)
|
|
0:? '@patchConstantOutput_edges' (out 2-element array of float TessLevelOuter)
|
|
0:? Constant:
|
|
0:? 1 (const int)
|
|
0:? direct index (temp float)
|
|
0:? edges: direct index for structure (temp 2-element array of float)
|
|
0:? '@patchConstantResult' (temp structure{temp 2-element array of float edges})
|
|
0:? Constant:
|
|
0:? 0 (const int)
|
|
0:? Constant:
|
|
0:? 1 (const int)
|
|
0:33 Function Definition: PCF(u1;vf4; (temp structure{temp 2-element array of float edges})
|
|
0:33 Function Parameters:
|
|
0:33 'pid' (in uint)
|
|
0:33 'pos' (in 4-component vector of float)
|
|
0:? Sequence
|
|
0:36 move second child to first child (temp float)
|
|
0:36 direct index (temp float)
|
|
0:36 edges: direct index for structure (temp 2-element array of float)
|
|
0:36 'output' (temp structure{temp 2-element array of float edges})
|
|
0:36 Constant:
|
|
0:36 0 (const int)
|
|
0:36 Constant:
|
|
0:36 0 (const int)
|
|
0:36 Constant:
|
|
0:36 2.000000
|
|
0:37 move second child to first child (temp float)
|
|
0:37 direct index (temp float)
|
|
0:37 edges: direct index for structure (temp 2-element array of float)
|
|
0:37 'output' (temp structure{temp 2-element array of float edges})
|
|
0:37 Constant:
|
|
0:37 0 (const int)
|
|
0:37 Constant:
|
|
0:37 1 (const int)
|
|
0:37 Constant:
|
|
0:37 8.000000
|
|
0:38 Branch: Return with expression
|
|
0:38 'output' (temp structure{temp 2-element array of float edges})
|
|
0:? Linker Objects
|
|
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp 3-component vector of float cpoint})
|
|
0:? 'ip' (layout(location=0 ) in 4-element array of structure{temp 3-component vector of float cpoint})
|
|
0:? 'pid' (in uint PrimitiveID)
|
|
0:? 'pos' (in 4-component vector of float Position)
|
|
0:? 'InvocationId' (in uint InvocationID)
|
|
0:? '@patchConstantOutput_edges' (out 2-element array of float TessLevelOuter)
|
|
|
|
// Module Version 10000
|
|
// Generated by (magic number): 80001
|
|
// Id's are bound by 87
|
|
|
|
Capability Tessellation
|
|
1: ExtInstImport "GLSL.std.450"
|
|
MemoryModel Logical GLSL450
|
|
EntryPoint TessellationControl 4 "main" 42 45 52 60 62 69
|
|
ExecutionMode 4 OutputVertices 4
|
|
Name 4 "main"
|
|
Name 8 "VS_OUT"
|
|
MemberName 8(VS_OUT) 0 "cpoint"
|
|
Name 13 "HS_OUT"
|
|
MemberName 13(HS_OUT) 0 "cpoint"
|
|
Name 16 "@main(struct-VS_OUT-vf31[4];"
|
|
Name 15 "ip"
|
|
Name 23 "HS_CONSTANT_OUT"
|
|
MemberName 23(HS_CONSTANT_OUT) 0 "edges"
|
|
Name 27 "PCF(u1;vf4;"
|
|
Name 25 "pid"
|
|
Name 26 "pos"
|
|
Name 30 "output"
|
|
Name 40 "ip"
|
|
Name 42 "ip"
|
|
Name 45 "@entryPointOutput"
|
|
Name 46 "param"
|
|
Name 52 "InvocationId"
|
|
Name 59 "@patchConstantResult"
|
|
Name 60 "pid"
|
|
Name 62 "pos"
|
|
Name 63 "param"
|
|
Name 65 "param"
|
|
Name 69 "@patchConstantOutput_edges"
|
|
Name 79 "output"
|
|
Decorate 42(ip) Location 0
|
|
Decorate 45(@entryPointOutput) Location 0
|
|
Decorate 52(InvocationId) BuiltIn InvocationId
|
|
Decorate 60(pid) BuiltIn PrimitiveId
|
|
Decorate 62(pos) BuiltIn Position
|
|
Decorate 69(@patchConstantOutput_edges) BuiltIn TessLevelOuter
|
|
2: TypeVoid
|
|
3: TypeFunction 2
|
|
6: TypeFloat 32
|
|
7: TypeVector 6(float) 3
|
|
8(VS_OUT): TypeStruct 7(fvec3)
|
|
9: TypeInt 32 0
|
|
10: 9(int) Constant 4
|
|
11: TypeArray 8(VS_OUT) 10
|
|
12: TypePointer Function 11
|
|
13(HS_OUT): TypeStruct 7(fvec3)
|
|
14: TypeFunction 13(HS_OUT) 12(ptr)
|
|
18: TypePointer Function 9(int)
|
|
19: TypeVector 6(float) 4
|
|
20: TypePointer Function 19(fvec4)
|
|
21: 9(int) Constant 2
|
|
22: TypeArray 6(float) 21
|
|
23(HS_CONSTANT_OUT): TypeStruct 22
|
|
24: TypeFunction 23(HS_CONSTANT_OUT) 18(ptr) 20(ptr)
|
|
29: TypePointer Function 13(HS_OUT)
|
|
31: TypeInt 32 1
|
|
32: 31(int) Constant 0
|
|
33: TypePointer Function 7(fvec3)
|
|
41: TypePointer Input 11
|
|
42(ip): 41(ptr) Variable Input
|
|
44: TypePointer Output 13(HS_OUT)
|
|
45(@entryPointOutput): 44(ptr) Variable Output
|
|
49: 9(int) Constant 1
|
|
50: 9(int) Constant 0
|
|
51: TypePointer Input 9(int)
|
|
52(InvocationId): 51(ptr) Variable Input
|
|
54: TypeBool
|
|
58: TypePointer Function 23(HS_CONSTANT_OUT)
|
|
60(pid): 51(ptr) Variable Input
|
|
61: TypePointer Input 19(fvec4)
|
|
62(pos): 61(ptr) Variable Input
|
|
68: TypePointer Output 22
|
|
69(@patchConstantOutput_edges): 68(ptr) Variable Output
|
|
70: TypePointer Function 6(float)
|
|
73: TypePointer Output 6(float)
|
|
75: 31(int) Constant 1
|
|
80: 6(float) Constant 1073741824
|
|
82: 6(float) Constant 1090519040
|
|
4(main): 2 Function None 3
|
|
5: Label
|
|
40(ip): 12(ptr) Variable Function
|
|
46(param): 12(ptr) Variable Function
|
|
59(@patchConstantResult): 58(ptr) Variable Function
|
|
63(param): 18(ptr) Variable Function
|
|
65(param): 20(ptr) Variable Function
|
|
43: 11 Load 42(ip)
|
|
Store 40(ip) 43
|
|
47: 11 Load 40(ip)
|
|
Store 46(param) 47
|
|
48: 13(HS_OUT) FunctionCall 16(@main(struct-VS_OUT-vf31[4];) 46(param)
|
|
Store 45(@entryPointOutput) 48
|
|
ControlBarrier 21 49 50
|
|
53: 9(int) Load 52(InvocationId)
|
|
55: 54(bool) IEqual 53 32
|
|
SelectionMerge 57 None
|
|
BranchConditional 55 56 57
|
|
56: Label
|
|
64: 9(int) Load 60(pid)
|
|
Store 63(param) 64
|
|
66: 19(fvec4) Load 62(pos)
|
|
Store 65(param) 66
|
|
67:23(HS_CONSTANT_OUT) FunctionCall 27(PCF(u1;vf4;) 63(param) 65(param)
|
|
Store 59(@patchConstantResult) 67
|
|
71: 70(ptr) AccessChain 59(@patchConstantResult) 32 32
|
|
72: 6(float) Load 71
|
|
74: 73(ptr) AccessChain 69(@patchConstantOutput_edges) 32
|
|
Store 74 72
|
|
76: 70(ptr) AccessChain 59(@patchConstantResult) 32 75
|
|
77: 6(float) Load 76
|
|
78: 73(ptr) AccessChain 69(@patchConstantOutput_edges) 75
|
|
Store 78 77
|
|
Branch 57
|
|
57: Label
|
|
Return
|
|
FunctionEnd
|
|
16(@main(struct-VS_OUT-vf31[4];): 13(HS_OUT) Function None 14
|
|
15(ip): 12(ptr) FunctionParameter
|
|
17: Label
|
|
30(output): 29(ptr) Variable Function
|
|
34: 33(ptr) AccessChain 15(ip) 32 32
|
|
35: 7(fvec3) Load 34
|
|
36: 33(ptr) AccessChain 30(output) 32
|
|
Store 36 35
|
|
37: 13(HS_OUT) Load 30(output)
|
|
ReturnValue 37
|
|
FunctionEnd
|
|
27(PCF(u1;vf4;):23(HS_CONSTANT_OUT) Function None 24
|
|
25(pid): 18(ptr) FunctionParameter
|
|
26(pos): 20(ptr) FunctionParameter
|
|
28: Label
|
|
79(output): 58(ptr) Variable Function
|
|
81: 70(ptr) AccessChain 79(output) 32 32
|
|
Store 81 80
|
|
83: 70(ptr) AccessChain 79(output) 32 75
|
|
Store 83 82
|
|
84:23(HS_CONSTANT_OUT) Load 79(output)
|
|
ReturnValue 84
|
|
FunctionEnd
|