Skip to content

Commit 8b246ff

Browse files
Add SPV_NV_raw_access_chains (KhronosGroup#417)
Co-authored-by: Hans-Kristian Arntzen <[email protected]>
1 parent b73e168 commit 8b246ff

File tree

12 files changed

+187
-0
lines changed

12 files changed

+187
-0
lines changed

include/spirv/unified1/spirv.bf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,7 @@ namespace Spv
11601160
RayQueryPositionFetchKHR = 5391,
11611161
AtomicFloat16VectorNV = 5404,
11621162
RayTracingDisplacementMicromapNV = 5409,
1163+
RawAccessChainsNV = 5414,
11631164
SubgroupShuffleINTEL = 5568,
11641165
SubgroupBufferBlockIOINTEL = 5569,
11651166
SubgroupImageBlockIOINTEL = 5570,
@@ -1409,6 +1410,19 @@ namespace Spv
14091410
AutoINTEL = 0,
14101411
}
14111412

1413+
[AllowDuplicates, CRepr] public enum RawAccessChainOperandsShift
1414+
{
1415+
RobustnessPerComponentNV = 0,
1416+
RobustnessPerElementNV = 1,
1417+
}
1418+
1419+
[AllowDuplicates, CRepr] public enum RawAccessChainOperandsMask
1420+
{
1421+
MaskNone = 0,
1422+
RobustnessPerComponentNV = 0x00000001,
1423+
RobustnessPerElementNV = 0x00000002,
1424+
}
1425+
14121426
[AllowDuplicates, CRepr] public enum Op
14131427
{
14141428
OpNop = 0,
@@ -1887,6 +1901,7 @@ namespace Spv
18871901
OpConvertUToSampledImageNV = 5395,
18881902
OpConvertSampledImageToUNV = 5396,
18891903
OpSamplerImageAddressingModeNV = 5397,
1904+
OpRawAccessChainNV = 5398,
18901905
OpSubgroupShuffleINTEL = 5571,
18911906
OpSubgroupShuffleDownINTEL = 5572,
18921907
OpSubgroupShuffleUpINTEL = 5573,

include/spirv/unified1/spirv.core.grammar.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6251,6 +6251,24 @@
62516251
"capabilities" : [ "BindlessTextureNV" ],
62526252
"version" : "None"
62536253
},
6254+
{
6255+
"opname" : "OpRawAccessChainNV",
6256+
"class" : "Memory",
6257+
"opcode" : 5398,
6258+
"operands" : [
6259+
{ "kind" : "IdResultType" },
6260+
{ "kind" : "IdResult" },
6261+
{ "kind" : "IdRef", "name" : "'Base'" },
6262+
{ "kind" : "IdRef", "name" : "'Byte stride'" },
6263+
{ "kind" : "IdRef", "name" : "'Element index'" },
6264+
{ "kind" : "IdRef", "name" : "'Byte offset'" },
6265+
{ "kind" : "RawAccessChainOperands", "quantifier" : "?" }
6266+
],
6267+
"capabilities" : [
6268+
"RawAccessChainsNV"
6269+
],
6270+
"version" : "None"
6271+
},
62546272
{
62556273
"opname" : "OpSubgroupShuffleINTEL",
62566274
"class" : "Group",
@@ -10667,6 +10685,28 @@
1066710685
}
1066810686
]
1066910687
},
10688+
{
10689+
"category" : "BitEnum",
10690+
"kind" : "RawAccessChainOperands",
10691+
"enumerants" : [
10692+
{
10693+
"enumerant" : "None",
10694+
"value" : "0x0000"
10695+
},
10696+
{
10697+
"enumerant" : "RobustnessPerComponentNV",
10698+
"value" : "0x0001",
10699+
"capabilities" : [ "RawAccessChainsNV" ],
10700+
"version" : "None"
10701+
},
10702+
{
10703+
"enumerant" : "RobustnessPerElementNV",
10704+
"value" : "0x0002",
10705+
"capabilities" : [ "RawAccessChainsNV" ],
10706+
"version" : "None"
10707+
}
10708+
]
10709+
},
1067010710
{
1067110711
"category" : "ValueEnum",
1067210712
"kind" : "SourceLanguage",
@@ -16083,6 +16123,12 @@
1608316123
"extensions" : [ "SPV_NV_displacement_micromap" ],
1608416124
"version" : "None"
1608516125
},
16126+
{
16127+
"enumerant" : "RawAccessChainsNV",
16128+
"value" : 5414,
16129+
"extensions" : [ "SPV_NV_raw_access_chains" ],
16130+
"version" : "None"
16131+
},
1608616132
{
1608716133
"enumerant" : "SubgroupShuffleINTEL",
1608816134
"value" : 5568,

include/spirv/unified1/spirv.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,7 @@ public enum Capability
11591159
RayQueryPositionFetchKHR = 5391,
11601160
AtomicFloat16VectorNV = 5404,
11611161
RayTracingDisplacementMicromapNV = 5409,
1162+
RawAccessChainsNV = 5414,
11621163
SubgroupShuffleINTEL = 5568,
11631164
SubgroupBufferBlockIOINTEL = 5569,
11641165
SubgroupImageBlockIOINTEL = 5570,
@@ -1408,6 +1409,19 @@ public enum NamedMaximumNumberOfRegisters
14081409
AutoINTEL = 0,
14091410
}
14101411

