Skip to content
  • Faith Ekstrand's avatar
    spirv: Add vtn_fail and vtn_assert helpers · 94ca8e04
    Faith Ekstrand authored
    
    
    These helpers are much nicer than just using assert because they don't
    kill your process.  Instead, it longjmps back to spirv_to_nir(), cleans
    up all the temporary memory, and nicely returns NULL.  While crashing is
    completely OK in the Vulkan world, it's not considered to be quite so
    nice in GL.  This should help us to make SPIR-V parsing much more
    robust.  The one downside here is that vtn_assert is not compiled out in
    release builds like assert() is so it isn't free.
    
    Reviewed-by: default avatarTapani Pälli <tapani.palli@intel.com>
    Reviewed-by: default avatarIan Romanick <idr@freedesktop.org>
    94ca8e04