|
| 1 | +SPIR-V Non-Semantic Graph DebugInfo Instructions |
| 2 | +================================================ |
| 3 | + |
| 4 | +Version 1 |
| 5 | + |
| 6 | +Contact |
| 7 | +------- |
| 8 | + |
| 9 | +To report problems with this extended instruction set, please open a new issue at: |
| 10 | + |
| 11 | +https://github.com/KhronosGroup/SPIRV-Headers |
| 12 | + |
| 13 | +Contributors |
| 14 | +------------ |
| 15 | + |
| 16 | +- Kévin Petit, Arm Ltd. |
| 17 | +- Jan-Harald Fredriksen, Arm Ltd. |
| 18 | +- Derek Lamberti, Arm Ltd. |
| 19 | +- Davide Grohmann, Arm Ltd. |
| 20 | +
|
| 21 | +Notice |
| 22 | +------ |
| 23 | + |
| 24 | +Copyright (c) 2022-2026 Arm Ltd. |
| 25 | + |
| 26 | +Status |
| 27 | +------ |
| 28 | + |
| 29 | +Draft. |
| 30 | + |
| 31 | +Version |
| 32 | +------- |
| 33 | + |
| 34 | +[width="40%",cols="25,25"] |
| 35 | +|======================================== |
| 36 | +| Last Modified Date | 2026-05-15 |
| 37 | +| Revision | 1 |
| 38 | +|======================================== |
| 39 | + |
| 40 | +Dependencies |
| 41 | +------------ |
| 42 | + |
| 43 | +This instruction set requires SPIR-V 1.0. |
| 44 | + |
| 45 | +This instruction set requires SPV_KHR_non_semantic_info. |
| 46 | + |
| 47 | +This instruction set requires SPV_ARM_graph. |
| 48 | + |
| 49 | +1. Introduction |
| 50 | +--------------- |
| 51 | +
|
| 52 | +This document specifies the `NonSemantic.Graph.DebugInfo` extended instruction |
| 53 | +set. This instruction set can be used to record information about the |
| 54 | +higher-level graph representation a SPIR-V graph was produced from. |
| 55 | + |
| 56 | +Import this extended instruction set using an *OpExtInstImport* |
| 57 | +`NonSemantic.Graph.DebugInfo.<ver>` instruction, where `<ver>` indicates the |
| 58 | +version. |
| 59 | + |
| 60 | +2. Version |
| 61 | +---------- |
| 62 | +
|
| 63 | +This extended instruction set is versioned. The version is specified via the |
| 64 | +import string. It must be an integer between 1 and the version specified at the |
| 65 | +beginning of this instruction set. Differences between the version are |
| 66 | +specified below. |
| 67 | + |
| 68 | +3. Binary Form |
| 69 | +--------------- |
| 70 | +
|
| 71 | +The return type for all instructions must be *OpTypeVoid*. |
| 72 | + |
| 73 | +None of the instructions support forward references in their operands. |
| 74 | + |
| 75 | +Instructions |
| 76 | +------------ |
| 77 | + |
| 78 | +[cols="2*1,3*2,1,2*2"] |
| 79 | +|===== |
| 80 | +8+|[[DebugGraph]]*DebugGraph* + |
| 81 | + + |
| 82 | +Describe a graph. + |
| 83 | + + |
| 84 | +'Graph' must be an *OpGraphARM*. + |
| 85 | + + |
| 86 | +'Name' must be an *OpString* specifying the name of the graph as it appears in the source format. + |
| 87 | + + |
| 88 | +1+| 7 | 12 | '<id>' + |
| 89 | +'Result Type' | 'Result' + |
| 90 | +'<id>' | '<id>' + |
| 91 | +'Set' | 1 | '<id>' + |
| 92 | +'Graph' | |
| 93 | +'<id>' + |
| 94 | +'Name' |
| 95 | +|===== |
| 96 | + |
| 97 | +[cols="2*1,3*2,1,3*2"] |
| 98 | +|===== |
| 99 | +9+|[[DebugOperation]]*DebugOperation* + |
| 100 | + + |
| 101 | +Describe an operation. + |
| 102 | + + |
| 103 | +'DebugGraph' must be an the 'Result Id' of a *DebugGraph* instruction specifying the |
| 104 | +graph the operation is a part of. + |
| 105 | + + |
| 106 | +'Name' must be an *OpString* specifying the name of the operation. + |
| 107 | + + |
| 108 | +'Instructions' must be the 'Result Id' of instructions within the graph described by 'DebugGraph'. + |
| 109 | + + |
| 110 | +1+| 8+ | 12 | '<id>' + |
| 111 | +'Result Type' | 'Result' + |
| 112 | +'<id>' | '<id>' + |
| 113 | +'Set' | 2 | '<id>' + |
| 114 | +'DebugGraph' | '<id'> + |
| 115 | +'Name' | |
| 116 | +'<id>, <id>, ...' + |
| 117 | +'Instructions' |
| 118 | +|===== |
| 119 | + |
| 120 | +[cols="2*1,3*2,1,3*2"] |
| 121 | +|===== |
| 122 | +9+|[[DebugTensor]]*DebugTensor* + |
| 123 | + + |
| 124 | +Describe a tensor. + |
| 125 | + + |
| 126 | +'Tensor' must be an _<id>_ of a value whose type is *OpTypeTensorARM* or a |
| 127 | +composite type whose top-level constituents all are of *OpTypeTensorARM* type. |
| 128 | +If 'Tensor' is a composite, then 'Index' must be present. + |
| 129 | + + |
| 130 | +'Name' must be an *OpString* specifying the name of the tensor. + |
| 131 | + + |
| 132 | +'Index' must be a 32-bit unsigned integer and must come from a constant |
| 133 | +instruction. When 'Index' is present, 'Tensor' must be a value of composite |
| 134 | +type and 'Index' specifies the individual constituent being described. + |
| 135 | + + |
| 136 | +1+| 7+ | 12 | '<id>' + |
| 137 | +'Result Type' | 'Result' + |
| 138 | +'<id>' | '<id>' + |
| 139 | +'Set' | 3 | '<id>' + |
| 140 | +'Tensor' | '<id'> + |
| 141 | +'Name' | |
| 142 | +'Optional <id>' + |
| 143 | +'Index' |
| 144 | +|===== |
| 145 | + |
| 146 | +Issues |
| 147 | +------ |
| 148 | + |
| 149 | +1) Why is this a separate instruction set and not included in |
| 150 | +`NonSemantic.Shader.DebugInfo`? + |
| 151 | + + |
| 152 | +*RESOLVED*: Graphs are still a fairly new construct and currently defined by |
| 153 | +a vendor extension. A separate instruction set allows for greater freedom |
| 154 | +of exploration and makes it easier to deprecate and/or remove functionality |
| 155 | +in the future with a lower impact on the users of `NonSemantic.Shader.DebugInfo`. |
| 156 | + + |
| 157 | + |
| 158 | +Revision History |
| 159 | +---------------- |
| 160 | + |
| 161 | +[cols="5,15,15,70"] |
| 162 | +[grid="rows"] |
| 163 | +[options="header"] |
| 164 | +|======================================== |
| 165 | +|Rev|Date|Author|Changes |
| 166 | +|1|2026-05-15|Kevin Petit|Initial revision |
| 167 | +|======================================== |
| 168 | + |
0 commit comments