[Mesa-dev] [PATCH 0/9] spirv: Improve logging and error handling

Tapani Pälli tapani.palli at intel.com
Tue Aug 29 10:55:27 UTC 2017


LGTM, patches 1-5

Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

With these changes we can add a nir_spirv_debug_callback that has 
instance and shader object in private data so that we can call 
VK_EXT_debug_report functionality from anv_pipeline code.


On 08/17/2017 08:22 PM, Jason Ekstrand wrote:
> This series has two objectives:
> 
>   1) Improve logging to provide more detail and provide hooks so we can
>      plumb errors and warnings through to debug_report extensions.
> 
>   2) Improve error handling so that not all errors result in killing the
>      process.  This is done by adding new spv_fail and spv_assert helpers
>      which log the error and longjump back to a point where we can clean up
>      and return NULL without crashing.
> 
> There is still quite a ways to go with error handling if we want to be able
> to guarantee that we won't crash given an arbitrary stream of bytes.
> However, this should at least be a step in the right direction.  There are
> probably at least a couple of cases where I could have left an assert() as
> an actual "kill the process" assert because it's testing for internal
> consistency.  However, the vast majority of them are validation checks so
> it seemed better to just search+replace them all and we can convert the few
> that we want back to real asserts later.
> 
> Cc: "Ian Romanick" <idr at freedesktop.org>
> 
> Jason Ekstrand (9):
>    ralloc: Allow reparenting to a NULL context
>    spirv: Parent the nir_shader to the builder while building
>    spirv: Re-arrange vtn_builder initialization
>    spirv: Rework logging
>    spirv: Do something useful with OpSource
>    util: Add a NORETURN macro
>    spirv: Add vtn_fail and vtn_assert helpers
>    spirv: Replace assert with vtn_assert
>    spirv: Replace unreachable with vtn_fail
> 
>   configure.ac                       |   1 +
>   src/amd/vulkan/radv_pipeline.c     |   2 +-
>   src/compiler/spirv/nir_spirv.h     |  17 +-
>   src/compiler/spirv/spirv2nir.c     |   3 +-
>   src/compiler/spirv/spirv_to_nir.c  | 496 +++++++++++++++++++++++--------------
>   src/compiler/spirv/vtn_alu.c       |  46 ++--
>   src/compiler/spirv/vtn_cfg.c       |  59 ++---
>   src/compiler/spirv/vtn_glsl450.c   |  18 +-
>   src/compiler/spirv/vtn_private.h   |  56 ++++-
>   src/compiler/spirv/vtn_variables.c | 253 +++++++++----------
>   src/intel/vulkan/anv_pipeline.c    |   2 +-
>   src/util/macros.h                  |   6 +
>   src/util/ralloc.c                  |   2 +-
>   13 files changed, 578 insertions(+), 383 deletions(-)
> 


More information about the mesa-dev mailing list