
Reimplement the whole workflow to make that: precise'ness of struct members won't spread to other non-precise members of the same struct instance. Approach: 1. Build the map from symbols to their defining nodes. And for each object node (StructIndex, DirectIndex, Symbol nodes, etc), generates an accesschain path. Different AST nodes that indicating a same object should have the same accesschain path. 2. Along the building phase in step 1, collect the initial set of 'precise' (AST qualifier: 'noContraction') objects' accesschain paths. 3. Start with the initial set of 'precise' accesschain paths, use it as a worklist, do as the following steps until the worklist is empty: 1) Pop an accesschain path from worklist. 2) Get the symbol part from the accesschain path. 3) Find the defining nodes of that symbol. 4) For each defining node, check whether it is defining a 'precise' object, or its assignee has nested 'precise' object. Get the incremental path from assignee to its nested 'precise' object (if any). 5) Traverse the right side of the defining node, obtain the accesschain paths of the corresponding involved 'precise' objects. Update the worklist with those new objects' accesschain paths. Label involved operations with 'noContraction'. In each step, whenever we find the parent object of an nested object is 'precise' (has 'noContraction' qualifier), we let the nested object inherit the 'precise'ness from its parent object.
193 lines
9.3 KiB
Plaintext
193 lines
9.3 KiB
Plaintext
spv.precise.tese
|
|
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
|
|
|
|
|
|
Linked tessellation evaluation stage:
|
|
|
|
|
|
// Module Version 10000
|
|
// Generated by (magic number): 80001
|
|
// Id's are bound by 119
|
|
|
|
Capability Tessellation
|
|
Capability TessellationPointSize
|
|
1: ExtInstImport "GLSL.std.450"
|
|
MemoryModel Logical GLSL450
|
|
EntryPoint TessellationEvaluation 4 "main" 12 21 62 112
|
|
ExecutionMode 4 Triangles
|
|
ExecutionMode 4 SpacingEqual
|
|
ExecutionMode 4 VertexOrderCcw
|
|
Source ESSL 310
|
|
SourceExtension "GL_EXT_gpu_shader5"
|
|
SourceExtension "GL_EXT_shader_io_blocks"
|
|
SourceExtension "GL_EXT_tessellation_shader"
|
|
Name 4 "main"
|
|
Name 9 "pos"
|
|
Name 12 "gl_TessCoord"
|
|
Name 21 "in_te_position"
|
|
Name 45 "f"
|
|
Name 62 "in_f_color"
|
|
Name 73 "bits"
|
|
Name 77 "numBits"
|
|
Name 78 "i"
|
|
Name 110 "gl_PerVertex"
|
|
MemberName 110(gl_PerVertex) 0 "gl_Position"
|
|
MemberName 110(gl_PerVertex) 1 "gl_PointSize"
|
|
Name 112 ""
|
|
Decorate 12(gl_TessCoord) BuiltIn TessCoord
|
|
Decorate 21(in_te_position) Location 0
|
|
Decorate 27 NoContraction
|
|
Decorate 34 NoContraction
|
|
Decorate 35 NoContraction
|
|
Decorate 42 NoContraction
|
|
Decorate 43 NoContraction
|
|
Decorate 62(in_f_color) RelaxedPrecision
|
|
Decorate 62(in_f_color) Location 0
|
|
Decorate 67 RelaxedPrecision
|
|
Decorate 68 RelaxedPrecision
|
|
Decorate 69 RelaxedPrecision
|
|
Decorate 70 RelaxedPrecision
|
|
Decorate 97 NoContraction
|
|
Decorate 99 NoContraction
|
|
Decorate 101 NoContraction
|
|
Decorate 106 NoContraction
|
|
Decorate 109 NoContraction
|
|
MemberDecorate 110(gl_PerVertex) 0 BuiltIn Position
|
|
MemberDecorate 110(gl_PerVertex) 1 BuiltIn PointSize
|
|
Decorate 110(gl_PerVertex) Block
|
|
2: TypeVoid
|
|
3: TypeFunction 2
|
|
6: TypeFloat 32
|
|
7: TypeVector 6(float) 2
|
|
8: TypePointer Function 7(fvec2)
|
|
10: TypeVector 6(float) 3
|
|
11: TypePointer Input 10(fvec3)
|
|
12(gl_TessCoord): 11(ptr) Variable Input
|
|
13: TypeInt 32 0
|
|
14: 13(int) Constant 0
|
|
15: TypePointer Input 6(float)
|
|
18: 13(int) Constant 32
|
|
19: TypeArray 7(fvec2) 18
|
|
20: TypePointer Input 19
|
|
21(in_te_position): 20(ptr) Variable Input
|
|
22: TypeInt 32 1
|
|
23: 22(int) Constant 0
|
|
24: TypePointer Input 7(fvec2)
|
|
28: 13(int) Constant 1
|
|
31: 22(int) Constant 1
|
|
36: 13(int) Constant 2
|
|
39: 22(int) Constant 2
|
|
44: TypePointer Function 6(float)
|
|
46: 6(float) Constant 1077936128
|
|
57: 6(float) Constant 1056964608
|
|
60: TypeVector 6(float) 4
|
|
61: TypePointer Output 60(fvec4)
|
|
62(in_f_color): 61(ptr) Variable Output
|
|
66: 6(float) Constant 1065353216
|
|
71: TypeVector 13(int) 2
|
|
72: TypePointer Function 71(ivec2)
|
|
76: TypePointer Function 13(int)
|
|
85: TypeBool
|
|
105: 6(float) Constant 1025758986
|
|
110(gl_PerVertex): TypeStruct 60(fvec4) 6(float)
|
|
111: TypePointer Output 110(gl_PerVertex)
|
|
112: 111(ptr) Variable Output
|
|
114: 6(float) Constant 0
|
|
4(main): 2 Function None 3
|
|
5: Label
|
|
9(pos): 8(ptr) Variable Function
|
|
45(f): 44(ptr) Variable Function
|
|
73(bits): 72(ptr) Variable Function
|
|
77(numBits): 76(ptr) Variable Function
|
|
78(i): 76(ptr) Variable Function
|
|
16: 15(ptr) AccessChain 12(gl_TessCoord) 14
|
|
17: 6(float) Load 16
|
|
25: 24(ptr) AccessChain 21(in_te_position) 23
|
|
26: 7(fvec2) Load 25
|
|
27: 7(fvec2) VectorTimesScalar 26 17
|
|
29: 15(ptr) AccessChain 12(gl_TessCoord) 28
|
|
30: 6(float) Load 29
|
|
32: 24(ptr) AccessChain 21(in_te_position) 31
|
|
33: 7(fvec2) Load 32
|
|
34: 7(fvec2) VectorTimesScalar 33 30
|
|
35: 7(fvec2) FAdd 27 34
|
|
37: 15(ptr) AccessChain 12(gl_TessCoord) 36
|
|
38: 6(float) Load 37
|
|
40: 24(ptr) AccessChain 21(in_te_position) 39
|
|
41: 7(fvec2) Load 40
|
|
42: 7(fvec2) VectorTimesScalar 41 38
|
|
43: 7(fvec2) FAdd 35 42
|
|
Store 9(pos) 43
|
|
47: 15(ptr) AccessChain 12(gl_TessCoord) 14
|
|
48: 6(float) Load 47
|
|
49: 15(ptr) AccessChain 12(gl_TessCoord) 28
|
|
50: 6(float) Load 49
|
|
51: 15(ptr) AccessChain 12(gl_TessCoord) 36
|
|
52: 6(float) Load 51
|
|
53: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 50 52
|
|
54: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 48 53
|
|
55: 6(float) FMul 46 54
|
|
56: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 55
|
|
58: 6(float) FMul 56 57
|
|
59: 6(float) FAdd 58 57
|
|
Store 45(f) 59
|
|
63: 10(fvec3) Load 12(gl_TessCoord)
|
|
64: 6(float) Load 45(f)
|
|
65: 10(fvec3) VectorTimesScalar 63 64
|
|
67: 6(float) CompositeExtract 65 0
|
|
68: 6(float) CompositeExtract 65 1
|
|
69: 6(float) CompositeExtract 65 2
|
|
70: 60(fvec4) CompositeConstruct 67 68 69 66
|
|
Store 62(in_f_color) 70
|
|
74: 7(fvec2) Load 9(pos)
|
|
75: 71(ivec2) Bitcast 74
|
|
Store 73(bits) 75
|
|
Store 77(numBits) 14
|
|
Store 78(i) 14
|
|
Branch 79
|
|
79: Label
|
|
LoopMerge 81 82 None
|
|
Branch 83
|
|
83: Label
|
|
84: 13(int) Load 78(i)
|
|
86: 85(bool) ULessThan 84 18
|
|
BranchConditional 86 80 81
|
|
80: Label
|
|
87: 76(ptr) AccessChain 73(bits) 14
|
|
88: 13(int) Load 87
|
|
89: 13(int) Load 78(i)
|
|
90: 13(int) ShiftLeftLogical 88 89
|
|
91: 13(int) BitwiseAnd 90 28
|
|
92: 76(ptr) AccessChain 73(bits) 28
|
|
93: 13(int) Load 92
|
|
94: 13(int) Load 78(i)
|
|
95: 13(int) ShiftLeftLogical 93 94
|
|
96: 13(int) BitwiseAnd 95 28
|
|
97: 13(int) IAdd 91 96
|
|
98: 13(int) Load 77(numBits)
|
|
99: 13(int) IAdd 98 97
|
|
Store 77(numBits) 99
|
|
Branch 82
|
|
82: Label
|
|
100: 13(int) Load 78(i)
|
|
101: 13(int) IAdd 100 31
|
|
Store 78(i) 101
|
|
Branch 79
|
|
81: Label
|
|
102: 13(int) Load 77(numBits)
|
|
103: 13(int) BitwiseAnd 102 28
|
|
104: 6(float) ConvertUToF 103
|
|
106: 6(float) FMul 104 105
|
|
107: 7(fvec2) Load 9(pos)
|
|
108: 7(fvec2) CompositeConstruct 106 106
|
|
109: 7(fvec2) FAdd 107 108
|
|
Store 9(pos) 109
|
|
113: 7(fvec2) Load 9(pos)
|
|
115: 6(float) CompositeExtract 113 0
|
|
116: 6(float) CompositeExtract 113 1
|
|
117: 60(fvec4) CompositeConstruct 115 116 114 66
|
|
118: 61(ptr) AccessChain 112 23
|
|
Store 118 117
|
|
Return
|
|
FunctionEnd
|