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
I found the create_shader_module_unchecked method and I wonder, can I use this eliminate runtime checks? How significant is this?
I could write something like:
let shader = ifcfg!(debug_assertions){
device.create_shader_module(desc)}else{// Safety: I assume that all shaders are written correctlyunsafe{ device.create_shader_module_unchecked(desc)}};
But a few questions remain: What exactly is the unsafety if it's running on GPU, can I just get the wrong result, or can it potentially break something, for example overwrite some neighboring texture? Or can undefined behavior somehow spread to Rust code?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I found the
create_shader_module_unchecked
method and I wonder, can I use this eliminate runtime checks? How significant is this?I could write something like:
But a few questions remain: What exactly is the unsafety if it's running on GPU, can I just get the wrong result, or can it potentially break something, for example overwrite some neighboring texture? Or can undefined behavior somehow spread to Rust code?
Beta Was this translation helpful? Give feedback.
All reactions