Bug fixes for VulkanImageWrappingTestsDmaBuf

VulkanImageWrappingTestsOpaqueFD already has the same fixes, but
sadly didn't get applied to VulkanImageWrappingTestsDmaBuf.
DawnTest::Setup() and TearDown() are missing so the device isn't
initialized.
The expected values in CopyTextureToBufferSrcSync are wrong.

Bug: dawn:1210
Change-Id: I3810a626d840573ab7c1fa75ba7ca239e7288c3e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71245
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
This commit is contained in:
jchen10 2021-11-30 12:40:59 +00:00 committed by Dawn LUCI CQ
parent 6e83e6284e
commit ba276a4f55
1 changed files with 7 additions and 2 deletions

View File

@ -40,6 +40,7 @@ namespace dawn_native { namespace vulkan {
public: public:
void SetUp() override { void SetUp() override {
DawnTest::SetUp();
DAWN_TEST_UNSUPPORTED_IF(UsesWire()); DAWN_TEST_UNSUPPORTED_IF(UsesWire());
gbmDevice = CreateGbmDevice(); gbmDevice = CreateGbmDevice();
@ -60,11 +61,15 @@ namespace dawn_native { namespace vulkan {
} }
void TearDown() override { void TearDown() override {
if (UsesWire()) if (UsesWire()) {
DawnTest::TearDown();
return; return;
}
gbm_bo_destroy(defaultGbmBo); gbm_bo_destroy(defaultGbmBo);
gbm_device_destroy(gbmDevice); gbm_device_destroy(gbmDevice);
DawnTest::TearDown();
} }
gbm_device* CreateGbmDevice() { gbm_device* CreateGbmDevice() {
@ -554,7 +559,7 @@ namespace dawn_native { namespace vulkan {
queue.Submit(1, &commands); queue.Submit(1, &commands);
// Verify |copyDstBuffer| sees changes from |secondDevice| // Verify |copyDstBuffer| sees changes from |secondDevice|
uint32_t expected = 1; uint32_t expected = 0x04030201;
EXPECT_BUFFER_U32_EQ(expected, copyDstBuffer, 0); EXPECT_BUFFER_U32_EQ(expected, copyDstBuffer, 0);
IgnoreSignalSemaphore(deviceWrappedTexture); IgnoreSignalSemaphore(deviceWrappedTexture);