[WebGPU] Implement hardware limits
Created attachment 457684 [details] Patch
Created attachment 457686 [details] Patch
Created attachment 457720 [details] Patch
Created attachment 457722 [details] Patch
Comment on attachment 457722 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457722&action=review > Source/WebGPU/WebGPU/Adapter.h:45 > + static Ref<Adapter> create(id<MTLDevice> device, Instance& instance, WGPULimits&& limits) There is no benefit to passing a structure full of scalars with an rvalue reference and calling WTFMove. Just const& is fine for this kind of object, unless this is generic code where it might be something with non-scalars in it, or if we think we’ll be evolving it some day. > Source/WebGPU/WebGPU/HardwareLimits.mm:41 > +static WGPULimits apple3() constexpr > Source/WebGPU/WebGPU/HardwareLimits.mm:75 > +static WGPULimits apple4() constexpr > Source/WebGPU/WebGPU/HardwareLimits.mm:109 > +static WGPULimits apple5() constexpr > Source/WebGPU/WebGPU/HardwareLimits.mm:144 > +static WGPULimits apple6() constexpr > Source/WebGPU/WebGPU/HardwareLimits.mm:178 > +static WGPULimits apple7() constexpr > Source/WebGPU/WebGPU/HardwareLimits.mm:338 > +static bool checkLimits(const WGPULimits& limits) This could be constexpr > Source/WebGPU/WebGPU/HardwareLimits.mm:386 > +bool isValid(const WGPULimits& limits) This could be constexpr > Source/WebGPU/WebGPU/HardwareLimits.mm:391 > +bool anyLimitIsBetterThan(const WGPULimits& target, const WGPULimits& reference) This could be constexpr
Committed r292940 (249705@trunk): <https://commits.webkit.org/249705@trunk>
<rdar://problem/91842461>
This patch broke builds: https://build.webkit.org/#/builders/12/builds/11560 /Volumes/Data/worker/bigsur-debug/build/Source/WebGPU/WebGPU/HardwareLimits.mm:338:23: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
(In reply to Ryosuke Niwa from comment #8) > This patch broke builds: > https://build.webkit.org/#/builders/12/builds/11560 > > /Volumes/Data/worker/bigsur-debug/build/Source/WebGPU/WebGPU/HardwareLimits. > mm:338:23: error: constexpr function never produces a constant expression > [-Winvalid-constexpr] Trying to reproduce now
(In reply to Myles C. Maxfield from comment #9) > (In reply to Ryosuke Niwa from comment #8) > > This patch broke builds: > > https://build.webkit.org/#/builders/12/builds/11560 > > > > /Volumes/Data/worker/bigsur-debug/build/Source/WebGPU/WebGPU/HardwareLimits. > > mm:338:23: error: constexpr function never produces a constant expression > > [-Winvalid-constexpr] > > Trying to reproduce now I can't reproduce this (possibly because I have a different SDK installed than the one bot uses), but I can see by inspection that the error is correct - that function is marked as constexpr but will never produce a constant expression. I'll commit a prospective fix.
(In reply to Myles C. Maxfield from comment #10) > (In reply to Myles C. Maxfield from comment #9) > > (In reply to Ryosuke Niwa from comment #8) > > > This patch broke builds: > > > https://build.webkit.org/#/builders/12/builds/11560 > > > > > > /Volumes/Data/worker/bigsur-debug/build/Source/WebGPU/WebGPU/HardwareLimits. > > > mm:338:23: error: constexpr function never produces a constant expression > > > [-Winvalid-constexpr] > > > > Trying to reproduce now > > I can't reproduce this (possibly because I have a different SDK installed > than the one bot uses), but I can see by inspection that the error is > correct - that function is marked as constexpr but will never produce a > constant expression. I'll commit a prospective fix. https://commits.webkit.org/r292941