gfx-rs/wgpu

Automatically select minimum limits for a specific platform

Ciubix8513 opened this issue · 2 comments

Currently requesting a device with default DeviceDescriptor does not work on all platforms.

It does NOT work on webgl, because webgl does not support compute shaders or storage buffers.

It would be nice if the default DeviceDescriptor could automatically set the limits for webgl and other similar cases that may exist

Wumpf commented

I understand why that would be move convenient, but with wgpu being a WebGPU (with benefits) abstraction first I think it makes a lot of sense that any backend that is not fully compilant with WebGPU is opt-in.
If the DeviceDescriptor would use the downlevel webgl features it would mean that by default you get a device that doesn't work with WebGPU limits which is much more confusing for what I regard as the much more common usecase.
The rationale for the different defaults that you can pick from (!) for Limits is further detailed here: the "true default" (Default::default) is defined as the WebGPU guaranteed set of features.

Additionally, the WebGL limits for texture size are so low (2k), that it's very common to crash when creating a surface because people have 1440p/4k monitors regularly. The only way to really use downlevel_defaults_webgl2 is with .with_resolution(adapter.limits()) so that the texture size limits are actually large enough.