Check sampler validity against immutable samplers on serialise

This commit is contained in:
baldurk
2021-03-15 14:39:21 +00:00
parent 90d7bc1926
commit 827a48fe57
2 changed files with 23 additions and 0 deletions
+12
View File
@@ -23,6 +23,7 @@
******************************************************************************/
#include "vk_common.h"
#include "vk_info.h"
#include "vk_manager.h"
#include "vk_resources.h"
@@ -3250,8 +3251,19 @@ void DoSerialise(SerialiserType &ser, VkWriteDescriptorSet &el)
if(el.descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER ||
el.descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER)
{
validity = validity | VkDescriptorImageInfoValidity::Sampler;
// on writing check if this is an immutable samplers binding. If it is we can't treat the
// sampler as valid. On replay we don't have to do this because invalid samplers got
// serialised as NULL safely.
if(ser.IsWriting() && el.dstSet != VK_NULL_HANDLE)
{
if(GetRecord(el.dstSet)->descInfo->layout->bindings[el.dstBinding].immutableSampler != NULL)
validity = validity & ~VkDescriptorImageInfoValidity::Sampler;
}
}
if(el.descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER ||
el.descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE ||
el.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE ||