From e1f16a25bfe501249676351ddfba1d53d793162e Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 18 Jul 2017 10:31:50 -0400 Subject: [PATCH] NXTTest: add other Is methods --- src/tests/NXTTest.cpp | 12 ++++++++++++ src/tests/NXTTest.h | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/tests/NXTTest.cpp b/src/tests/NXTTest.cpp index aba3ec41b4..b65605b2c1 100644 --- a/src/tests/NXTTest.cpp +++ b/src/tests/NXTTest.cpp @@ -108,6 +108,18 @@ bool NXTTest::IsD3D12() const { return GetParam() == D3D12Backend; } +bool NXTTest::IsMetal() const { + return GetParam() == MetalBackend; +} + +bool NXTTest::IsOpenGL() const { + return GetParam() == OpenGLBackend; +} + +bool NXTTest::IsVulkan() const { + return GetParam() == VulkanBackend; +} + void NXTTest::SetUp() { binding = utils::CreateBinding(ParamToBackendType(GetParam())); NXT_ASSERT(binding != nullptr); diff --git a/src/tests/NXTTest.h b/src/tests/NXTTest.h index f372d2eaac..b3fc0241ca 100644 --- a/src/tests/NXTTest.h +++ b/src/tests/NXTTest.h @@ -18,7 +18,7 @@ // Getting data back from NXT is done in an async manners so all expectations are "deferred" // until the end of the test. Also expectations use a copy to a MapRead buffer to get the data -// so resources should have the TransferDst allowed usage bit if you want to add expectations on them. +// so resources should have the TransferSrc allowed usage bit if you want to add expectations on them. #define EXPECT_BUFFER_U32_EQ(expected, buffer, offset) \ AddBufferExpectation(__FILE__, __LINE__, buffer, offset, sizeof(uint32_t), new detail::ExpectEq(expected)); @@ -65,6 +65,9 @@ class NXTTest : public ::testing::TestWithParam { void TearDown() override; bool IsD3D12() const; + bool IsMetal() const; + bool IsOpenGL() const; + bool IsVulkan() const; protected: nxt::Device device;