gfx-rs / wgpu-native

Native WebGPU implementation based on wgpu-core
Apache License 2.0
865 stars 103 forks source link

wgpuAdapterRequestDevice() called without `requiredLimits` fails in simulated Android device #388

Open Killavus opened 4 months ago

Killavus commented 4 months ago

Environment:

wgpu-native version: 0.19.4.1 (commit d89e5a9) Host device: 14-Inch MacBook Pro M1 Host operating system: macOS Sonoma (14.4.1 (23E224)) Emulated device: Pixel 6 API 32 (Android 12L arm64-v8a, "Graphics" set to "Automatic")

Details:

When trying to call wgpuAdapterRequestDevice() without requiredLimits being set (passed NULL), device is not instantiated and fails with following validation error:

Validation Error

Caused by:
  Limit 'max_inter_stage_shader_components' value 31 is better than allowed 0

Adapter correctly reports max_inter_stage_shader_components to be 0 when queried using wgpuAdapterGetLimits. It seems that logic of determining limits in the case of max_inter_stage_shader_components defaults to wgpu::Limits::downlevel_webgl2_defaults() instead of populating it with adapter's limits.

Is it something expected to be happening? This is happening only on macOS with this device. I've been testing on Windows machine and there calling wgpuAdapterRequestDevice is returning a proper device without specifying requiredLimits.