Skip to content

Commit

Permalink
Update ClspvReflection non-semantic instruction set (KhronosGroup#308)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
callumfare authored Jan 3, 2023
1 parent 34d0464 commit c16439f
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 3 deletions.
14 changes: 13 additions & 1 deletion include/spirv/unified1/NonSemanticClspvReflection.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {
#endif

enum {
NonSemanticClspvReflectionRevision = 4,
NonSemanticClspvReflectionRevision = 5,
NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff
};

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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" }
]
},
{
Expand Down Expand Up @@ -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"
}
]
}
]
}

0 comments on commit c16439f

Please sign in to comment.