mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Detect unused fields in VkDescriptorImageInfo
The Vulkan specification allows to have uninitialized fields in VkDescriptorImageInfo based on descriptor type. Such fields should not be touched by the implementation (which includes drivers, validation layers and tools).
This commit is contained in:
committed by
Baldur Karlsson
parent
71704d2885
commit
195a4e6d6b
@@ -10469,20 +10469,19 @@ void DoSerialise(SerialiserType &ser, VkDescriptorGetInfoEXT &el)
|
||||
RDCASSERT(ser.IsReading() || el.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT);
|
||||
SerialiseNext(ser, el.sType, el.pNext);
|
||||
|
||||
// these fields must either be NULL or valid if present, never garbage
|
||||
ser.SetStructArg(
|
||||
uint64_t(VkDescriptorImageInfoValidity::Sampler | VkDescriptorImageInfoValidity::ImageView));
|
||||
|
||||
SERIALISE_MEMBER(type);
|
||||
switch(el.type)
|
||||
{
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLER:
|
||||
{
|
||||
ser.SetStructArg(uint64_t(VkDescriptorImageInfoValidity::Sampler));
|
||||
SERIALISE_MEMBER_OPT(data.pSampler).Named("pSampler");
|
||||
break;
|
||||
}
|
||||
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
|
||||
{
|
||||
ser.SetStructArg(uint64_t(VkDescriptorImageInfoValidity::Sampler |
|
||||
VkDescriptorImageInfoValidity::ImageView));
|
||||
SERIALISE_MEMBER_OPT(data.pCombinedImageSampler).Named("pCombinedImageSampler");
|
||||
break;
|
||||
}
|
||||
@@ -10490,6 +10489,7 @@ void DoSerialise(SerialiserType &ser, VkDescriptorGetInfoEXT &el)
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
|
||||
{
|
||||
ser.SetStructArg(uint64_t(VkDescriptorImageInfoValidity::ImageView));
|
||||
SERIALISE_MEMBER_OPT(data.pStorageImage).Named("pStorageImage");
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user