From 0b650b8eb4e179990bb21ede3beaf57715eea7d0 Mon Sep 17 00:00:00 2001 From: Ramnivas Indani Date: Sun, 1 Dec 2024 14:32:59 -0800 Subject: [PATCH 1/2] Update quickstart-cmake.md Update the functions with the new WGPUStringView usage. While compiling this hello_webgpu.cpp I encountered that some of the implementations has changed and now there is a new WGPUStringView class that is used. Updated the guide to use the new WGPUStringView --- docs/quickstart-cmake.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/quickstart-cmake.md b/docs/quickstart-cmake.md index 00881b2f7e5..05f910ba002 100644 --- a/docs/quickstart-cmake.md +++ b/docs/quickstart-cmake.md @@ -83,10 +83,10 @@ int main(int argc, char *argv[]) { callbackInfo.nextInChain = nullptr; callbackInfo.mode = wgpu::CallbackMode::WaitAnyOnly; callbackInfo.callback = [](WGPURequestAdapterStatus status, - WGPUAdapter adapter, const char *message, + WGPUAdapter adapter, WGPUStringView message, void *userdata) { if (status != WGPURequestAdapterStatus_Success) { - std::cerr << "Failed to get an adapter:" << message; + std::cerr << "Failed to get an adapter:" << message.data; return; } *static_cast(userdata) = wgpu::Adapter::Acquire(adapter); @@ -105,11 +105,11 @@ int main(int argc, char *argv[]) { adapter.GetInfo(&info); std::cout << "VendorID: " << std::hex << info.vendorID << std::dec << "\n"; - std::cout << "Vendor: " << info.vendor << "\n"; - std::cout << "Architecture: " << info.architecture << "\n"; + std::cout << "Vendor: " << info.vendor.data << "\n"; + std::cout << "Architecture: " << info.architecture.data << "\n"; std::cout << "DeviceID: " << std::hex << info.deviceID << std::dec << "\n"; - std::cout << "Name: " << info.device << "\n"; - std::cout << "Driver description: " << info.description << "\n"; + std::cout << "Name: " << info.device.data << "\n"; + std::cout << "Driver description: " << info.description.data << "\n"; return EXIT_SUCCESS; } ``` From 6ab7e768169b5ff055570435fd26a1fb50c8cadc Mon Sep 17 00:00:00 2001 From: Ramnivas Indani Date: Thu, 5 Dec 2024 20:51:03 -0800 Subject: [PATCH 2/2] Update quickstart-cmake.md Updated to remove the unused header file --- docs/quickstart-cmake.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/quickstart-cmake.md b/docs/quickstart-cmake.md index 05f910ba002..96d39b90da9 100644 --- a/docs/quickstart-cmake.md +++ b/docs/quickstart-cmake.md @@ -63,7 +63,6 @@ Now, create a `hello_webgpu.cpp` C++ file within the `TestDawn` directory. ```cpp #include -#include #include #include