From 8a2a22ff1b956c403442cf4f5bbe7aa4af722623 Mon Sep 17 00:00:00 2001 From: funman300 Date: Tue, 23 Jun 2026 18:14:20 -0700 Subject: [PATCH] fix(web): cap /play canvas at the real 2048 wgpu limit, not gl.MAX_TEXTURE_SIZE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correction to the previous canvas clamp (#97), which would NOT have fixed the crash. It capped the wrapper to the device's gl.MAX_TEXTURE_SIZE, but that's the hardware limit — on a 4K/integrated GPU it reports 8192+, so the wrapper was never actually capped and the 2560-wide surface still exceeded the limit. The real ceiling is wgpu's, not the hardware's: on wasm Bevy creates the device with Limits::downlevel_webgl2_defaults() (forced by WgpuSettingsPriority::WebGL2 in solitaire_web/src/lib.rs; see bevy_render-0.18.1 settings.rs), whose max_texture_dimension_2d is a fixed 2048 regardless of GPU. So the cap must be the constant 2048. (For the record: the reporter's display is 3840x2160 at 150% scale → a 2560x1440 logical viewport, which is the 2560 in the panic — nothing hardcodes 1440p.) Co-Authored-By: Claude Opus 4.8 (1M context) --- solitaire_server/web/play.html | 36 ++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/solitaire_server/web/play.html b/solitaire_server/web/play.html index 44bbb1c..ee7519d 100644 --- a/solitaire_server/web/play.html +++ b/solitaire_server/web/play.html @@ -23,26 +23,24 @@