mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 15:46:28 +00:00
end2end_tests: Forward Windows debug messages to stderr
When validation layers are enabled, D3D12 warnings and error messages are logged to the shared DBWIN_BUFFER segment of memory. This CL has makes the test environment watch for new events and logs them to stderr so they show up in the test bot logs. This helps debug problems in the D3D12 backend which previously just crashed with a general Device Lost message. Bug: none Change-Id: I0eaddf9e16303bd65579e85fe6693bd8cdfbd8da Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26640 Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
24b5971b84
commit
f580096468
@@ -24,6 +24,7 @@
|
||||
#include "dawn_native/DawnNative.h"
|
||||
#include "dawn_wire/WireClient.h"
|
||||
#include "dawn_wire/WireServer.h"
|
||||
#include "utils/PlatformDebugLogger.h"
|
||||
#include "utils/SystemUtils.h"
|
||||
#include "utils/TerribleCommandBuffer.h"
|
||||
#include "utils/WGPUHelpers.h"
|
||||
@@ -35,7 +36,7 @@
|
||||
#include <sstream>
|
||||
#include <unordered_map>
|
||||
|
||||
#ifdef DAWN_ENABLE_BACKEND_OPENGL
|
||||
#if defined(DAWN_ENABLE_BACKEND_OPENGL)
|
||||
# include "GLFW/glfw3.h"
|
||||
# include "dawn_native/OpenGLBackend.h"
|
||||
#endif // DAWN_ENABLE_BACKEND_OPENGL
|
||||
@@ -81,7 +82,7 @@ namespace {
|
||||
|
||||
DawnTestEnvironment* gTestEnv = nullptr;
|
||||
|
||||
} // namespace
|
||||
} // anonymous namespace
|
||||
|
||||
const RGBA8 RGBA8::kZero = RGBA8(0, 0, 0, 0);
|
||||
const RGBA8 RGBA8::kBlack = RGBA8(0, 0, 0, 255);
|
||||
@@ -186,6 +187,11 @@ void DawnTestEnvironment::SetEnvironment(DawnTestEnvironment* env) {
|
||||
DawnTestEnvironment::DawnTestEnvironment(int argc, char** argv) {
|
||||
ParseArgs(argc, argv);
|
||||
|
||||
if (mEnableBackendValidation) {
|
||||
mPlatformDebugLogger =
|
||||
std::unique_ptr<utils::PlatformDebugLogger>(utils::CreatePlatformDebugLogger());
|
||||
}
|
||||
|
||||
// Create a temporary instance to select available and preferred adapters. This is done before
|
||||
// test instantiation so GetAvailableAdapterTestParamsForBackends can generate test
|
||||
// parameterizations all selected adapters. We drop the instance at the end of this function
|
||||
@@ -199,6 +205,8 @@ DawnTestEnvironment::DawnTestEnvironment(int argc, char** argv) {
|
||||
PrintTestConfigurationAndAdapterInfo();
|
||||
}
|
||||
|
||||
DawnTestEnvironment::~DawnTestEnvironment() = default;
|
||||
|
||||
void DawnTestEnvironment::ParseArgs(int argc, char** argv) {
|
||||
size_t argLen = 0; // Set when parsing --arg=X arguments
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
|
||||
@@ -155,6 +155,7 @@ BackendTestConfig VulkanBackend(std::initializer_list<const char*> forceEnabledW
|
||||
std::initializer_list<const char*> forceDisabledWorkarounds = {});
|
||||
|
||||
namespace utils {
|
||||
class PlatformDebugLogger;
|
||||
class TerribleCommandBuffer;
|
||||
} // namespace utils
|
||||
|
||||
@@ -176,7 +177,7 @@ void InitDawnEnd2EndTestEnvironment(int argc, char** argv);
|
||||
class DawnTestEnvironment : public testing::Environment {
|
||||
public:
|
||||
DawnTestEnvironment(int argc, char** argv);
|
||||
~DawnTestEnvironment() override = default;
|
||||
~DawnTestEnvironment() override;
|
||||
|
||||
static void SetEnvironment(DawnTestEnvironment* env);
|
||||
|
||||
@@ -219,6 +220,8 @@ class DawnTestEnvironment : public testing::Environment {
|
||||
std::string mWireTraceDir;
|
||||
std::vector<dawn_native::DeviceType> mDevicePreferences;
|
||||
std::vector<TestAdapterProperties> mAdapterProperties;
|
||||
|
||||
std::unique_ptr<utils::PlatformDebugLogger> mPlatformDebugLogger;
|
||||
};
|
||||
|
||||
class DawnTestBase {
|
||||
|
||||
Reference in New Issue
Block a user