1412+
public enum RawAccessChainOperandsShift
1413+
{
1414+
RobustnessPerComponentNV = 0,
1415+
RobustnessPerElementNV = 1,
1416+
}
1417+
1418+
public enum RawAccessChainOperandsMask
1419+
{
1420+
MaskNone = 0,
1421+
RobustnessPerComponentNV = 0x00000001,
1422+
RobustnessPerElementNV = 0x00000002,
1423+
}
1424+
14111425
public enum Op
14121426
{
14131427
OpNop = 0,
@@ -1886,6 +1900,7 @@ public enum Op
18861900
OpConvertUToSampledImageNV = 5395,
18871901
OpConvertSampledImageToUNV = 5396,
18881902
OpSamplerImageAddressingModeNV = 5397,
1903+
OpRawAccessChainNV = 5398,
18891904
OpSubgroupShuffleINTEL = 5571,
18901905
OpSubgroupShuffleDownINTEL = 5572,
18911906
OpSubgroupShuffleUpINTEL = 5573,

include/spirv/unified1/spirv.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,7 @@ typedef enum SpvCapability_ {
11591159
SpvCapabilityRayQueryPositionFetchKHR = 5391,
11601160
SpvCapabilityAtomicFloat16VectorNV = 5404,
11611161
SpvCapabilityRayTracingDisplacementMicromapNV = 5409,
1162+
SpvCapabilityRawAccessChainsNV = 5414,
11621163
SpvCapabilitySubgroupShuffleINTEL = 5568,
11631164
SpvCapabilitySubgroupBufferBlockIOINTEL = 5569,
11641165
SpvCapabilitySubgroupImageBlockIOINTEL = 5570,
@@ -1406,6 +1407,18 @@ typedef enum SpvNamedMaximumNumberOfRegisters_ {
14061407
SpvNamedMaximumNumberOfRegistersMax = 0x7fffffff,
14071408
} SpvNamedMaximumNumberOfRegisters;
14081409

1410+
typedef enum SpvRawAccessChainOperandsShift_ {
1411+
SpvRawAccessChainOperandsRobustnessPerComponentNVShift = 0,
1412+
SpvRawAccessChainOperandsRobustnessPerElementNVShift = 1,
1413+
SpvRawAccessChainOperandsMax = 0x7fffffff,
1414+
} SpvRawAccessChainOperandsShift;
1415+
1416+
typedef enum SpvRawAccessChainOperandsMask_ {
1417+
SpvRawAccessChainOperandsMaskNone = 0,
1418+
SpvRawAccessChainOperandsRobustnessPerComponentNVMask = 0x00000001,
1419+
SpvRawAccessChainOperandsRobustnessPerElementNVMask = 0x00000002,
1420+
} SpvRawAccessChainOperandsMask;
1421+
14091422
typedef enum SpvOp_ {
14101423
SpvOpNop = 0,
14111424
SpvOpUndef = 1,
@@ -1883,6 +1896,7 @@ typedef enum SpvOp_ {
18831896
SpvOpConvertUToSampledImageNV = 5395,
18841897
SpvOpConvertSampledImageToUNV = 5396,
18851898
SpvOpSamplerImageAddressingModeNV = 5397,
1899+
SpvOpRawAccessChainNV = 5398,
18861900
SpvOpSubgroupShuffleINTEL = 5571,
18871901
SpvOpSubgroupShuffleDownINTEL = 5572,
18881902
SpvOpSubgroupShuffleUpINTEL = 5573,
@@ -2617,6 +2631,7 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
26172631
case SpvOpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
26182632
case SpvOpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
26192633
case SpvOpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
2634+
case SpvOpRawAccessChainNV: *hasResult = true; *hasResultType = true; break;
26202635
case SpvOpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
26212636
case SpvOpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
26222637
case SpvOpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;

include/spirv/unified1/spirv.hpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,7 @@ enum Capability {
11551155
CapabilityRayQueryPositionFetchKHR = 5391,
11561156
CapabilityAtomicFloat16VectorNV = 5404,
11571157
CapabilityRayTracingDisplacementMicromapNV = 5409,
1158+
CapabilityRawAccessChainsNV = 5414,
11581159
CapabilitySubgroupShuffleINTEL = 5568,
11591160
CapabilitySubgroupBufferBlockIOINTEL = 5569,
11601161
CapabilitySubgroupImageBlockIOINTEL = 5570,
@@ -1402,6 +1403,18 @@ enum NamedMaximumNumberOfRegisters {
14021403
NamedMaximumNumberOfRegistersMax = 0x7fffffff,
14031404
};
14041405

1406+
enum RawAccessChainOperandsShift {
1407+
RawAccessChainOperandsRobustnessPerComponentNVShift = 0,
1408+
RawAccessChainOperandsRobustnessPerElementNVShift = 1,
1409+
RawAccessChainOperandsMax = 0x7fffffff,
1410+
};
1411+
1412+
enum RawAccessChainOperandsMask {
1413+
RawAccessChainOperandsMaskNone = 0,
1414+
RawAccessChainOperandsRobustnessPerComponentNVMask = 0x00000001,
1415+
RawAccessChainOperandsRobustnessPerElementNVMask = 0x00000002,
1416+
};
1417+
14051418
enum Op {
14061419
OpNop = 0,
14071420
OpUndef = 1,
@@ -1879,6 +1892,7 @@ enum Op {
18791892
OpConvertUToSampledImageNV = 5395,
18801893
OpConvertSampledImageToUNV = 5396,
18811894
OpSamplerImageAddressingModeNV = 5397,
1895+
OpRawAccessChainNV = 5398,
18821896
OpSubgroupShuffleINTEL = 5571,
18831897
OpSubgroupShuffleDownINTEL = 5572,
18841898
OpSubgroupShuffleUpINTEL = 5573,
@@ -2613,6 +2627,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
26132627
case OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
26142628
case OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
26152629
case OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
2630+
case OpRawAccessChainNV: *hasResult = true; *hasResultType = true; break;
26162631
case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
26172632
case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
26182633
case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2917,6 +2932,10 @@ inline CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a,
29172932
inline CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); }
29182933
inline CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); }
29192934
inline CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); }
2935+
inline RawAccessChainOperandsMask operator|(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) | unsigned(b)); }
2936+
inline RawAccessChainOperandsMask operator&(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) & unsigned(b)); }
2937+
inline RawAccessChainOperandsMask operator^(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) ^ unsigned(b)); }
2938+
inline RawAccessChainOperandsMask operator~(RawAccessChainOperandsMask a) { return RawAccessChainOperandsMask(~unsigned(a)); }
29202939

