Skip to content

Commit c16439f

Browse files
authored
Update ClspvReflection non-semantic instruction set (KhronosGroup#308)
Add support for: * Printf builtin * Device address push constants for module-scope constants and program-scope variables * NumArguments, Flags, and Attributes for the Kernel instruction
1 parent 34d0464 commit c16439f

File tree

2 files changed

+79
-3
lines changed

2 files changed

+79
-3
lines changed

include/spirv/unified1/NonSemanticClspvReflection.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extern "C" {
3333
#endif
3434

3535
enum {
36-
NonSemanticClspvReflectionRevision = 4,
36+
NonSemanticClspvReflectionRevision = 5,
3737
NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff
3838
};
3939

@@ -73,10 +73,22 @@ enum NonSemanticClspvReflectionInstructions {
7373
NonSemanticClspvReflectionImageArgumentInfoChannelDataTypeUniform = 33,
7474
NonSemanticClspvReflectionArgumentStorageTexelBuffer = 34,
7575
NonSemanticClspvReflectionArgumentUniformTexelBuffer = 35,
76+
NonSemanticClspvReflectionConstantDataPointerPushConstant = 36,
77+
NonSemanticClspvReflectionProgramScopeVariablePointerPushConstant = 37,
78+
NonSemanticClspvReflectionPrintfInfo = 38,
79+
NonSemanticClspvReflectionPrintfBufferStorageBuffer = 39,
80+
NonSemanticClspvReflectionPrintfBufferPointerPushConstant = 40,
7681
NonSemanticClspvReflectionInstructionsMax = 0x7fffffff
7782
};
7883

7984

85+
enum NonSemanticClspvReflectionKernelPropertyFlags {
86+
NonSemanticClspvReflectionNone = 0x0,
87+
NonSemanticClspvReflectionMayUsePrintf = 0x1,
88+
NonSemanticClspvReflectionKernelPropertyFlagsMax = 0x7fffffff
89+
};
90+
91+
8092
#ifdef __cplusplus
8193
}
8294
#endif

include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
2-
"revision" : 4,
2+
"revision" : 5,
33
"instructions" : [
44
{
55
"opname" : "Kernel",
66
"opcode" : 1,
77
"operands" : [
88
{ "kind" : "IdRef", "name" : "Kernel" },
9-
{ "kind" : "IdRef", "name" : "Name" }
9+
{ "kind" : "IdRef", "name" : "Name" },
10+
{ "kind" : "IdRef", "name" : "NumArguments"},
11+
{ "kind" : "IdRef", "name" : "Flags" },
12+
{ "kind" : "IdRef", "name" : "Attributes" }
1013
]
1114
},
1215
{
@@ -347,6 +350,67 @@
347350
{ "kind" : "IdRef", "name" : "Binding" },
348351
{ "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
349352
]
353+
},
354+
{
355+
"opname" : "ConstantDataPointerPushConstant",
356+
"opcode" : 36,
357+
"operands" : [
358+
{ "kind" : "IdRef", "name" : "Offset"},
359+
{ "kind" : "IdRef", "name" : "Size"},
360+
{ "kind" : "IdRef", "name" : "Data" }
361+
]
362+
},
363+
{
364+
"opname" : "ProgramScopeVariablePointerPushConstant",
365+
"opcode" : 37,
366+
"operands" : [
367+
{ "kind" : "IdRef", "name" : "Offset"},
368+
{ "kind" : "IdRef", "name" : "Size"},
369+
{ "kind" : "IdRef", "name" : "Data" }
370+
]
371+
},
372+
{
373+
"opname" : "PrintfInfo",
374+
"opcode" : 38,
375+
"operands" : [
376+
{ "kind" : "IdRef", "name" : "PrintfID" },
377+
{ "kind" : "IdRef", "name" : "FormatString" },
378+
{ "kind" : "IdRef", "quantifier" : "*", "name" : "ArgumentSizes"}
379+
]
380+
},
381+
{
382+
"opname" : "PrintfBufferStorageBuffer",
383+
"opcode" : 39,
384+
"operands" : [
385+
{ "kind" : "IdRef", "name" : "DescriptorSet" },
386+
{ "kind" : "IdRef", "name" : "Binding" },
387+
{ "kind" : "IdRef", "name" : "BufferSize"}
388+
]
389+
},
390+
{
391+
"opname" : "PrintfBufferPointerPushConstant",
392+
"opcode" : 40,
393+
"operands" : [
394+
{ "kind" : "IdRef", "name" : "Offset" },
395+
{ "kind" : "IdRef", "name" : "Size"},
396+
{ "kind" : "IdRef", "name" : "BufferSize"}
397+
]
398+
}
399+
],
400+
"operand_kinds" : [
401+
{
402+
"category" : "BitEnum",
403+
"kind" : "KernelPropertyFlags",
404+
"enumerants" : [
405+
{
406+
"enumerant" : "None",
407+
"value" : "0x0"
408+
},
409+
{
410+
"enumerant" : "MayUsePrintf",
411+
"value" : "0x1"
412+
}
413+
]
350414
}
351415
]
352416
}

0 commit comments

Comments
 (0)