From 2bed2d0259f59f6ecaa73fca1fc7c056ab04ab68 Mon Sep 17 00:00:00 2001 From: Panagiotis Apostolou Date: Wed, 15 Jan 2025 17:28:24 +0200 Subject: [PATCH] Do not emit sampler for input attachment in json --- .../decode/custom_vulkan_struct_to_json.cpp | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/framework/decode/custom_vulkan_struct_to_json.cpp b/framework/decode/custom_vulkan_struct_to_json.cpp index 6161228a7d..0c497f9407 100644 --- a/framework/decode/custom_vulkan_struct_to_json.cpp +++ b/framework/decode/custom_vulkan_struct_to_json.cpp @@ -212,6 +212,24 @@ void FieldToJson(nlohmann::ordered_json& jdata, const Decoded_VkDescriptorImageI } } +void FieldToJson(nlohmann::ordered_json& jdata, + VkDescriptorType discriminant, + const Decoded_VkDescriptorImageInfo* data, + const JsonOptions& options) +{ + if (data && data->decoded_value) + { + const auto& decoded_value = *data->decoded_value; + const auto& meta_struct = *data; + if (discriminant == VK_DESCRIPTOR_TYPE_SAMPLER || discriminant == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) + { + HandleToJson(jdata["sampler"], meta_struct.sampler, options); + } + HandleToJson(jdata["imageView"], meta_struct.imageView, options); + HandleToJson(jdata["imageLayout"], decoded_value.imageLayout, options); + } +} + void FieldToJson(nlohmann::ordered_json& jdata, const Decoded_VkWriteDescriptorSet* data, const JsonOptions& options) { if (data && data->decoded_value) @@ -233,7 +251,7 @@ void FieldToJson(nlohmann::ordered_json& jdata, const Decoded_VkWriteDescriptorS case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: case VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM: case VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM: - FieldToJson(jdata["pImageInfo"], meta_struct.pImageInfo, options); + FieldToJson(jdata["pImageInfo"], decoded_value.descriptorType, meta_struct.pImageInfo->GetMetaStructPointer(), options); break; case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: