Skip to content

Commit

Permalink
Merge pull request #59 from Trikzon/main
Browse files Browse the repository at this point in the history
Fix wgpuGetLimits on Dawn in adapter and device chapters
  • Loading branch information
eliemichel committed Jun 19, 2024
2 parents c6cf241 + 0b9d86e commit c2c43a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions getting-started/adapter-and-device/the-adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ We can first list the limits that our adapter supports with `wgpuAdapterGetLimit
#ifndef __EMSCRIPTEN__
WGPUSupportedLimits supportedLimits = {};
supportedLimits.nextInChain = nullptr;
#ifdef WEBGPU_BACKEND_DAWN
bool success = wgpuAdapterGetLimits(adapter, &supportedLimits) == WGPUStatus_Success;
#else
bool success = wgpuAdapterGetLimits(adapter, &supportedLimits);
#endif
if (success) {
std::cout << "Adapter limits:" << std::endl;
std::cout << " - maxTextureDimension1D: " << supportedLimits.limits.maxTextureDimension1D << std::endl;
Expand Down
4 changes: 4 additions & 0 deletions getting-started/adapter-and-device/the-device.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ void inspectDevice(WGPUDevice device) {
WGPUSupportedLimits limits = {};
limits.nextInChain = nullptr;
#ifdef WEBGPU_BACKEND_DAWN
bool success = wgpuDeviceGetLimits(device, &limits) == WGPUStatus_Success;
#else
bool success = wgpuDeviceGetLimits(device, &limits);
#endif
if (success) {
std::cout << "Device limits:" << std::endl;
std::cout << " - maxTextureDimension1D: " << limits.limits.maxTextureDimension1D << std::endl;
Expand Down

0 comments on commit c2c43a3

Please sign in to comment.