Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update quickstart-cmake.md #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions docs/quickstart-cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Now, create a `hello_webgpu.cpp` C++ file within the `TestDawn` directory.

```cpp
#include <webgpu/webgpu_cpp.h>
#include <webgpu/webgpu_cpp_print.h>

#include <cstdlib>
#include <iostream>
Expand All @@ -83,10 +82,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<wgpu::Adapter *>(userdata) = wgpu::Adapter::Acquire(adapter);
Expand All @@ -105,11 +104,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;
}
```
Expand Down
Loading