anv/entrypoints: Rework #if guards
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 10 Jun 2016 19:42:52 +0000 (12:42 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 10 Jun 2016 20:21:07 +0000 (13:21 -0700)
commit8d37556ec9d7fbbffc5497388a52998ae4fe75de
tree66915123a3c8ba3be16b550d8268588cb17d3bae
parent9ed0d9dd06414b30d28d7d1301a980784e22d8d6
anv/entrypoints: Rework #if guards

This reworks the #if guards a bit.  When Emil originally wrote them, he
just guarded everything.  However, part of what anv_entrypoints_gen.py
generates is a hash table for looking up entrypoints based on their name.
This table *cannot* get out of sync between C and python regardless of
preprocessor flags.  In order to prevent this, this commit makes us use
void pointers in the dispatch table for those entrypoints which aren't
available.  This means that the dispatch table size and entry order is
constant and it should never get out-of-sync with the python.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/intel/vulkan/anv_entrypoints_gen.py