gfx-rs / wgpu-native

Native WebGPU implementation based on wgpu-core
Apache License 2.0
843 stars 96 forks source link

hello_windows example - Maximum Supported Texture Size - Ultra Wide Screen Support #381

Closed MichealReed closed 4 months ago

MichealReed commented 4 months ago
thread 'main' panicked at wgpu\src\backend\wgpu_core.rs:751:18:
Error in Surface::configure: Validation Error

Caused by:
    `Surface` width and height must be within the maximum supported texture size. Requested was (3824, 1020), maximum extent for either dimension is 2048.

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

When attempting to run the example with a super ultra-wide monitor, I receive the error. I found this issue with a list of the texture size limits per platform

https://github.com/gpuweb/gpuweb/issues/1327

and do not see any reason this error should occur unless a 3D texture is being used for the surface.

Could the limits be mapped incorrectly? Is this an issue with the bindings or wgpu?

radgeRayden commented 4 months ago

We just pushed code that touches this, could you retest?

MichealReed commented 4 months ago

With a clean build

Caused by:
    `Surface` width and height must be within the maximum supported texture size. Requested was (3824, 984), maximum extent for either dimension is 2048.

Seems the Y value did change but the error persists.

rajveermalviya commented 4 months ago

Hey, @MichealReed seems like this issue was meant for wgpu and not wgpu-native, as the hello_windows example is part of wgpu not wgpu-native. Can you please confirm this?

Also the cause for that is because downlevel_limits are used as required device limits in that example, and max_texture_dimension_2d in downlevel is 2048. A simple fix would be to override them with adapter texture resolution limits.

MichealReed commented 4 months ago

Hey, @MichealReed seems like this issue was meant for wgpu and not wgpu-native, as the hello_windows example is part of wgpu not wgpu-native. Can you please confirm this?

Also the cause for that is because downlevel_limits are used as required device limits in that example, and max_texture_dimension_2d in downlevel is 2048. A simple fix would be to override them with adapter texture resolution limits.

That makes sense and the workaround is appreciated. Will open an issue with https://github.com/gfx-rs/wgpu given that 2048 is quite low and likely should be raised to 4k or 8k.