Safari WebGPU: StandardMaterial fragment shaders fail to compile ('texture_2d<f32>' cannot be used as the type of a 'let')
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust, wasm
- Ambito
- computer-graphics
Direzione di ricerca
Read crates/bevy_pbr/src/render/pbr_fragment.wesl, pbr_prepass.wesl, and pbr_prepass_functions.wesl, looking for texture or sampler values assigned with let. The issue describes verifying the fix by compiling every shader module the app creates in Safari 26.6; done means those modules compile without the reported error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bevy version
0.20.0 (also on main as of 2026-10-30: crates/bevy_pbr/src/render/pbr_fragment.wesl).
What you did
Ran a 3D app with StandardMaterial on the webgpu backend (wasm32) in Safari 26.6 (macOS) and Safari on iOS 26.
What went wrong
Pipeline creation fails with Fragment module is invalid, the default RenderErrorHandler quits the app, and the canvas stays black. GPUShaderModule.getCompilationInfo() in Safari gives:
error 682:9 'texture_2d<f32>' cannot be used as the type of a 'let'
> let texture = _1bevy_pbr_render__1pbr_bindings__2base_color_texture;
Since the move to WESL the PBR shaders reach the browser with lines like these from pbr_fragment.wesl, pbr_prepass.wesl and pbr_prepass_functions.wesl:
@if(BINDLESS)
let texture = bindless_textures_2d[material_indices[slot].base_color_texture];
@else
let texture = pbr_bindings::base_color_texture;
@if(BINDLESS)
let sampler_ = bindless_samplers_filtering[material_indices[slot].base_color_sampler];
@else
let sampler_ = pbr_bindings::base_color_sampler;
WGSL doesn't allow a texture or sampler in a let (the type of a let-declaration must be constructible or a pointer). Tint (Chrome) and naga accept it; WebKit's compiler enforces the rule. Every site of this kind in those three files has the same problem (base colour, specular, specular tint, emissive, metallic-roughness, clearcoat, clearcoat roughness, specular/diffuse transmission, thickness, occlusion, normal map, clearcoat normal, anisotropy).
Fix
Name the texture and sampler directly in the textureSample* call, one statement per BINDLESS case. A patch against 0.20.0 that does this for all three files, checked by compiling every module the app creates in Safari 26.6 (all pass, none before): https://github.com/bcanfield/bevy/commit/e909449efc07d4d47d8b20e4f3c026439b058d74
- Lingua principale
- Rust
- Stelle
- 49.7k
- Fork
- 5k
- Merge medio
- 3g 19h
- PR unite (30g)
- 134
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bevyengine/bevy
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bevyengine/bevy#26536 ·
I maintainer di solito rispondono entro 2 giorni
-
Placeholder has no defaultForse già presa Una pull request collegata a questa issue è aperta o già unita. ApertaC-Feature S-Needs-Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
bevyengine/bevy#26532 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
C-Feature S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bevyengine/bevy#26500 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
C-Feature S-Needs-Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
bevyengine/bevy#26499 ·
I maintainer di solito rispondono entro 2 giorni
-
`compute_histogram` in auto exposure writes past the end of the 64-bin histogramForse già presa @dev-matru l’ha presa 3 giorni fa. ApertaA-Rendering C-Bug D-Straightforward S-Ready-For-Implementation X-Uncontroversial
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
bevyengine/bevy#26479 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di bevyengine/bevy
Issue simili
-
bug UI
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
wardian-app/Wardian#1746 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
jlcodes99/cockpit-tools#3125 ·
I maintainer di solito rispondono entro 2 giorni
-
bug user-sprint
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Vondor/KassenSturz#967 ·
I maintainer di solito rispondono entro 1 giorno
-
area/ci
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Incremental sync warns "no stored highest_uid" on every round for folders with no new mailApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
rustmailer/bichon#411 ·