Direct logging to Platform when available
All logging should be done via ERR() and WARN(),
which call angle::Platform's logError and logWarning,
if there is current Platform which supports logging.
Otherwise, ERR() is directed to std::cerr.
Misc fixes to keep tests passing.
BUG=angleproject:1660, angleproject:1644
Change-Id: I2bca33a021537185d0c236a3083789af3236b5f3
Reviewed-on: https://chromium-review.googlesource.com/434188
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp
index 2eaec18..e57514f 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -63,7 +63,7 @@
{
if ((flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0)
{
- ANGLEPlatformCurrent()->logError(message);
+ ERR() << message;
#if !defined(NDEBUG)
// Abort the call in Debug builds.
return VK_TRUE;
@@ -71,11 +71,12 @@
}
else if ((flags & VK_DEBUG_REPORT_WARNING_BIT_EXT) != 0)
{
- ANGLEPlatformCurrent()->logWarning(message);
+ WARN() << message;
}
else
{
- ANGLEPlatformCurrent()->logInfo(message);
+ // Uncomment this if you want Vulkan spam.
+ // WARN() << message;
}
return VK_FALSE;
@@ -162,7 +163,7 @@
const auto &cwd = angle::GetCWD();
if (!cwd.valid())
{
- ANGLEPlatformCurrent()->logError("Error getting CWD for Vulkan layers init.");
+ ERR() << "Error getting CWD for Vulkan layers init.";
mEnableValidationLayers = false;
}
else
@@ -202,12 +203,11 @@
// Generate an error if the attribute was requested, warning otherwise.
if (attribs.contains(EGL_PLATFORM_ANGLE_ENABLE_VALIDATION_LAYER_ANGLE))
{
- ANGLEPlatformCurrent()->logError("Vulkan standard validation layers are missing.");
+ ERR() << "Vulkan standard validation layers are missing.";
}
else
{
- ANGLEPlatformCurrent()->logWarning(
- "Vulkan standard validation layers are missing.");
+ WARN() << "Vulkan standard validation layers are missing.";
}
mEnableValidationLayers = false;
}
@@ -372,7 +372,7 @@
{
if (!HasStandardValidationLayer(deviceLayerProps))
{
- ANGLEPlatformCurrent()->logWarning("Vulkan standard validation layer is missing.");
+ WARN() << "Vulkan standard validation layer is missing.";
mEnableValidationLayers = false;
}
}