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

Cannot set maxColorAttachmentBytesPerSample when requesting device #15

Open
pkomon-tgm opened this issue Apr 22, 2024 · 1 comment
Open
Assignees
Labels
upstream An issue with a framework/library in use

Comments

@pkomon-tgm
Copy link

Setting maxColorAttachmentBytesPerSample as required limit when requesting device has no effect. Devices always have the default limit of 32.

This is caused by a bug in emscripten. When requesting the webGPU device, the fields of the C struct requiredLimits are copied into a javascript object, but the field maxColorAttachmentBytesPerSample is missing.

See emscripten-core/emscripten#21798.

@GeraldKimmersdorfer GeraldKimmersdorfer added the upstream An issue with a framework/library in use label May 2, 2024
@pkomon-tgm
Copy link
Author

This has been fixed with PR emscripten-core/emscripten#21799 and is already merged to main 🥳

We should keep this issue around until it makes it into the next release. Then we can remove applying the patch manually from our setup instructions in the README.

Additionally, we get rid of the two code paths here, as that PR also implemented wgpuAdapterGetLimits for emscripten.

// wgpuAdapterGetLimits is not supported in Chrome yet
#ifndef __EMSCRIPTEN__
WGPUSupportedLimits supported_limits {};
wgpuAdapterGetLimits(m_adapter, &supported_limits);
required_limits.limits.maxTextureArrayLayers = supported_limits.limits.maxTextureArrayLayers;
#else
// use 256 as it is supported on all devices according to https://web3dsurvey.com/webgpu/limits/maxTextureArrayLayers
required_limits.limits.maxTextureArrayLayers = 256;
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream An issue with a framework/library in use
Projects
None yet
Development

No branches or pull requests

2 participants