fix(web): use adapter limits so /play renders at native res (no 2048 cap) #101

Merged
funman300 merged 1 commits from test/web-adapter-limits into master 2026-06-24 16:20:08 +00:00
Owner

Switches wgpu priority WebGL2 -> Functionality so the device adopts the adapters real limits (true max_texture_dimension ~16384 on the reporters 3080 Ti) instead of the hardcoded downlevel 2048. On the WebGL2 backend the adapter is still WebGL2-constrained for features/buffers (shaders stay GLES-compatible), and device creation requests exactly what the adapter offers so it can`t fail. Removes the resize_constraints + play.html caps.

Deploying for Rhys to test on the live site. lib.rs is wasm-feeding, so web-wasm-rebuild regenerates canvas_bg.wasm after merge, then docker-build redeploys (~20-30 min).

Switches wgpu priority WebGL2 -> Functionality so the device adopts the adapter`s real limits (true max_texture_dimension ~16384 on the reporter`s 3080 Ti) instead of the hardcoded downlevel 2048. On the WebGL2 backend the adapter is still WebGL2-constrained for features/buffers (shaders stay GLES-compatible), and device creation requests exactly what the adapter offers so it can`t fail. Removes the resize_constraints + play.html caps. Deploying for Rhys to test on the live site. lib.rs is wasm-feeding, so web-wasm-rebuild regenerates canvas_bg.wasm after merge, then docker-build redeploys (~20-30 min).
funman300 added 1 commit 2026-06-24 16:20:07 +00:00
The 2048 surface limit was never wgpu's or the GPU's — it's
downlevel_webgl2_defaults().max_texture_dimension_2d (2048), which
WgpuSettingsPriority::WebGL2 forces. Switch to Functionality: on the WebGL2
(Gl) backend Bevy then adopts the adapter's real limits, which are still
WebGL2-constrained for features/buffers (shaders stay GLES-compatible) but
report the GPU's true max texture dimension (e.g. 16384). The device is
requested with exactly what the adapter offers, so creation can't fail, the
surface is no longer capped, and large viewports (4K) render with no letterbox
and no hardcoded cap.

Removes the resize_constraints cap and the play.html max-width/height caps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
funman300 merged commit 1602f1952d into master 2026-06-24 16:20:08 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#101