Don't reject valid desc writes with immutable samplers. Refs #260

* Previously we were rejecting/ignoring any descriptor write that didn't
  have a valid sampler and imageview. But if the layout has immutable
  samplers we can allow any write that just has the imageview, and lets
  sampler be NULL.
This commit is contained in:
baldurk
2016-06-03 14:23:15 +02:00
parent 566ab0b678
commit d0ba1dc010
@@ -426,6 +426,10 @@ bool WrappedVulkan::Serialise_vkUpdateDescriptorSets(Serialiser *localSerialiser
if(!valid)
return true;
const DescSetLayout &layout =
m_CreationInfo.m_DescSetLayout
[m_DescriptorSetState[GetResourceManager()->GetNonDispWrapper(writeDesc.dstSet)->id].layout];
switch(writeDesc.descriptorType)
{
case VK_DESCRIPTOR_TYPE_SAMPLER:
@@ -438,7 +442,9 @@ bool WrappedVulkan::Serialise_vkUpdateDescriptorSets(Serialiser *localSerialiser
{
for(uint32_t i = 0; i < writeDesc.descriptorCount; i++)
{
valid &= (writeDesc.pImageInfo[i].sampler != VK_NULL_HANDLE);
valid &= (writeDesc.pImageInfo[i].sampler != VK_NULL_HANDLE) ||
(layout.bindings[writeDesc.dstBinding].immutableSampler &&
layout.bindings[writeDesc.dstBinding].immutableSampler[i] != ResourceId());
valid &= (writeDesc.pImageInfo[i].imageView != VK_NULL_HANDLE);
}
break;