Use immutable samplers when checking for validity

* Fortunately the sampler element in the write is ignored when doing the actual
  update so it's safe to write these in before the validity check.
This commit is contained in:
baldurk
2018-09-03 13:41:20 +01:00
parent 6df1edaa10
commit 878c0c9ff1
+9
View File
@@ -708,6 +708,8 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id, W
uint32_t descriptorCount = layout.bindings[j].descriptorCount;
ResourceId *immutableSamplers = layout.bindings[j].immutableSampler;
DescriptorSetSlot *src = srcData;
srcData += descriptorCount;
@@ -753,6 +755,13 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id, W
for(uint32_t d = 0; d < descriptorCount; d++)
dstImage[d] = src[d].imageInfo;
if(immutableSamplers)
{
for(uint32_t d = 0; d < descriptorCount; d++)
dstImage[d].sampler =
GetResourceManager()->GetCurrentHandle<VkSampler>(immutableSamplers[d]);
}
writes[bind].pImageInfo = dstImage;
// NULL the others
dstBuffer = NULL;