anv/entrypoints: Generalize the string map a bit
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 20 Sep 2017 15:25:05 +0000 (08:25 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 7 Mar 2018 20:13:47 +0000 (12:13 -0800)
commita4ca4c99ba8d594a58c862503b0f9f52c0e6e4b7
tree1696057b3363f6f3963044c3053ca93c3ab40d8d
parent3960d0e3329657202abaf2ffd4f4dc32b63c58b0
anv/entrypoints: Generalize the string map a bit

The original string map assumed that the mapping from strings to
entrypoints was a bijection.  This will not be true the moment we
add entrypoint aliasing.  This reworks things to be an arbitrary map
from strings to non-negative signed integers.  The old one also had a
potential bug if we ever had a hash collision because it didn't do the
strcmp inside the lookup loop.  While we're at it, we break things out
into a helpful class.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/intel/vulkan/anv_entrypoints_gen.py