gstaichi 0.1.25.dev0__cp312-cp312-macosx_15_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. gstaichi/__init__.py +40 -0
  2. gstaichi/__main__.py +5 -0
  3. gstaichi/_funcs.py +706 -0
  4. gstaichi/_kernels.py +420 -0
  5. gstaichi/_lib/__init__.py +3 -0
  6. gstaichi/_lib/core/__init__.py +0 -0
  7. gstaichi/_lib/core/gstaichi_python.cpython-312-darwin.so +0 -0
  8. gstaichi/_lib/core/gstaichi_python.pyi +2939 -0
  9. gstaichi/_lib/core/py.typed +0 -0
  10. gstaichi/_lib/runtime/libMoltenVK.dylib +0 -0
  11. gstaichi/_lib/runtime/runtime_arm64.bc +0 -0
  12. gstaichi/_lib/utils.py +249 -0
  13. gstaichi/_logging.py +131 -0
  14. gstaichi/_main.py +545 -0
  15. gstaichi/_snode/__init__.py +5 -0
  16. gstaichi/_snode/fields_builder.py +187 -0
  17. gstaichi/_snode/snode_tree.py +34 -0
  18. gstaichi/_test_tools/__init__.py +0 -0
  19. gstaichi/_test_tools/load_kernel_string.py +30 -0
  20. gstaichi/_version.py +1 -0
  21. gstaichi/_version_check.py +103 -0
  22. gstaichi/ad/__init__.py +3 -0
  23. gstaichi/ad/_ad.py +530 -0
  24. gstaichi/algorithms/__init__.py +3 -0
  25. gstaichi/algorithms/_algorithms.py +117 -0
  26. gstaichi/assets/.git +1 -0
  27. gstaichi/assets/Go-Regular.ttf +0 -0
  28. gstaichi/assets/static/imgs/ti_gallery.png +0 -0
  29. gstaichi/examples/minimal.py +28 -0
  30. gstaichi/experimental.py +16 -0
  31. gstaichi/lang/__init__.py +50 -0
  32. gstaichi/lang/_ndarray.py +352 -0
  33. gstaichi/lang/_ndrange.py +152 -0
  34. gstaichi/lang/_template_mapper.py +199 -0
  35. gstaichi/lang/_texture.py +172 -0
  36. gstaichi/lang/_wrap_inspect.py +189 -0
  37. gstaichi/lang/any_array.py +99 -0
  38. gstaichi/lang/argpack.py +411 -0
  39. gstaichi/lang/ast/__init__.py +5 -0
  40. gstaichi/lang/ast/ast_transformer.py +1318 -0
  41. gstaichi/lang/ast/ast_transformer_utils.py +341 -0
  42. gstaichi/lang/ast/ast_transformers/__init__.py +0 -0
  43. gstaichi/lang/ast/ast_transformers/call_transformer.py +267 -0
  44. gstaichi/lang/ast/ast_transformers/function_def_transformer.py +320 -0
  45. gstaichi/lang/ast/checkers.py +106 -0
  46. gstaichi/lang/ast/symbol_resolver.py +57 -0
  47. gstaichi/lang/ast/transform.py +9 -0
  48. gstaichi/lang/common_ops.py +310 -0
  49. gstaichi/lang/exception.py +80 -0
  50. gstaichi/lang/expr.py +180 -0
  51. gstaichi/lang/field.py +466 -0
  52. gstaichi/lang/impl.py +1241 -0
  53. gstaichi/lang/kernel_arguments.py +157 -0
  54. gstaichi/lang/kernel_impl.py +1382 -0
  55. gstaichi/lang/matrix.py +1881 -0
  56. gstaichi/lang/matrix_ops.py +341 -0
  57. gstaichi/lang/matrix_ops_utils.py +190 -0
  58. gstaichi/lang/mesh.py +687 -0
  59. gstaichi/lang/misc.py +778 -0
  60. gstaichi/lang/ops.py +1494 -0
  61. gstaichi/lang/runtime_ops.py +13 -0
  62. gstaichi/lang/shell.py +35 -0
  63. gstaichi/lang/simt/__init__.py +5 -0
  64. gstaichi/lang/simt/block.py +94 -0
  65. gstaichi/lang/simt/grid.py +7 -0
  66. gstaichi/lang/simt/subgroup.py +191 -0
  67. gstaichi/lang/simt/warp.py +96 -0
  68. gstaichi/lang/snode.py +489 -0
  69. gstaichi/lang/source_builder.py +150 -0
  70. gstaichi/lang/struct.py +855 -0
  71. gstaichi/lang/util.py +381 -0
  72. gstaichi/linalg/__init__.py +8 -0
  73. gstaichi/linalg/matrixfree_cg.py +310 -0
  74. gstaichi/linalg/sparse_cg.py +59 -0
  75. gstaichi/linalg/sparse_matrix.py +303 -0
  76. gstaichi/linalg/sparse_solver.py +123 -0
  77. gstaichi/math/__init__.py +11 -0
  78. gstaichi/math/_complex.py +205 -0
  79. gstaichi/math/mathimpl.py +886 -0
  80. gstaichi/profiler/__init__.py +6 -0
  81. gstaichi/profiler/kernel_metrics.py +260 -0
  82. gstaichi/profiler/kernel_profiler.py +586 -0
  83. gstaichi/profiler/memory_profiler.py +15 -0
  84. gstaichi/profiler/scoped_profiler.py +36 -0
  85. gstaichi/sparse/__init__.py +3 -0
  86. gstaichi/sparse/_sparse_grid.py +77 -0
  87. gstaichi/tools/__init__.py +12 -0
  88. gstaichi/tools/diagnose.py +117 -0
  89. gstaichi/tools/np2ply.py +364 -0
  90. gstaichi/tools/vtk.py +38 -0
  91. gstaichi/types/__init__.py +19 -0
  92. gstaichi/types/annotations.py +47 -0
  93. gstaichi/types/compound_types.py +90 -0
  94. gstaichi/types/enums.py +49 -0
  95. gstaichi/types/ndarray_type.py +147 -0
  96. gstaichi/types/primitive_types.py +206 -0
  97. gstaichi/types/quant.py +88 -0
  98. gstaichi/types/texture_type.py +85 -0
  99. gstaichi/types/utils.py +13 -0
  100. gstaichi-0.1.25.dev0.data/data/include/GLFW/glfw3.h +6389 -0
  101. gstaichi-0.1.25.dev0.data/data/include/GLFW/glfw3native.h +594 -0
  102. gstaichi-0.1.25.dev0.data/data/include/spirv-tools/instrument.hpp +268 -0
  103. gstaichi-0.1.25.dev0.data/data/include/spirv-tools/libspirv.h +907 -0
  104. gstaichi-0.1.25.dev0.data/data/include/spirv-tools/libspirv.hpp +375 -0
  105. gstaichi-0.1.25.dev0.data/data/include/spirv-tools/linker.hpp +97 -0
  106. gstaichi-0.1.25.dev0.data/data/include/spirv-tools/optimizer.hpp +970 -0
  107. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/GLSL.std.450.h +114 -0
  108. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv.h +2568 -0
  109. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv.hpp +2579 -0
  110. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_cfg.hpp +168 -0
  111. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_common.hpp +1920 -0
  112. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_cpp.hpp +93 -0
  113. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_cross.hpp +1171 -0
  114. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_cross_c.h +1074 -0
  115. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_cross_containers.hpp +754 -0
  116. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_cross_error_handling.hpp +94 -0
  117. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_cross_parsed_ir.hpp +256 -0
  118. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_cross_util.hpp +37 -0
  119. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_glsl.hpp +1001 -0
  120. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_hlsl.hpp +406 -0
  121. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_msl.hpp +1273 -0
  122. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_parser.hpp +103 -0
  123. gstaichi-0.1.25.dev0.data/data/include/spirv_cross/spirv_reflect.hpp +91 -0
  124. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsConfig.cmake +5 -0
  125. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsTarget-release.cmake +29 -0
  126. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake +114 -0
  127. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffConfig.cmake +5 -0
  128. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffTargets-release.cmake +19 -0
  129. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffTargets.cmake +123 -0
  130. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkConfig.cmake +5 -0
  131. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkTargets-release.cmake +19 -0
  132. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkTargets.cmake +123 -0
  133. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintConfig.cmake +5 -0
  134. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintTargets-release.cmake +19 -0
  135. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintTargets.cmake +123 -0
  136. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optConfig.cmake +5 -0
  137. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optTargets-release.cmake +19 -0
  138. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optTargets.cmake +123 -0
  139. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceConfig.cmake +5 -0
  140. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceTarget-release.cmake +19 -0
  141. gstaichi-0.1.25.dev0.data/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceTarget.cmake +123 -0
  142. gstaichi-0.1.25.dev0.data/data/lib/cmake/glfw3/glfw3Config.cmake +3 -0
  143. gstaichi-0.1.25.dev0.data/data/lib/cmake/glfw3/glfw3ConfigVersion.cmake +65 -0
  144. gstaichi-0.1.25.dev0.data/data/lib/cmake/glfw3/glfw3Targets-release.cmake +19 -0
  145. gstaichi-0.1.25.dev0.data/data/lib/cmake/glfw3/glfw3Targets.cmake +107 -0
  146. gstaichi-0.1.25.dev0.data/data/lib/libSPIRV-Tools-shared.dylib +0 -0
  147. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_c/cmake/spirv_cross_cConfig-release.cmake +19 -0
  148. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_c/cmake/spirv_cross_cConfig.cmake +123 -0
  149. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_core/cmake/spirv_cross_coreConfig-release.cmake +19 -0
  150. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_core/cmake/spirv_cross_coreConfig.cmake +106 -0
  151. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_cpp/cmake/spirv_cross_cppConfig-release.cmake +19 -0
  152. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_cpp/cmake/spirv_cross_cppConfig.cmake +123 -0
  153. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_glsl/cmake/spirv_cross_glslConfig-release.cmake +19 -0
  154. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_glsl/cmake/spirv_cross_glslConfig.cmake +123 -0
  155. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_hlsl/cmake/spirv_cross_hlslConfig-release.cmake +19 -0
  156. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_hlsl/cmake/spirv_cross_hlslConfig.cmake +123 -0
  157. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_msl/cmake/spirv_cross_mslConfig-release.cmake +19 -0
  158. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_msl/cmake/spirv_cross_mslConfig.cmake +123 -0
  159. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_reflect/cmake/spirv_cross_reflectConfig-release.cmake +19 -0
  160. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_reflect/cmake/spirv_cross_reflectConfig.cmake +106 -0
  161. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_util/cmake/spirv_cross_utilConfig-release.cmake +19 -0
  162. gstaichi-0.1.25.dev0.data/data/share/spirv_cross_util/cmake/spirv_cross_utilConfig.cmake +123 -0
  163. gstaichi-0.1.25.dev0.dist-info/METADATA +105 -0
  164. gstaichi-0.1.25.dev0.dist-info/RECORD +168 -0
  165. gstaichi-0.1.25.dev0.dist-info/WHEEL +5 -0
  166. gstaichi-0.1.25.dev0.dist-info/entry_points.txt +2 -0
  167. gstaichi-0.1.25.dev0.dist-info/licenses/LICENSE +201 -0
  168. gstaichi-0.1.25.dev0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,268 @@
