Handle immutable samplers correctly on writing, they are wrapped already

This commit is contained in:
baldurk
2016-01-17 10:50:17 +01:00
parent 3eca6b5783
commit d3c52bbe90
2 changed files with 11 additions and 1 deletions
+3
View File
@@ -317,6 +317,9 @@ class ResourceManager : public ResourceRecordHandler
byte *blob;
};
bool IsWriting() { return m_State >= WRITING; }
bool IsReading() { return m_State < WRITING; }
///////////////////////////////////////////
// Capture-side methods
+8 -1
View File
@@ -45,7 +45,14 @@ void DescSetLayout::Init(VulkanResourceManager *resourceMan, VulkanCreationInfo
bindings[i].immutableSampler = new ResourceId[bindings[i].descriptorCount];
for(uint32_t s=0; s < bindings[i].descriptorCount; s++)
bindings[i].immutableSampler[s] = resourceMan->GetNonDispWrapper(pCreateInfo->pBindings[i].pImmutableSamplers[s])->id;
{
// during writing, the create info contains the *wrapped* objects.
// on replay, we have the wrapper map so we can look it up
if(resourceMan->IsWriting())
bindings[i].immutableSampler[s] = GetResID(pCreateInfo->pBindings[i].pImmutableSamplers[s]);
else
bindings[i].immutableSampler[s] = resourceMan->GetNonDispWrapper(pCreateInfo->pBindings[i].pImmutableSamplers[s])->id;
}
}
}
}