Commit a4588e33 by Charlie Lao Committed by Commit Bot

Vulkan: Disable logMemoryReportStats if driver extension not exist

logMemoryReportCallbacks and logMemoryReportCallbacks features are useful for memory debugging. But they rely on VK_EXT_device_memory_report extension. Right now if this extension is not there and you enable the log, you still see the logs but everything is all zero. This CL will disable the feature and print out warning message if the extension is not supported. Bug: None Change-Id: I478ae0ac7ba1ee43245a9fd8a3f1d9907f5d833c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2861310 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com>
parent e210287b
...@@ -1708,17 +1708,35 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF ...@@ -1708,17 +1708,35 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF
vk::AddToPNextChain(&createInfo, &mMultisampledRenderToSingleSampledFeatures); vk::AddToPNextChain(&createInfo, &mMultisampledRenderToSingleSampledFeatures);
} }
if (mMemoryReportFeatures.deviceMemoryReport && if (getFeatures().logMemoryReportCallbacks.enabled ||
(getFeatures().logMemoryReportCallbacks.enabled || getFeatures().logMemoryReportStats.enabled)
getFeatures().logMemoryReportStats.enabled))
{ {
enabledDeviceExtensions.push_back(VK_EXT_DEVICE_MEMORY_REPORT_EXTENSION_NAME); if (mMemoryReportFeatures.deviceMemoryReport)
{
mMemoryReportCallback = {}; enabledDeviceExtensions.push_back(VK_EXT_DEVICE_MEMORY_REPORT_EXTENSION_NAME);
mMemoryReportCallback.sType = VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT;
mMemoryReportCallback.pfnUserCallback = &MemoryReportCallback; mMemoryReportCallback = {};
mMemoryReportCallback.pUserData = this; mMemoryReportCallback.sType =
vk::AddToPNextChain(&createInfo, &mMemoryReportCallback); VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT;
mMemoryReportCallback.pfnUserCallback = &MemoryReportCallback;
mMemoryReportCallback.pUserData = this;
vk::AddToPNextChain(&createInfo, &mMemoryReportCallback);
}
else
{
WARN() << "Disabling the following feature(s) because driver does not support "
"VK_EXT_device_memory_report extension:";
if (getFeatures().logMemoryReportStats.enabled)
{
WARN() << "\tlogMemoryReportStats";
ANGLE_FEATURE_CONDITION(&mFeatures, logMemoryReportStats, false);
}
if (getFeatures().logMemoryReportCallbacks.enabled)
{
WARN() << "\tlogMemoryReportCallbacks";
ANGLE_FEATURE_CONDITION(&mFeatures, logMemoryReportCallbacks, false);
}
}
} }
if (getFeatures().supportsExternalMemoryHost.enabled) if (getFeatures().supportsExternalMemoryHost.enabled)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment