Fix enabling of bufferDeviceAddressCaptureReplay

* We only enable this if we find an existing struct somewhere enabling the base
  feature. Otherwise we might try to enable this when it's not supported at all.
This commit is contained in:
baldurk
2020-09-09 16:40:00 +01:00
parent 75cb5d18d6
commit 3f26f42541
@@ -2919,6 +2919,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
if(existing)
{
existing->bufferDeviceAddress = VK_TRUE;
existing->bufferDeviceAddressCaptureReplay = VK_TRUE;
}
else
{
@@ -2932,8 +2933,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
if(!existingKHR && !existingEXT)
{
// don't add a new VkPhysicalDeviceVulkan12Features to the pNext chain because if we do
// we
// have to remove any components etc. Instead just add the individual
// we have to remove any components etc. Instead just add the individual
// VkPhysicalDeviceBufferDeviceAddressFeaturesKHR
bufAddrKHRFeatures.bufferDeviceAddress = VK_TRUE;
bufAddrKHRFeatures.bufferDeviceAddressMultiDevice = VK_FALSE;
@@ -2961,6 +2961,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
{
// if so, make sure the feature is enabled
existing->bufferDeviceAddress = VK_TRUE;
existing->bufferDeviceAddressCaptureReplay = VK_TRUE;
}
else
{
@@ -2998,6 +2999,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
{
// if so, make sure the feature is enabled
existing->bufferDeviceAddress = VK_TRUE;
existing->bufferDeviceAddressCaptureReplay = VK_TRUE;
}
else
{
@@ -3019,30 +3021,6 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
}
}
{
VkPhysicalDeviceVulkan12Features *enabledFeaturesVK12 =
(VkPhysicalDeviceVulkan12Features *)FindNextStruct(
&createInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES);
VkPhysicalDeviceBufferDeviceAddressFeatures *bufferAddressFeaturesCoreKHR =
(VkPhysicalDeviceBufferDeviceAddressFeatures *)FindNextStruct(
&createInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES);
VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *bufferAddressFeaturesEXT =
(VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *)FindNextStruct(
&createInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT);
// turn on bufferDeviceAddressCaptureReplay if available, so that a capture that uses it is
// safe
// to replay. Enabling this without using it is fine.
if(enabledFeaturesVK12 && enabledFeaturesVK12->bufferDeviceAddress)
enabledFeaturesVK12->bufferDeviceAddressCaptureReplay = VK_TRUE;
if(bufferAddressFeaturesCoreKHR)
bufferAddressFeaturesCoreKHR->bufferDeviceAddressCaptureReplay = VK_TRUE;
if(bufferAddressFeaturesEXT)
bufferAddressFeaturesEXT->bufferDeviceAddressCaptureReplay = VK_TRUE;
}
rdcarray<const char *> layerArray(Layers.size());
for(size_t i = 0; i < Layers.size(); i++)
layerArray[i] = Layers[i].c_str();