mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
spirv-reflect: Update to latest commit
This commit is contained in:
parent
99df193bea
commit
02e102911f
5 changed files with 147 additions and 23 deletions
|
|
@ -1,8 +1,8 @@
|
|||
diff --git a/thirdparty/spirv-reflect/spirv_reflect.c b/thirdparty/spirv-reflect/spirv_reflect.c
|
||||
index e9b11bf495..f181df5fa2 100644
|
||||
index cdcf3ca663..c174ae1900 100644
|
||||
--- a/thirdparty/spirv-reflect/spirv_reflect.c
|
||||
+++ b/thirdparty/spirv-reflect/spirv_reflect.c
|
||||
@@ -125,6 +125,9 @@ typedef struct SpvReflectPrvDecorations {
|
||||
@@ -126,6 +126,9 @@ typedef struct SpvReflectPrvDecorations {
|
||||
SpvReflectPrvNumberDecoration location;
|
||||
SpvReflectPrvNumberDecoration offset;
|
||||
SpvReflectPrvNumberDecoration uav_counter_buffer;
|
||||
|
|
@ -12,7 +12,7 @@ index e9b11bf495..f181df5fa2 100644
|
|||
SpvReflectPrvStringDecoration semantic;
|
||||
uint32_t array_stride;
|
||||
uint32_t matrix_stride;
|
||||
@@ -631,6 +634,9 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser)
|
||||
@@ -639,6 +642,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 e9b11bf495..f181df5fa2 100644
|
|||
}
|
||||
// Mark source file id node
|
||||
p_parser->source_file_id = (uint32_t)INVALID_VALUE;
|
||||
@@ -821,10 +827,16 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser)
|
||||
@@ -829,10 +835,16 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser)
|
||||
CHECKED_READU32(p_parser, p_node->word_offset + 2, p_node->result_id);
|
||||
}
|
||||
break;
|
||||
|
|
@ -41,7 +41,7 @@ index e9b11bf495..f181df5fa2 100644
|
|||
case SpvOpSpecConstantComposite:
|
||||
case SpvOpSpecConstantOp: {
|
||||
CHECKED_READU32(p_parser, p_node->word_offset + 1, p_node->result_type_id);
|
||||
@@ -856,7 +868,7 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser)
|
||||
@@ -864,7 +876,7 @@ static SpvReflectResult ParseNodes(SpvReflectPrvParser* p_parser)
|
||||
CHECKED_READU32(p_parser, p_node->word_offset + 3, p_access_chain->base_id);
|
||||
//
|
||||
// SPIRV_ACCESS_CHAIN_INDEX_OFFSET (4) is the number of words up until the first index:
|
||||
|
|
@ -50,7 +50,7 @@ index e9b11bf495..f181df5fa2 100644
|
|||
//
|
||||
p_access_chain->index_count = (node_word_count - SPIRV_ACCESS_CHAIN_INDEX_OFFSET);
|
||||
if (p_access_chain->index_count > 0) {
|
||||
@@ -1338,6 +1350,9 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser)
|
||||
@@ -1346,6 +1358,9 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser)
|
||||
skip = true;
|
||||
}
|
||||
break;
|
||||
|
|
@ -60,7 +60,7 @@ index e9b11bf495..f181df5fa2 100644
|
|||
case SpvDecorationRelaxedPrecision:
|
||||
case SpvDecorationBlock:
|
||||
case SpvDecorationBufferBlock:
|
||||
@@ -1481,7 +1496,14 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser)
|
||||
@@ -1495,7 +1510,14 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser)
|
||||
p_target_decorations->input_attachment_index.word_offset = word_offset;
|
||||
}
|
||||
break;
|
||||
|
|
@ -76,7 +76,7 @@ index e9b11bf495..f181df5fa2 100644
|
|||
case SpvReflectDecorationHlslCounterBufferGOOGLE: {
|
||||
uint32_t word_offset = p_node->word_offset + member_offset+ 3;
|
||||
CHECKED_READU32(p_parser, word_offset, p_target_decorations->uav_counter_buffer.value);
|
||||
@@ -1789,6 +1811,13 @@ static SpvReflectResult ParseType(
|
||||
@@ -1803,6 +1825,13 @@ static SpvReflectResult ParseType(
|
||||
p_type->type_flags |= SPV_REFLECT_TYPE_FLAG_EXTERNAL_ACCELERATION_STRUCTURE;
|
||||
}
|
||||
break;
|
||||
|
|
@ -90,7 +90,7 @@ index e9b11bf495..f181df5fa2 100644
|
|||
}
|
||||
|
||||
if (result == SPV_REFLECT_RESULT_SUCCESS) {
|
||||
@@ -3269,6 +3298,69 @@ static SpvReflectResult ParseExecutionModes(
|
||||
@@ -3332,6 +3361,69 @@ static SpvReflectResult ParseExecutionModes(
|
||||
return SPV_REFLECT_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ index e9b11bf495..f181df5fa2 100644
|
|||
static SpvReflectResult ParsePushConstantBlocks(
|
||||
SpvReflectPrvParser* p_parser,
|
||||
SpvReflectShaderModule* p_module)
|
||||
@@ -3650,6 +3742,12 @@ static SpvReflectResult CreateShaderModule(
|
||||
@@ -3717,6 +3809,12 @@ static SpvReflectResult CreateShaderModule(
|
||||
result = ParsePushConstantBlocks(&parser, p_module);
|
||||
SPV_REFLECT_ASSERT(result == SPV_REFLECT_RESULT_SUCCESS);
|
||||
}
|
||||
|
|
@ -173,8 +173,8 @@ index e9b11bf495..f181df5fa2 100644
|
|||
if (result == SPV_REFLECT_RESULT_SUCCESS) {
|
||||
result = ParseEntryPoints(&parser, p_module);
|
||||
SPV_REFLECT_ASSERT(result == SPV_REFLECT_RESULT_SUCCESS);
|
||||
@@ -3807,6 +3905,9 @@ void spvReflectDestroyShaderModule(SpvReflectShaderModule* p_module)
|
||||
SafeFree(p_entry->used_push_constants);
|
||||
@@ -3875,6 +3973,9 @@ void spvReflectDestroyShaderModule(SpvReflectShaderModule* p_module)
|
||||
SafeFree(p_entry->execution_modes);
|
||||
}
|
||||
SafeFree(p_module->entry_points);
|
||||
+// -- GODOT begin --
|
||||
|
|
@ -183,7 +183,7 @@ index e9b11bf495..f181df5fa2 100644
|
|||
|
||||
// Push constants
|
||||
for (size_t i = 0; i < p_module->push_constant_block_count; ++i) {
|
||||
@@ -4077,6 +4178,38 @@ SpvReflectResult spvReflectEnumerateEntryPointInterfaceVariables(
|
||||
@@ -4145,6 +4246,38 @@ SpvReflectResult spvReflectEnumerateEntryPointInterfaceVariables(
|
||||
return SPV_REFLECT_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -223,10 +223,10 @@ index e9b11bf495..f181df5fa2 100644
|
|||
const SpvReflectShaderModule* p_module,
|
||||
uint32_t* p_count,
|
||||
diff --git a/thirdparty/spirv-reflect/spirv_reflect.h b/thirdparty/spirv-reflect/spirv_reflect.h
|
||||
index e9e4c40755..948533d3c0 100644
|
||||
index 02b81613a1..02850f8811 100644
|
||||
--- a/thirdparty/spirv-reflect/spirv_reflect.h
|
||||
+++ b/thirdparty/spirv-reflect/spirv_reflect.h
|
||||
@@ -323,6 +323,28 @@ typedef struct SpvReflectTypeDescription {
|
||||
@@ -329,6 +329,28 @@ typedef struct SpvReflectTypeDescription {
|
||||
struct SpvReflectTypeDescription* members;
|
||||
} SpvReflectTypeDescription;
|
||||
|
||||
|
|
@ -255,7 +255,7 @@ index e9e4c40755..948533d3c0 100644
|
|||
|
||||
/*! @struct SpvReflectInterfaceVariable
|
||||
|
||||
@@ -472,6 +494,10 @@ typedef struct SpvReflectShaderModule {
|
||||
@@ -483,6 +505,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
|
||||
|
|
@ -266,7 +266,7 @@ index e9e4c40755..948533d3c0 100644
|
|||
|
||||
struct Internal {
|
||||
SpvReflectModuleFlags module_flags;
|
||||
@@ -744,6 +770,33 @@ SpvReflectResult spvReflectEnumerateInputVariables(
|
||||
@@ -755,6 +781,33 @@ SpvReflectResult spvReflectEnumerateInputVariables(
|
||||
SpvReflectInterfaceVariable** pp_variables
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue