Thirdparty: Harmonize patches to document downstream changes

This commit is contained in:
Rémi Verschelde 2025-01-31 10:58:38 +01:00
parent 0d14ae58b0
commit 91907a89f7
141 changed files with 1274 additions and 3849 deletions

View file

@ -1,19 +1,17 @@
diff --git a/thirdparty/spirv-reflect/spirv_reflect.c b/thirdparty/spirv-reflect/spirv_reflect.c
index b4f6bc17c2..c96dd85439 100644
index b4f6bc17c2..ba64a3f54d 100644
--- a/thirdparty/spirv-reflect/spirv_reflect.c
+++ b/thirdparty/spirv-reflect/spirv_reflect.c
@@ -1571,6 +1571,10 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle
@@ -1571,6 +1571,8 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle
} break;
case SpvDecorationSpecId: {
+// -- GODOT begin --
+ uint32_t word_offset = p_node->word_offset + member_offset+ 3;
+ CHECKED_READU32(p_parser, word_offset, p_target_decorations->spec_id);
+// -- GODOT end --
spec_constant_count++;
} break;
@@ -1692,21 +1696,45 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle
@@ -1692,21 +1694,43 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle
}
for (uint32_t i = 0; i < p_parser->node_count; ++i) {
SpvReflectPrvNode* p_node = &(p_parser->nodes[i]);
@ -28,7 +26,6 @@ index b4f6bc17c2..c96dd85439 100644
- SpvReflectPrvNode* target_node = FindNode(p_parser, p_module->spec_constants[count].spirv_id);
- if (IsNotNull(target_node)) {
- p_module->spec_constants[count].name = target_node->name;
+// -- GODOT begin --
+ const uint32_t count = p_module->spec_constant_count;
+ switch(p_node->op) {
+ default: continue;
@ -68,19 +65,17 @@ index b4f6bc17c2..c96dd85439 100644
+ p_module->spec_constants[count].spirv_id = p_node->result_id;
+
+ p_module->spec_constant_count++;
+// -- GODOT end --
}
return SPV_REFLECT_RESULT_SUCCESS;
diff --git a/thirdparty/spirv-reflect/spirv_reflect.h b/thirdparty/spirv-reflect/spirv_reflect.h
index 9a42f14eed..4ea0319c5e 100644
index 9a42f14eed..cf8cfe2183 100644
--- a/thirdparty/spirv-reflect/spirv_reflect.h
+++ b/thirdparty/spirv-reflect/spirv_reflect.h
@@ -568,6 +568,17 @@ typedef struct SpvReflectCapability {
@@ -568,6 +568,15 @@ typedef struct SpvReflectCapability {
} SpvReflectCapability;
+// -- GODOT begin --
+/*! @enum SpvReflectSpecializationConstantType
+
+*/
@ -89,22 +84,19 @@ index 9a42f14eed..4ea0319c5e 100644
+ SPV_REFLECT_SPECIALIZATION_CONSTANT_INT = 1,
+ SPV_REFLECT_SPECIALIZATION_CONSTANT_FLOAT = 2,
+} SpvReflectSpecializationConstantType;
+// -- GODOT end --
+
/*! @struct SpvReflectSpecId
*/
@@ -575,6 +586,13 @@ typedef struct SpvReflectSpecializationConstant {
@@ -575,6 +584,11 @@ typedef struct SpvReflectSpecializationConstant {
uint32_t spirv_id;
uint32_t constant_id;
const char* name;
+// -- GODOT begin --
+ SpvReflectSpecializationConstantType constant_type;
+ union {
+ float float_value;
+ uint32_t int_bool_value;
+ } default_value;
+// -- GODOT end --
} SpvReflectSpecializationConstant;
/*! @struct SpvReflectShaderModule

View file

@ -1,18 +1,16 @@
diff --git a/thirdparty/spirv-reflect/spirv_reflect.c b/thirdparty/spirv-reflect/spirv_reflect.c
index c96dd85439..2ca9c8580d 100644
index ba64a3f54d..599667be26 100644
--- a/thirdparty/spirv-reflect/spirv_reflect.c
+++ b/thirdparty/spirv-reflect/spirv_reflect.c
@@ -2692,6 +2692,13 @@ static SpvReflectResult ParseDescriptorBlockVariableSizes(SpvReflectPrvParser* p
@@ -2688,6 +2688,11 @@ static SpvReflectResult ParseDescriptorBlockVariableSizes(SpvReflectPrvParser* p
// ...then array
uint32_t element_count = (p_member_var->array.dims_count > 0 ? 1 : 0);
for (uint32_t i = 0; i < p_member_var->array.dims_count; ++i) {
+// -- GODOT begin --
+ if (p_member_var->array.spec_constant_op_ids[i] != (uint32_t)INVALID_VALUE) {
+ // Force size to be reported as 0 to effectively disable buffer size validation, since
+ // the value is unreliable anyway as only valid for the default values of the SCs involved.
+ element_count = 0;
+ }
+// -- GODOT end --
element_count *= p_member_var->array.dims[i];
}
p_member_var->size = element_count * p_member_var->array.stride;