From c16439f4268a9de088ac7c67b6206ade4b28d53a Mon Sep 17 00:00:00 2001 From: Callum Fare Date: Tue, 3 Jan 2023 14:46:59 +0000 Subject: [PATCH] Update ClspvReflection non-semantic instruction set (#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 --- .../spirv/unified1/NonSemanticClspvReflection.h | 14 ++++- ...xtinst.nonsemantic.clspvreflection.grammar.json | 68 +++++++++++++++++++++- 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/include/spirv/unified1/NonSemanticClspvReflection.h b/include/spirv/unified1/NonSemanticClspvReflection.h index 0cdf29d..1a31549 100644 --- a/include/spirv/unified1/NonSemanticClspvReflection.h +++ b/include/spirv/unified1/NonSemanticClspvReflection.h @@ -33,7 +33,7 @@ extern "C" { #endif enum { - NonSemanticClspvReflectionRevision = 4, + NonSemanticClspvReflectionRevision = 5, NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff }; @@ -73,10 +73,22 @@ enum NonSemanticClspvReflectionInstructions { NonSemanticClspvReflectionImageArgumentInfoChannelDataTypeUniform = 33, NonSemanticClspvReflectionArgumentStorageTexelBuffer = 34, NonSemanticClspvReflectionArgumentUniformTexelBuffer = 35, + NonSemanticClspvReflectionConstantDataPointerPushConstant = 36, + NonSemanticClspvReflectionProgramScopeVariablePointerPushConstant = 37, + NonSemanticClspvReflectionPrintfInfo = 38, + NonSemanticClspvReflectionPrintfBufferStorageBuffer = 39, + NonSemanticClspvReflectionPrintfBufferPointerPushConstant = 40, NonSemanticClspvReflectionInstructionsMax = 0x7fffffff }; +enum NonSemanticClspvReflectionKernelPropertyFlags { + NonSemanticClspvReflectionNone = 0x0, + NonSemanticClspvReflectionMayUsePrintf = 0x1, + NonSemanticClspvReflectionKernelPropertyFlagsMax = 0x7fffffff +}; + + #ifdef __cplusplus } #endif diff --git a/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json b/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json index b5a6637..d47e502 100644 --- a/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json +++ b/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json @@ -1,12 +1,15 @@ { - "revision" : 4, + "revision" : 5, "instructions" : [ { "opname" : "Kernel", "opcode" : 1, "operands" : [ { "kind" : "IdRef", "name" : "Kernel" }, - { "kind" : "IdRef", "name" : "Name" } + { "kind" : "IdRef", "name" : "Name" }, + { "kind" : "IdRef", "name" : "NumArguments"}, + { "kind" : "IdRef", "name" : "Flags" }, + { "kind" : "IdRef", "name" : "Attributes" } ] }, { @@ -347,6 +350,67 @@ { "kind" : "IdRef", "name" : "Binding" }, { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" } ] + }, + { + "opname" : "ConstantDataPointerPushConstant", + "opcode" : 36, + "operands" : [ + { "kind" : "IdRef", "name" : "Offset"}, + { "kind" : "IdRef", "name" : "Size"}, + { "kind" : "IdRef", "name" : "Data" } + ] + }, + { + "opname" : "ProgramScopeVariablePointerPushConstant", + "opcode" : 37, + "operands" : [ + { "kind" : "IdRef", "name" : "Offset"}, + { "kind" : "IdRef", "name" : "Size"}, + { "kind" : "IdRef", "name" : "Data" } + ] + }, + { + "opname" : "PrintfInfo", + "opcode" : 38, + "operands" : [ + { "kind" : "IdRef", "name" : "PrintfID" }, + { "kind" : "IdRef", "name" : "FormatString" }, + { "kind" : "IdRef", "quantifier" : "*", "name" : "ArgumentSizes"} + ] + }, + { + "opname" : "PrintfBufferStorageBuffer", + "opcode" : 39, + "operands" : [ + { "kind" : "IdRef", "name" : "DescriptorSet" }, + { "kind" : "IdRef", "name" : "Binding" }, + { "kind" : "IdRef", "name" : "BufferSize"} + ] + }, + { + "opname" : "PrintfBufferPointerPushConstant", + "opcode" : 40, + "operands" : [ + { "kind" : "IdRef", "name" : "Offset" }, + { "kind" : "IdRef", "name" : "Size"}, + { "kind" : "IdRef", "name" : "BufferSize"} + ] + } + ], + "operand_kinds" : [ + { + "category" : "BitEnum", + "kind" : "KernelPropertyFlags", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0" + }, + { + "enumerant" : "MayUsePrintf", + "value" : "0x1" + } + ] } ] } -- 2.7.4