mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-07 14:25:44 +00:00
Check for immutable samplers in push descriptor updates
* Because these fields can be randomly garbage
This commit is contained in:
@@ -3379,10 +3379,21 @@ void DescUpdateTemplate::Apply(const void *pData, DescUpdateTemplateApplication
|
||||
|
||||
application.imgInfo.resize(idx + entry.descriptorCount);
|
||||
|
||||
const DescSetLayout::Binding *layoutBinding = &layout.bindings[entry.dstBinding];
|
||||
|
||||
for(uint32_t d = 0; d < entry.descriptorCount; d++)
|
||||
{
|
||||
memcpy(&application.imgInfo[idx + d], src, sizeof(VkDescriptorImageInfo));
|
||||
src += entry.stride;
|
||||
|
||||
if((entry.descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER ||
|
||||
entry.descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) &&
|
||||
layoutBinding->immutableSampler != NULL)
|
||||
{
|
||||
// force potentially garbage samplers to NULL here as by the time we get to serialising we
|
||||
// will have no way to determine this anymore
|
||||
application.imgInfo[idx + d].sampler = VK_NULL_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
write.pImageInfo = &application.imgInfo[idx];
|
||||
|
||||
@@ -100,13 +100,15 @@ struct DescriptorTemplateRefs
|
||||
entry.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE ||
|
||||
entry.descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT);
|
||||
|
||||
const DescSetLayout::Binding *layoutBinding = &tempInfo->layout.bindings[entry.dstBinding];
|
||||
|
||||
for(uint32_t d = 0; d < entry.descriptorCount; d++)
|
||||
{
|
||||
memcpy(dst, src, sizeof(VkDescriptorImageInfo));
|
||||
|
||||
VkDescriptorImageInfo *info = (VkDescriptorImageInfo *)dst;
|
||||
|
||||
if(hasSampler && info->sampler != VK_NULL_HANDLE)
|
||||
if(hasSampler && layoutBinding->immutableSampler == NULL && info->sampler != VK_NULL_HANDLE)
|
||||
{
|
||||
frameRefs.push_back(make_rdcpair(GetResID(info->sampler), eFrameRef_Read));
|
||||
info->sampler = Unwrap(info->sampler);
|
||||
|
||||
Reference in New Issue
Block a user