diff options
author | Jason Ekstrand <[email protected]> | 2017-08-16 16:04:08 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-12-04 09:21:09 -0800 |
commit | 16dfdeefc8469c9bb8770bab763fd943b62f875d (patch) | |
tree | c25774a8a13baf150dc0686df1c6c1bf11a8e7e8 /src/compiler/spirv/nir_spirv.h | |
parent | 11bd753c4ece5eafa6fc7c416d25f60371758e1b (diff) |
spirv: Rework logging
This commit reworks the way that logging works in SPIR-V to provide
richer and more detailed logging infrastructure. This commit contains
several improvements over the old mechanism:
1) Log messages are now more detailed. They contain the SPIR-V byte
offset as well as source language information from OpSource and
OpLine.
2) There is now a logging callback mechanism so that errors can get
propagated to the client through debug callbak extensions.
Reviewed-by: Tapani Pälli <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler/spirv/nir_spirv.h')
-rw-r--r-- | src/compiler/spirv/nir_spirv.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h index 234b0ce3444..f129a205764 100644 --- a/src/compiler/spirv/nir_spirv.h +++ b/src/compiler/spirv/nir_spirv.h @@ -42,6 +42,12 @@ struct nir_spirv_specialization { }; }; +enum nir_spirv_debug_level { + NIR_SPIRV_DEBUG_LEVEL_INFO, + NIR_SPIRV_DEBUG_LEVEL_WARNING, + NIR_SPIRV_DEBUG_LEVEL_ERROR, +}; + struct spirv_to_nir_options { struct { bool float64; @@ -54,6 +60,14 @@ struct spirv_to_nir_options { bool multiview; bool variable_pointers; } caps; + + struct { + void (*func)(void *private_data, + enum nir_spirv_debug_level level, + size_t spirv_offset, + const char *message); + void *private_data; + } debug; }; nir_function *spirv_to_nir(const uint32_t *words, size_t word_count, |