29212940
} // end namespace spv
29222941

include/spirv/unified1/spirv.hpp11

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,7 @@ enum class Capability : unsigned {
11551155
RayQueryPositionFetchKHR = 5391,
11561156
AtomicFloat16VectorNV = 5404,
11571157
RayTracingDisplacementMicromapNV = 5409,
1158+
RawAccessChainsNV = 5414,
11581159
SubgroupShuffleINTEL = 5568,
11591160
SubgroupBufferBlockIOINTEL = 5569,
11601161
SubgroupImageBlockIOINTEL = 5570,
@@ -1402,6 +1403,18 @@ enum class NamedMaximumNumberOfRegisters : unsigned {
14021403
Max = 0x7fffffff,
14031404
};
14041405

1406+
enum class RawAccessChainOperandsShift : unsigned {
1407+
RobustnessPerComponentNV = 0,
1408+
RobustnessPerElementNV = 1,
1409+
Max = 0x7fffffff,
1410+
};
1411+
1412+
enum class RawAccessChainOperandsMask : unsigned {
1413+
MaskNone = 0,
1414+
RobustnessPerComponentNV = 0x00000001,
1415+
RobustnessPerElementNV = 0x00000002,
1416+
};
1417+
14051418
enum class Op : unsigned {
14061419
OpNop = 0,
14071420
OpUndef = 1,
@@ -1879,6 +1892,7 @@ enum class Op : unsigned {
18791892
OpConvertUToSampledImageNV = 5395,
18801893
OpConvertSampledImageToUNV = 5396,
18811894
OpSamplerImageAddressingModeNV = 5397,
1895+
OpRawAccessChainNV = 5398,
18821896
OpSubgroupShuffleINTEL = 5571,
18831897
OpSubgroupShuffleDownINTEL = 5572,
18841898
OpSubgroupShuffleUpINTEL = 5573,
@@ -2613,6 +2627,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
26132627
case Op::OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
26142628
case Op::OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
26152629
case Op::OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
2630+
case Op::OpRawAccessChainNV: *hasResult = true; *hasResultType = true; break;
26162631
case Op::OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
26172632
case Op::OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
26182633
case Op::OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2917,6 +2932,10 @@ constexpr CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask
29172932
constexpr CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); }
29182933
constexpr CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); }
29192934
constexpr CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); }
2935+
constexpr RawAccessChainOperandsMask operator|(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) | unsigned(b)); }
2936+
constexpr RawAccessChainOperandsMask operator&(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) & unsigned(b)); }
2937+
constexpr RawAccessChainOperandsMask operator^(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) ^ unsigned(b)); }
2938+
constexpr RawAccessChainOperandsMask operator~(RawAccessChainOperandsMask a) { return RawAccessChainOperandsMask(~unsigned(a)); }
29202939

