Skip to content

Commit

Permalink
Do not emit sampler for input attachment in json
Browse files Browse the repository at this point in the history
  • Loading branch information
panos-lunarg committed Jan 15, 2025
1 parent 79e0919 commit 2bed2d0
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion framework/decode/custom_vulkan_struct_to_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit 2bed2d0

Please sign in to comment.