mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
ValidationTest: Make custom device creation go through a virtual method
Previously tests that needed to use a device that wasn't the default device created a new one via a method that only supported customizing extensions. Instead of adding a second function the device creation is made completely customizable by querying the test's device via a overridable method. This heavily refactors the QuerySet tests to use the new methods (previously they were using 3 different devices in the same fixture) but loses a little bit of coverage of what happens when some query operations are done with mixed devices. This is required for a follow-up CL that adds tests for a device created with the "disallow_unsafe_api" toggle that needs to be set on device creation. Bug: chromium:1138528 Change-Id: Ic2f5d876adca251b34ea594f70f344ac7669910e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31442 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
71d2e1d23d
commit
43ef0a365b
@@ -50,12 +50,9 @@
|
||||
|
||||
class ValidationTest : public testing::Test {
|
||||
public:
|
||||
ValidationTest();
|
||||
~ValidationTest() override;
|
||||
|
||||
wgpu::Device CreateDeviceFromAdapter(dawn_native::Adapter adapter,
|
||||
const std::vector<const char*>& requiredExtensions);
|
||||
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
|
||||
void StartExpectDeviceError();
|
||||
@@ -81,6 +78,8 @@ class ValidationTest : public testing::Test {
|
||||
bool HasWGSL() const;
|
||||
|
||||
protected:
|
||||
virtual wgpu::Device CreateTestDevice();
|
||||
|
||||
wgpu::Device device;
|
||||
dawn_native::Adapter adapter;
|
||||
std::unique_ptr<dawn_native::Instance> instance;
|
||||
|
||||
Reference in New Issue
Block a user