mirror of
https://github.com/RPCS3/glslang.git
synced 2024-12-03 16:41:30 +00:00
9220dbb078
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.
123 lines
6.0 KiB
Plaintext
123 lines
6.0 KiB
Plaintext
spv.precise.tesc
|
|
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
|
|
|
|
|
|
Linked tessellation control stage:
|
|
|
|
|
|
// Module Version 10000
|
|
// Generated by (magic number): 80001
|
|
// Id's are bound by 72
|
|
|
|
Capability Tessellation
|
|
1: ExtInstImport "GLSL.std.450"
|
|
MemoryModel Logical GLSL450
|
|
EntryPoint TessellationControl 4 "main" 12 15 20 30 40 45
|
|
ExecutionMode 4 OutputVertices 3
|
|
Source ESSL 310
|
|
SourceExtension "GL_EXT_gpu_shader5"
|
|
SourceExtension "GL_EXT_shader_io_blocks"
|
|
SourceExtension "GL_EXT_tessellation_shader"
|
|
Name 4 "main"
|
|
Name 12 "in_te_position"
|
|
Name 15 "gl_InvocationID"
|
|
Name 20 "in_tc_position"
|
|
Name 30 "gl_TessLevelInner"
|
|
Name 40 "gl_TessLevelOuter"
|
|
Name 45 "in_tc_tessParam"
|
|
Decorate 12(in_te_position) Location 0
|
|
Decorate 15(gl_InvocationID) BuiltIn InvocationId
|
|
Decorate 20(in_tc_position) Location 0
|
|
Decorate 30(gl_TessLevelInner) Patch
|
|
Decorate 30(gl_TessLevelInner) BuiltIn TessLevelInner
|
|
Decorate 40(gl_TessLevelOuter) Patch
|
|
Decorate 40(gl_TessLevelOuter) BuiltIn TessLevelOuter
|
|
Decorate 45(in_tc_tessParam) Location 1
|
|
Decorate 52 NoContraction
|
|
Decorate 53 NoContraction
|
|
Decorate 54 NoContraction
|
|
Decorate 60 NoContraction
|
|
Decorate 61 NoContraction
|
|
Decorate 62 NoContraction
|
|
Decorate 68 NoContraction
|
|
Decorate 69 NoContraction
|
|
Decorate 70 NoContraction
|
|
2: TypeVoid
|
|
3: TypeFunction 2
|
|
6: TypeFloat 32
|
|
7: TypeVector 6(float) 2
|
|
8: TypeInt 32 0
|
|
9: 8(int) Constant 3
|
|
10: TypeArray 7(fvec2) 9
|
|
11: TypePointer Output 10
|
|
12(in_te_position): 11(ptr) Variable Output
|
|
13: TypeInt 32 1
|
|
14: TypePointer Input 13(int)
|
|
15(gl_InvocationID): 14(ptr) Variable Input
|
|
17: 8(int) Constant 32
|
|
18: TypeArray 7(fvec2) 17
|
|
19: TypePointer Input 18
|
|
20(in_tc_position): 19(ptr) Variable Input
|
|
22: TypePointer Input 7(fvec2)
|
|
25: TypePointer Output 7(fvec2)
|
|
27: 8(int) Constant 2
|
|
28: TypeArray 6(float) 27
|
|
29: TypePointer Output 28
|
|
30(gl_TessLevelInner): 29(ptr) Variable Output
|
|
31: 13(int) Constant 0
|
|
32: 6(float) Constant 1084227584
|
|
33: TypePointer Output 6(float)
|
|
35: 13(int) Constant 1
|
|
37: 8(int) Constant 4
|
|
38: TypeArray 6(float) 37
|
|
39: TypePointer Output 38
|
|
40(gl_TessLevelOuter): 39(ptr) Variable Output
|
|
41: 6(float) Constant 1065353216
|
|
42: 6(float) Constant 1105985536
|
|
43: TypeArray 6(float) 17
|
|
44: TypePointer Input 43
|
|
45(in_tc_tessParam): 44(ptr) Variable Input
|
|
46: TypePointer Input 6(float)
|
|
49: 13(int) Constant 2
|
|
4(main): 2 Function None 3
|
|
5: Label
|
|
16: 13(int) Load 15(gl_InvocationID)
|
|
21: 13(int) Load 15(gl_InvocationID)
|
|
23: 22(ptr) AccessChain 20(in_tc_position) 21
|
|
24: 7(fvec2) Load 23
|
|
26: 25(ptr) AccessChain 12(in_te_position) 16
|
|
Store 26 24
|
|
34: 33(ptr) AccessChain 30(gl_TessLevelInner) 31
|
|
Store 34 32
|
|
36: 33(ptr) AccessChain 30(gl_TessLevelInner) 35
|
|
Store 36 32
|
|
47: 46(ptr) AccessChain 45(in_tc_tessParam) 35
|
|
48: 6(float) Load 47
|
|
50: 46(ptr) AccessChain 45(in_tc_tessParam) 49
|
|
51: 6(float) Load 50
|
|
52: 6(float) FAdd 48 51
|
|
53: 6(float) FMul 42 52
|
|
54: 6(float) FAdd 41 53
|
|
55: 33(ptr) AccessChain 40(gl_TessLevelOuter) 31
|
|
Store 55 54
|
|
56: 46(ptr) AccessChain 45(in_tc_tessParam) 49
|
|
57: 6(float) Load 56
|
|
58: 46(ptr) AccessChain 45(in_tc_tessParam) 31
|
|
59: 6(float) Load 58
|
|
60: 6(float) FAdd 57 59
|
|
61: 6(float) FMul 42 60
|
|
62: 6(float) FAdd 41 61
|
|
63: 33(ptr) AccessChain 40(gl_TessLevelOuter) 35
|
|
Store 63 62
|
|
64: 46(ptr) AccessChain 45(in_tc_tessParam) 31
|
|
65: 6(float) Load 64
|
|
66: 46(ptr) AccessChain 45(in_tc_tessParam) 35
|
|
67: 6(float) Load 66
|
|
68: 6(float) FAdd 65 67
|
|
69: 6(float) FMul 42 68
|
|
70: 6(float) FAdd 41 69
|
|
71: 33(ptr) AccessChain 40(gl_TessLevelOuter) 49
|
|
Store 71 70
|
|
Return
|
|
FunctionEnd
|