set immutable samplers array to NULL if there are none

This commit is contained in:
baldurk
2016-02-07 18:37:52 +01:00
parent 8cb5066422
commit ad5276b390
+7 -2
View File
@@ -2118,8 +2118,13 @@ void Serialiser::Serialise(const char *name, VkDescriptorSetLayoutBinding &el)
bool hasSamplers = el.pImmutableSamplers != NULL;
Serialise("hasSamplers", hasSamplers);
if(hasSamplers && m_Mode == READING)
el.pImmutableSamplers = new VkSampler[el.arraySize];
if(m_Mode == READING)
{
if(hasSamplers)
el.pImmutableSamplers = new VkSampler[el.arraySize];
else
el.pImmutableSamplers = NULL;
}
VkSampler *samplers = (VkSampler *)el.pImmutableSamplers;