mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
Make dawn_wire use the webgpu.h header
BUG=dawn:22 Change-Id: I4963aa27322086e74947a1a6265c921e2c7d3d85 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12700 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
15e751e418
commit
1fdcb16b69
@@ -17,20 +17,20 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
class WireDawnDevicePropertiesTests : public testing::Test {};
|
||||
class WireWGPUDevicePropertiesTests : public testing::Test {};
|
||||
|
||||
// Test that the serialization and deserialization of DawnDeviceProperties can work correctly.
|
||||
TEST_F(WireDawnDevicePropertiesTests, SerializeDawnDeviceProperties) {
|
||||
DawnDeviceProperties sentDawnDeviceProperties;
|
||||
sentDawnDeviceProperties.textureCompressionBC = true;
|
||||
// Test that the serialization and deserialization of WGPUDeviceProperties can work correctly.
|
||||
TEST_F(WireWGPUDevicePropertiesTests, SerializeWGPUDeviceProperties) {
|
||||
WGPUDeviceProperties sentWGPUDeviceProperties;
|
||||
sentWGPUDeviceProperties.textureCompressionBC = true;
|
||||
|
||||
size_t sentDawnDevicePropertiesSize =
|
||||
dawn_wire::SerializedWGPUDevicePropertiesSize(&sentDawnDeviceProperties);
|
||||
size_t sentWGPUDevicePropertiesSize =
|
||||
dawn_wire::SerializedWGPUDevicePropertiesSize(&sentWGPUDeviceProperties);
|
||||
std::vector<char> buffer;
|
||||
buffer.resize(sentDawnDevicePropertiesSize);
|
||||
dawn_wire::SerializeWGPUDeviceProperties(&sentDawnDeviceProperties, buffer.data());
|
||||
buffer.resize(sentWGPUDevicePropertiesSize);
|
||||
dawn_wire::SerializeWGPUDeviceProperties(&sentWGPUDeviceProperties, buffer.data());
|
||||
|
||||
DawnDeviceProperties receivedDawnDeviceProperties;
|
||||
dawn_wire::DeserializeWGPUDeviceProperties(&receivedDawnDeviceProperties, buffer.data());
|
||||
ASSERT_TRUE(receivedDawnDeviceProperties.textureCompressionBC);
|
||||
WGPUDeviceProperties receivedWGPUDeviceProperties;
|
||||
dawn_wire::DeserializeWGPUDeviceProperties(&receivedWGPUDeviceProperties, buffer.data());
|
||||
ASSERT_TRUE(receivedWGPUDeviceProperties.textureCompressionBC);
|
||||
}
|
||||
Reference in New Issue
Block a user