mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 13:00:32 +00:00
Check sampler validity against immutable samplers on serialise
This commit is contained in:
@@ -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 ||
|
||||
|
||||
@@ -1236,6 +1236,17 @@ void main()
|
||||
Submit(0, 4, {cmd});
|
||||
}
|
||||
|
||||
// try writing with an invalid sampler to the immutable, it should be ignored
|
||||
vkh::updateDescriptorSets(
|
||||
device,
|
||||
{
|
||||
vkh::WriteDescriptorSet(
|
||||
immutdescset, 0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
|
||||
{
|
||||
vkh::DescriptorImageInfo(validImgView, VK_IMAGE_LAYOUT_GENERAL, invalidSampler),
|
||||
}),
|
||||
});
|
||||
|
||||
// do a bunch of spinning on fences/semaphores that should not be serialised exhaustively
|
||||
VkResult status = VK_SUCCESS;
|
||||
for(size_t i = 0; i < 1000; i++)
|
||||
|
||||
Reference in New Issue
Block a user