Only pretend to match replay requirements during capture. Refs #552

* When creating replay-only images via vkCreateImage we don't need to
  add any extra properties. Only during capture we need to add replay-
  needed properties, so that the same call will be used as during replay
  and so the same set of memory requirements.
This commit is contained in:
baldurk
2017-04-03 15:30:55 +01:00
parent e93dc87388
commit 965c48e250
@@ -1186,7 +1186,10 @@ VkResult WrappedVulkan::vkCreateImage(VkDevice device, const VkImageCreateInfo *
// TEMP HACK: Until we define a portable fake hardware, need to match the requirements for usage
// on replay, so that the memory requirements are the same
createInfo_adjusted.usage |= VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
if(m_State >= WRITING)
{
createInfo_adjusted.usage |= VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
}
if(createInfo_adjusted.samples != VK_SAMPLE_COUNT_1_BIT)
{
@@ -1194,10 +1197,13 @@ VkResult WrappedVulkan::vkCreateImage(VkDevice device, const VkImageCreateInfo *
createInfo_adjusted.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
// TEMP HACK: matching replay requirements
if(!IsDepthOrStencilFormat(createInfo_adjusted.format))
createInfo_adjusted.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
else
createInfo_adjusted.usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
if(m_State >= WRITING)
{
if(!IsDepthOrStencilFormat(createInfo_adjusted.format))
createInfo_adjusted.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
else
createInfo_adjusted.usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
}
}
VkResult ret =