summaryrefslogtreecommitdiffstats
path: root/thirdparty/spirv-reflect/patches
diff options
context:
space:
mode:
authorJakub Marcowski <01158831@pw.edu.pl>2024-02-05 20:39:02 +0100
committerJakub Marcowski <01158831@pw.edu.pl>2024-02-06 13:46:56 +0100
commit8350c88718736978b41001084dda38d00d84ce33 (patch)
tree47559c286c9adc85a4b4068d41c05bd620597bf4 /thirdparty/spirv-reflect/patches
parentd3352813ea44447bfbf135efdec23acc4d1d3f89 (diff)
downloadredot-engine-8350c88718736978b41001084dda38d00d84ce33.tar.gz
vulkan: Update all components to Vulkan SDK 1.3.275.0
Diffstat (limited to 'thirdparty/spirv-reflect/patches')
-rw-r--r--thirdparty/spirv-reflect/patches/specialization-constants.patch86
1 files changed, 40 insertions, 46 deletions
diff --git a/thirdparty/spirv-reflect/patches/specialization-constants.patch b/thirdparty/spirv-reflect/patches/specialization-constants.patch
index 8ddf625823..297bbf3a2d 100644
--- a/thirdparty/spirv-reflect/patches/specialization-constants.patch
+++ b/thirdparty/spirv-reflect/patches/specialization-constants.patch
@@ -1,8 +1,8 @@
diff --git a/thirdparty/spirv-reflect/spirv_reflect.c b/thirdparty/spirv-reflect/spirv_reflect.c
-index d41b30874e..a830ca9ebf 100644
+index 3b9d6bfecc..e97d1b0438 100644
--- a/thirdparty/spirv-reflect/spirv_reflect.c
+++ b/thirdparty/spirv-reflect/spirv_reflect.c
-@@ -136,6 +136,9 @@ typedef struct SpvReflectPrvDecorations {
+@@ -122,6 +122,9 @@ typedef struct SpvReflectPrvDecorations {
SpvReflectPrvNumberDecoration component;
SpvReflectPrvNumberDecoration offset;
SpvReflectPrvNumberDecoration uav_counter_buffer;
@@ -12,7 +12,7 @@ index d41b30874e..a830ca9ebf 100644
SpvReflectPrvStringDecoration semantic;
uint32_t array_stride;
uint32_t matrix_stride;
-@@ -730,6 +733,9 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser)
+@@ -708,6 +711,9 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser) {
p_parser->nodes[i].decorations.offset.value = (uint32_t)INVALID_VALUE;
p_parser->nodes[i].decorations.uav_counter_buffer.value = (uint32_t)INVALID_VALUE;
p_parser->nodes[i].decorations.built_in = (SpvBuiltIn)INVALID_VALUE;
@@ -22,7 +22,7 @@ index d41b30874e..a830ca9ebf 100644
}
// Mark source file id node
p_parser->source_file_id = (uint32_t)INVALID_VALUE;
-@@ -944,7 +950,15 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser)
+@@ -907,7 +913,13 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser) {
case SpvOpSpecConstantTrue:
case SpvOpSpecConstantFalse:
@@ -32,61 +32,56 @@ index d41b30874e..a830ca9ebf 100644
+ CHECKED_READU32(p_parser, p_node->word_offset + 1, p_node->result_type_id);
+ CHECKED_READU32(p_parser, p_node->word_offset + 2, p_node->result_id);
+ p_node->is_type = true;
-+ }
-+ break;
++ } break;
+// -- GODOT end --
-+
case SpvOpSpecConstantComposite:
case SpvOpSpecConstantOp: {
CHECKED_READU32(p_parser, p_node->word_offset + 1, p_node->result_type_id);
-@@ -1464,6 +1478,9 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser)
+@@ -1385,6 +1397,9 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser) {
+ default: {
skip = true;
- }
- break;
+ } break;
+// -- GODOT begin --
+ case SpvDecorationSpecId:
+// -- GODOT end --
case SpvDecorationRelaxedPrecision:
case SpvDecorationBlock:
case SpvDecorationBufferBlock:
-@@ -1622,6 +1639,15 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser)
- }
- break;
+@@ -1542,6 +1557,14 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser) {
+ p_target_decorations->input_attachment_index.word_offset = word_offset;
+ } break;
+// -- GODOT begin --
+ case SpvDecorationSpecId: {
+ uint32_t word_offset = p_node->word_offset + member_offset+ 3;
+ CHECKED_READU32(p_parser, word_offset, p_target_decorations->specialization_constant.value);
+ p_target_decorations->specialization_constant.word_offset = word_offset;
-+ }
-+ break;
++ } break;
+// -- GODOT end --
+
case SpvReflectDecorationHlslCounterBufferGOOGLE: {
- uint32_t word_offset = p_node->word_offset + member_offset+ 3;
+ uint32_t word_offset = p_node->word_offset + member_offset + 3;
CHECKED_READU32(p_parser, word_offset, p_target_decorations->uav_counter_buffer.value);
-@@ -1955,6 +1981,14 @@ static SpvReflectResult ParseType(
+@@ -1851,6 +1874,13 @@ static SpvReflectResult ParseType(SpvReflectPrvParser* p_parser, SpvReflectPrvNo
+ case SpvOpTypeAccelerationStructureKHR: {
p_type->type_flags |= SPV_REFLECT_TYPE_FLAG_EXTERNAL_ACCELERATION_STRUCTURE;
- }
- break;
+ } break;
+
+// -- GODOT begin --
+ case SpvOpSpecConstantTrue:
+ case SpvOpSpecConstantFalse:
+ case SpvOpSpecConstant: {
-+ }
-+ break;
++ } break;
+// -- GODOT end --
}
if (result == SPV_REFLECT_RESULT_SUCCESS) {
-@@ -3650,6 +3684,69 @@ static SpvReflectResult ParseExecutionModes(
+@@ -3522,6 +3552,68 @@ static SpvReflectResult ParseExecutionModes(SpvReflectPrvParser* p_parser, SpvRe
return SPV_REFLECT_RESULT_SUCCESS;
}
+// -- GODOT begin --
-+static SpvReflectResult ParseSpecializationConstants(SpvReflectPrvParser* p_parser, SpvReflectShaderModule* p_module)
-+{
++static SpvReflectResult ParseSpecializationConstants(SpvReflectPrvParser* p_parser, SpvReflectShaderModule* p_module) {
+ p_module->specialization_constant_count = 0;
+ p_module->specialization_constants = NULL;
+ for (size_t i = 0; i < p_parser->node_count; ++i) {
@@ -147,10 +142,10 @@ index d41b30874e..a830ca9ebf 100644
+}
+// -- GODOT end --
+
- static SpvReflectResult ParsePushConstantBlocks(
- SpvReflectPrvParser* p_parser,
- SpvReflectShaderModule* p_module)
-@@ -4070,6 +4167,12 @@ static SpvReflectResult CreateShaderModule(
+ static SpvReflectResult ParsePushConstantBlocks(SpvReflectPrvParser* p_parser, SpvReflectShaderModule* p_module) {
+ for (size_t i = 0; i < p_parser->node_count; ++i) {
+ SpvReflectPrvNode* p_node = &(p_parser->nodes[i]);
+@@ -3908,6 +4000,12 @@ static SpvReflectResult CreateShaderModule(uint32_t flags, size_t size, const vo
result = ParsePushConstantBlocks(&parser, p_module);
SPV_REFLECT_ASSERT(result == SPV_REFLECT_RESULT_SUCCESS);
}
@@ -163,7 +158,7 @@ index d41b30874e..a830ca9ebf 100644
if (result == SPV_REFLECT_RESULT_SUCCESS) {
result = ParseEntryPoints(&parser, p_module);
SPV_REFLECT_ASSERT(result == SPV_REFLECT_RESULT_SUCCESS);
-@@ -4233,6 +4336,9 @@ void spvReflectDestroyShaderModule(SpvReflectShaderModule* p_module)
+@@ -4056,6 +4154,9 @@ void spvReflectDestroyShaderModule(SpvReflectShaderModule* p_module) {
}
SafeFree(p_module->capabilities);
SafeFree(p_module->entry_points);
@@ -173,7 +168,7 @@ index d41b30874e..a830ca9ebf 100644
// Push constants
for (size_t i = 0; i < p_module->push_constant_block_count; ++i) {
-@@ -4503,6 +4609,38 @@ SpvReflectResult spvReflectEnumerateEntryPointInterfaceVariables(
+@@ -4283,6 +4384,36 @@ SpvReflectResult spvReflectEnumerateEntryPointInterfaceVariables(const SpvReflec
return SPV_REFLECT_RESULT_SUCCESS;
}
@@ -182,8 +177,7 @@ index d41b30874e..a830ca9ebf 100644
+ const SpvReflectShaderModule* p_module,
+ uint32_t* p_count,
+ SpvReflectSpecializationConstant** pp_constants
-+)
-+{
++) {
+ if (IsNull(p_module)) {
+ return SPV_REFLECT_RESULT_ERROR_NULL_POINTER;
+ }
@@ -200,8 +194,7 @@ index d41b30874e..a830ca9ebf 100644
+ SpvReflectSpecializationConstant *p_const = &p_module->specialization_constants[index];
+ pp_constants[index] = p_const;
+ }
-+ }
-+ else {
++ } else {
+ *p_count = p_module->specialization_constant_count;
+ }
+
@@ -209,28 +202,30 @@ index d41b30874e..a830ca9ebf 100644
+}
+// -- GODOT end --
+
- SpvReflectResult spvReflectEnumerateInputVariables(
- const SpvReflectShaderModule* p_module,
- uint32_t* p_count,
+ SpvReflectResult spvReflectEnumerateInputVariables(const SpvReflectShaderModule* p_module, uint32_t* p_count,
+ SpvReflectInterfaceVariable** pp_variables) {
+ if (IsNull(p_module)) {
diff --git a/thirdparty/spirv-reflect/spirv_reflect.h b/thirdparty/spirv-reflect/spirv_reflect.h
-index 12ef2b1e3e..759db682f4 100644
+index 08550e8f02..24446f1c1b 100644
--- a/thirdparty/spirv-reflect/spirv_reflect.h
+++ b/thirdparty/spirv-reflect/spirv_reflect.h
-@@ -359,6 +359,28 @@ typedef struct SpvReflectTypeDescription {
+@@ -374,6 +374,30 @@ typedef struct SpvReflectTypeDescription {
struct SpvReflectTypeDescription* members;
} SpvReflectTypeDescription;
+// -- GODOT begin --
-+/*! @struct SpvReflectSpecializationConstant
++/*! @enum SpvReflectSpecializationConstantType
+
+*/
-+
+typedef enum SpvReflectSpecializationConstantType {
+ SPV_REFLECT_SPECIALIZATION_CONSTANT_BOOL = 0,
+ SPV_REFLECT_SPECIALIZATION_CONSTANT_INT = 1,
+ SPV_REFLECT_SPECIALIZATION_CONSTANT_FLOAT = 2,
+} SpvReflectSpecializationConstantType;
+
++/*! @struct SpvReflectSpecializationConstant
++
++*/
+typedef struct SpvReflectSpecializationConstant {
+ const char* name;
+ uint32_t spirv_id;
@@ -245,18 +240,18 @@ index 12ef2b1e3e..759db682f4 100644
/*! @struct SpvReflectInterfaceVariable
@brief The OpVariable that is either an Input or Output to the module
-@@ -530,6 +552,10 @@ typedef struct SpvReflectShaderModule {
+@@ -549,6 +573,10 @@ typedef struct SpvReflectShaderModule {
SpvReflectInterfaceVariable* interface_variables; // Uses value(s) from first entry point
uint32_t push_constant_block_count; // Uses value(s) from first entry point
SpvReflectBlockVariable* push_constant_blocks; // Uses value(s) from first entry point
-+ // -- GODOT begin --
++// -- GODOT begin --
+ uint32_t specialization_constant_count;
+ SpvReflectSpecializationConstant* specialization_constants;
-+ // -- GODOT end --
++// -- GODOT end --
struct Internal {
SpvReflectModuleFlags module_flags;
-@@ -802,6 +828,33 @@ SpvReflectResult spvReflectEnumerateInputVariables(
+@@ -821,6 +849,32 @@ SpvReflectResult spvReflectEnumerateInputVariables(
SpvReflectInterfaceVariable** pp_variables
);
@@ -278,7 +273,6 @@ index 12ef2b1e3e..759db682f4 100644
+ @return If successful, returns SPV_REFLECT_RESULT_SUCCESS.
+ Otherwise, the error code indicates the cause of the
+ failure.
-+
+*/
+SpvReflectResult spvReflectEnumerateSpecializationConstants(
+ const SpvReflectShaderModule* p_module,