pvr: csbgen: Generate enum-to-string functions for debugging
authorMatt Coster <matt.coster@imgtec.com>
Wed, 25 May 2022 12:30:55 +0000 (13:30 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 25 Nov 2022 16:42:55 +0000 (16:42 +0000)
commitd51d79b450d80a602f03a86d11bf8a9f544b5b4b
tree30835309079e21eeeffaecc43dd87688a114d207
parentf36c938c944cb9edb8e554c9695590a829b9d4f1
pvr: csbgen: Generate enum-to-string functions for debugging

All enums should be unambiguous, so an error is raised when multiple
enum variants with the same value are encountered. When no enum
variants match the provided value, NULL is returned. This allows the
to-string functions to double as validators.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>
src/imagination/csbgen/gen_pack_header.py
src/imagination/csbgen/pvr_packet_helpers.h
src/imagination/vulkan/pvr_csb.h