1
+ // Copyright (c) 2018 The Khronos Group Inc.
2
+ // Copyright (c) 2018 Valve Corporation
3
+ // Copyright (c) 2018 LunarG Inc.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 (the "License");
6
+ // you may not use this file except in compliance with the License.
7
+ // You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing, software
12
+ // distributed under the License is distributed on an "AS IS" BASIS,
13
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ // See the License for the specific language governing permissions and
15
+ // limitations under the License.
16
+
17
+ #ifndef INCLUDE_SPIRV_TOOLS_INSTRUMENT_HPP_
18
+ #define INCLUDE_SPIRV_TOOLS_INSTRUMENT_HPP_
19
+
20
+ // Shader Instrumentation Interface
21
+ //
22
+ // This file provides an external interface for applications that wish to
23
+ // communicate with shaders instrumented by passes created by:
24
+ //
25
+ // CreateInstBindlessCheckPass
26
+ // CreateInstBuffAddrCheckPass
27
+ // CreateInstDebugPrintfPass
28
+ //
29
+ // More detailed documentation of these routines can be found in optimizer.hpp
30
+
31
+ namespace spvtools {
32
+
33
+ // Stream Output Buffer Offsets
34
+ //
35
+ // The following values provide offsets into the output buffer struct
36
+ // generated by InstrumentPass::GenDebugStreamWrite. This method is utilized
37
+ // by InstBindlessCheckPass, InstBuffAddrCheckPass, and InstDebugPrintfPass.
38
+ //
39
+ // The 1st member of the debug output buffer contains a set of flags
40
+ // controlling the behavior of instrumentation code.
41
+ static const int kDebugOutputFlagsOffset = 0;
42
+
43
+ // Values stored at kDebugOutputFlagsOffset
44
+ enum kInstFlags : unsigned int {
45
+ kInstBufferOOBEnable = 0x1,
46
+ };
47
+
48
+ // The 2nd member of the debug output buffer contains the next available word
49
+ // in the data stream to be written. Shaders will atomically read and update
50
+ // this value so as not to overwrite each others records. This value must be
51
+ // initialized to zero
52
+ static const int kDebugOutputSizeOffset = 1;
53
+
54
+ // The 3rd member of the output buffer is the start of the stream of records
55
+ // written by the instrumented shaders. Each record represents a validation
56
+ // error. The format of the records is documented below.
57
+ static const int kDebugOutputDataOffset = 2;
58
+
59
+ // Common Stream Record Offsets
60
+ //
61
+ // The following are offsets to fields which are common to all records written
62
+ // to the output stream.
63
+ //
64
+ // Each record first contains the size of the record in 32-bit words, including
65
+ // the size word.
66
+ static const int kInstCommonOutSize = 0;
67
+
68
+ // This is the shader id passed by the layer when the instrumentation pass is
69
+ // created.
70
+ static const int kInstCommonOutShaderId = 1;
71
+
72
+ // This is the ordinal position of the instruction within the SPIR-V shader
73
+ // which generated the validation error.
74
+ static const int kInstCommonOutInstructionIdx = 2;
75
+
76
+ // This is the stage which generated the validation error. This word is used
77
+ // to determine the contents of the next two words in the record.
78
+ // 0:Vert, 1:TessCtrl, 2:TessEval, 3:Geom, 4:Frag, 5:Compute
79
+ static const int kInstCommonOutStageIdx = 3;
80
+ static const int kInstCommonOutCnt = 4;
81
+
82
+ // Stage-specific Stream Record Offsets
83
+ //
84
+ // Each stage will contain different values in the next set of words of the
85
+ // record used to identify which instantiation of the shader generated the
86
+ // validation error.
87
+ //
88
+ // Vertex Shader Output Record Offsets
89
+ static const int kInstVertOutVertexIndex = kInstCommonOutCnt;
90
+ static const int kInstVertOutInstanceIndex = kInstCommonOutCnt + 1;
91
+ static const int kInstVertOutUnused = kInstCommonOutCnt + 2;
92
+
93
+ // Frag Shader Output Record Offsets
94
+ static const int kInstFragOutFragCoordX = kInstCommonOutCnt;
95
+ static const int kInstFragOutFragCoordY = kInstCommonOutCnt + 1;
96
+ static const int kInstFragOutUnused = kInstCommonOutCnt + 2;
97
+
98
+ // Compute Shader Output Record Offsets
99
+ static const int kInstCompOutGlobalInvocationIdX = kInstCommonOutCnt;
100
+ static const int kInstCompOutGlobalInvocationIdY = kInstCommonOutCnt + 1;
101
+ static const int kInstCompOutGlobalInvocationIdZ = kInstCommonOutCnt + 2;
102
+
103
+ // Tessellation Control Shader Output Record Offsets
104
+ static const int kInstTessCtlOutInvocationId = kInstCommonOutCnt;
105
+ static const int kInstTessCtlOutPrimitiveId = kInstCommonOutCnt + 1;
106
+ static const int kInstTessCtlOutUnused = kInstCommonOutCnt + 2;
107
+
108
+ // Tessellation Eval Shader Output Record Offsets
109
+ static const int kInstTessEvalOutPrimitiveId = kInstCommonOutCnt;
110
+ static const int kInstTessEvalOutTessCoordU = kInstCommonOutCnt + 1;
111
+ static const int kInstTessEvalOutTessCoordV = kInstCommonOutCnt + 2;
112
+
113
+ // Geometry Shader Output Record Offsets
114
+ static const int kInstGeomOutPrimitiveId = kInstCommonOutCnt;
115
+ static const int kInstGeomOutInvocationId = kInstCommonOutCnt + 1;
116
+ static const int kInstGeomOutUnused = kInstCommonOutCnt + 2;
117
+
118
+ // Ray Tracing Shader Output Record Offsets
119
+ static const int kInstRayTracingOutLaunchIdX = kInstCommonOutCnt;
120
+ static const int kInstRayTracingOutLaunchIdY = kInstCommonOutCnt + 1;
121
+ static const int kInstRayTracingOutLaunchIdZ = kInstCommonOutCnt + 2;
122
+
123
+ // Mesh Shader Output Record Offsets
124
+ static const int kInstMeshOutGlobalInvocationIdX = kInstCommonOutCnt;
125
+ static const int kInstMeshOutGlobalInvocationIdY = kInstCommonOutCnt + 1;
126
+ static const int kInstMeshOutGlobalInvocationIdZ = kInstCommonOutCnt + 2;
127
+
128
+ // Task Shader Output Record Offsets
129
+ static const int kInstTaskOutGlobalInvocationIdX = kInstCommonOutCnt;
130
+ static const int kInstTaskOutGlobalInvocationIdY = kInstCommonOutCnt + 1;
131
+ static const int kInstTaskOutGlobalInvocationIdZ = kInstCommonOutCnt + 2;
132
+
133
+ // Size of Common and Stage-specific Members
134
+ static const int kInstStageOutCnt = kInstCommonOutCnt + 3;
135
+
136
+ // Validation Error Code Offset
137
+ //
138
+ // This identifies the validation error. It also helps to identify
139
+ // how many words follow in the record and their meaning.
140
+ static const int kInstValidationOutError = kInstStageOutCnt;
141
+
142
+ // Validation-specific Output Record Offsets
143
+ //
144
+ // Each different validation will generate a potentially different
145
+ // number of words at the end of the record giving more specifics
146
+ // about the validation error.
147
+ //
148
+ // A bindless bounds error will output the index and the bound.
149
+ static const int kInstBindlessBoundsOutDescIndex = kInstStageOutCnt + 1;
150
+ static const int kInstBindlessBoundsOutDescBound = kInstStageOutCnt + 2;
151
+ static const int kInstBindlessBoundsOutUnused = kInstStageOutCnt + 3;
152
+ static const int kInstBindlessBoundsOutCnt = kInstStageOutCnt + 4;
153
+
154
+ // A descriptor uninitialized error will output the index.
155
+ static const int kInstBindlessUninitOutDescIndex = kInstStageOutCnt + 1;
156
+ static const int kInstBindlessUninitOutUnused = kInstStageOutCnt + 2;
157
+ static const int kInstBindlessUninitOutUnused2 = kInstStageOutCnt + 3;
158
+ static const int kInstBindlessUninitOutCnt = kInstStageOutCnt + 4;
159
+
160
+ // A buffer out-of-bounds error will output the descriptor
161
+ // index, the buffer offset and the buffer size
162
+ static const int kInstBindlessBuffOOBOutDescIndex = kInstStageOutCnt + 1;
163
+ static const int kInstBindlessBuffOOBOutBuffOff = kInstStageOutCnt + 2;
164
+ static const int kInstBindlessBuffOOBOutBuffSize = kInstStageOutCnt + 3;
165
+ static const int kInstBindlessBuffOOBOutCnt = kInstStageOutCnt + 4;
166
+
167
+ // A buffer address unalloc error will output the 64-bit pointer in
168
+ // two 32-bit pieces, lower bits first.
169
+ static const int kInstBuffAddrUnallocOutDescPtrLo = kInstStageOutCnt + 1;
170
+ static const int kInstBuffAddrUnallocOutDescPtrHi = kInstStageOutCnt + 2;
171
+ static const int kInstBuffAddrUnallocOutCnt = kInstStageOutCnt + 3;
172
+
173
+ // Maximum Output Record Member Count
174
+ static const int kInstMaxOutCnt = kInstStageOutCnt + 4;
175
+
176
+ // Validation Error Codes
177
+ //
178
+ // These are the possible validation error codes.
179
+ static const int kInstErrorBindlessBounds = 0;
180
+ static const int kInstErrorBindlessUninit = 1;
181
+ static const int kInstErrorBuffAddrUnallocRef = 2;
182
+ // Deleted: static const int kInstErrorBindlessBuffOOB = 3;
183
+ // This comment will will remain for 2 releases to allow
184
+ // for the transition of all builds. Buffer OOB is
185
+ // generating the following four differentiated codes instead:
186
+ static const int kInstErrorBuffOOBUniform = 4;
187
+ static const int kInstErrorBuffOOBStorage = 5;
188
+ static const int kInstErrorBuffOOBUniformTexel = 6;
189
+ static const int kInstErrorBuffOOBStorageTexel = 7;
190
+ static const int kInstErrorMax = kInstErrorBuffOOBStorageTexel;
191
+
192
+ // Direct Input Buffer Offsets
193
+ //
194
+ // The following values provide member offsets into the input buffers
195
+ // consumed by InstrumentPass::GenDebugDirectRead(). This method is utilized
196
+ // by InstBindlessCheckPass.
197
+ //
198
+ // The only object in an input buffer is a runtime array of unsigned
199
+ // integers. Each validation will have its own formatting of this array.
200
+ static const int kDebugInputDataOffset = 0;
201
+
202
+ // Debug Buffer Bindings
203
+ //
204
+ // These are the bindings for the different buffers which are
205
+ // read or written by the instrumentation passes.
206
+ //
207
+ // This is the output buffer written by InstBindlessCheckPass,
208
+ // InstBuffAddrCheckPass, and possibly other future validations.
209
+ static const int kDebugOutputBindingStream = 0;
210
+
211
+ // The binding for the input buffer read by InstBindlessCheckPass.
212
+ static const int kDebugInputBindingBindless = 1;
213
+
214
+ // The binding for the input buffer read by InstBuffAddrCheckPass.
215
+ static const int kDebugInputBindingBuffAddr = 2;
216
+
217
+ // This is the output buffer written by InstDebugPrintfPass.
218
+ static const int kDebugOutputPrintfStream = 3;
219
+
220
+ // Bindless Validation Input Buffer Format
221
+ //
222
+ // An input buffer for bindless validation consists of a single array of
223
+ // unsigned integers we will call Data[]. This array is formatted as follows.
224
+ //
225
+ // At offset kDebugInputBindlessInitOffset in Data[] is a single uint which
226
+ // gives an offset to the start of the bindless initialization data. More
227
+ // specifically, if the following value is zero, we know that the descriptor at
228
+ // (set = s, binding = b, index = i) is not initialized; if the value is
229
+ // non-zero, and the descriptor points to a buffer, the value is the length of
230
+ // the buffer in bytes and can be used to check for out-of-bounds buffer
231
+ // references:
232
+ // Data[ i + Data[ b + Data[ s + Data[ kDebugInputBindlessInitOffset ] ] ] ]
233
+ static const int kDebugInputBindlessInitOffset = 0;
234
+
235
+ // At offset kDebugInputBindlessOffsetLengths is some number of uints which
236
+ // provide the bindless length data. More specifically, the number of
237
+ // descriptors at (set=s, binding=b) is:
238
+ // Data[ Data[ s + kDebugInputBindlessOffsetLengths ] + b ]
239
+ static const int kDebugInputBindlessOffsetLengths = 1;
240
+
241
+ // Buffer Device Address Input Buffer Format
242
+ //
243
+ // An input buffer for buffer device address validation consists of a single
244
+ // array of unsigned 64-bit integers we will call Data[]. This array is
245
+ // formatted as follows:
246
+ //
247
+ // At offset kDebugInputBuffAddrPtrOffset is a list of sorted valid buffer
248
+ // addresses. The list is terminated with the address 0xffffffffffffffff.
249
+ // If 0x0 is not a valid buffer address, this address is inserted at the
250
+ // start of the list.
251
+ //
252
+ static const int kDebugInputBuffAddrPtrOffset = 1;
253
+ //
254
+ // At offset kDebugInputBuffAddrLengthOffset in Data[] is a single uint64 which
255
+ // gives an offset to the start of the buffer length data. More
256
+ // specifically, for a buffer whose pointer is located at input buffer offset
257
+ // i, the length is located at:
258
+ //
259
+ // Data[ i - kDebugInputBuffAddrPtrOffset
260
+ // + Data[ kDebugInputBuffAddrLengthOffset ] ]
261
+ //
262
+ // The length associated with the 0xffffffffffffffff address is zero. If
263
+ // not a valid buffer, the length associated with the 0x0 address is zero.
264
+ static const int kDebugInputBuffAddrLengthOffset = 0;
265
+
266
+ } // namespace spvtools
267
+
268
+ #endif // INCLUDE_SPIRV_TOOLS_INSTRUMENT_HPP_