29212940
} // end namespace spv
29222941

include/spirv/unified1/spirv.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,7 @@
11321132
"RayQueryPositionFetchKHR": 5391,
11331133
"AtomicFloat16VectorNV": 5404,
11341134
"RayTracingDisplacementMicromapNV": 5409,
1135+
"RawAccessChainsNV": 5414,
11351136
"SubgroupShuffleINTEL": 5568,
11361137
"SubgroupBufferBlockIOINTEL": 5569,
11371138
"SubgroupImageBlockIOINTEL": 5570,
@@ -1400,6 +1401,15 @@
14001401
"AutoINTEL": 0
14011402
}
14021403
},
1404+
{
1405+
"Name": "RawAccessChainOperands",
1406+
"Type": "Bit",
1407+
"Values":
1408+
{
1409+
"RobustnessPerComponentNV": 0,
1410+
"RobustnessPerElementNV": 1
1411+
}
1412+
},
14031413
{
14041414
"Name": "Op",
14051415
"Type": "Value",
@@ -1881,6 +1891,7 @@
18811891
"OpConvertUToSampledImageNV": 5395,
18821892
"OpConvertSampledImageToUNV": 5396,
18831893
"OpSamplerImageAddressingModeNV": 5397,
1894+
"OpRawAccessChainNV": 5398,
18841895
"OpSubgroupShuffleINTEL": 5571,
18851896
"OpSubgroupShuffleDownINTEL": 5572,
18861897
"OpSubgroupShuffleUpINTEL": 5573,

include/spirv/unified1/spirv.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,7 @@ spv = {
11171117
RayQueryPositionFetchKHR = 5391,
11181118
AtomicFloat16VectorNV = 5404,
11191119
RayTracingDisplacementMicromapNV = 5409,
1120+
RawAccessChainsNV = 5414,
11201121
SubgroupShuffleINTEL = 5568,
11211122
SubgroupBufferBlockIOINTEL = 5569,
11221123
SubgroupImageBlockIOINTEL = 5570,
@@ -1345,6 +1346,17 @@ spv = {
13451346
AutoINTEL = 0,
13461347
},
13471348

1349+
RawAccessChainOperandsShift = {
1350+
RobustnessPerComponentNV = 0,
1351+
RobustnessPerElementNV = 1,
1352+
},
1353+
1354+
RawAccessChainOperandsMask = {
1355+
MaskNone = 0,
1356+
RobustnessPerComponentNV = 0x00000001,
1357+
RobustnessPerElementNV = 0x00000002,
1358+
},
1359+
13481360
Op = {
13491361
OpNop = 0,
13501362
OpUndef = 1,
@@ -1822,6 +1834,7 @@ spv = {
18221834
OpConvertUToSampledImageNV = 5395,
18231835
OpConvertSampledImageToUNV = 5396,
18241836
OpSamplerImageAddressingModeNV = 5397,
1837+
OpRawAccessChainNV = 5398,
18251838
OpSubgroupShuffleINTEL = 5571,
18261839
OpSubgroupShuffleDownINTEL = 5572,
18271840
OpSubgroupShuffleUpINTEL = 5573,

include/spirv/unified1/spirv.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,7 @@
11171117
'RayQueryPositionFetchKHR' : 5391,
11181118
'AtomicFloat16VectorNV' : 5404,
11191119
'RayTracingDisplacementMicromapNV' : 5409,
1120+
'RawAccessChainsNV' : 5414,
11201121
'SubgroupShuffleINTEL' : 5568,
11211122
'SubgroupBufferBlockIOINTEL' : 5569,
11221123
'SubgroupImageBlockIOINTEL' : 5570,
@@ -1345,6 +1346,17 @@
13451346
'AutoINTEL' : 0,
13461347
},
13471348

1349+
'RawAccessChainOperandsShift' : {
1350+
'RobustnessPerComponentNV' : 0,
1351+
'RobustnessPerElementNV' : 1,
1352+
},
1353+
1354+
'RawAccessChainOperandsMask' : {
1355+
'MaskNone' : 0,
1356+
'RobustnessPerComponentNV' : 0x00000001,
1357+
'RobustnessPerElementNV' : 0x00000002,
1358+
},
1359+
13481360
'Op' : {
13491361
'OpNop' : 0,
13501362
'OpUndef' : 1,
@@ -1822,6 +1834,7 @@
18221834
'OpConvertUToSampledImageNV' : 5395,
18231835
'OpConvertSampledImageToUNV' : 5396,
18241836
'OpSamplerImageAddressingModeNV' : 5397,
1837+
'OpRawAccessChainNV' : 5398,
18251838
'OpSubgroupShuffleINTEL' : 5571,
18261839
'OpSubgroupShuffleDownINTEL' : 5572,
18271840
'OpSubgroupShuffleUpINTEL' : 5573,

0 commit comments

Comments
 (0)