You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In pygfx we generate wgsl shaders with a form of templating. One of the shaders we generate has a fragment function that ends with an unconditional discard:
This used to work, but with the latest version of wgpu-native (v0.11.0.1, 19 dec, using Naga 8ffd6ba), this produces an error on MacOS:
thread '<unnamed>' panicked at 'Internal { stage: VERTEX, error: "Metal: program_source:149:1: error: control reaches end of non-void fragment function\n}\n^\n" }', src/device.rs:643:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
I was able to fix this by changing our wgsl shader to the following. It was necessary to both make the discard conditional, and to have a return after it:
In pygfx we generate wgsl shaders with a form of templating. One of the shaders we generate has a fragment function that ends with an unconditional
discard
:This used to work, but with the latest version of wgpu-native (v0.11.0.1, 19 dec, using Naga 8ffd6ba), this produces an error on MacOS:
I was able to fix this by changing our wgsl shader to the following. It was necessary to both make the discard conditional, and to have a
return
after it:The produced error also showed the Metal shader. I put it last because it's quite long:
The text was updated successfully, but these errors were encountered: