OSDN Git Service

anv/entrypoints: Rework #if guards
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 10 Jun 2016 19:42:52 +0000 (12:42 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 15 Jun 2016 08:29:10 +0000 (09:29 +0100)
commit6eb0240a325ee5a6e8248be860058d8aadbd67fc
treeffac96e1b58a01aeee6c4b4cbc5be78ac0e84c22
parenteb0197ad53fc6e90f39a4c050a8b9b2ac3e73524
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>
(cherry picked from commit 8d37556ec9d7fbbffc5497388a52998ae4fe75de)
src/intel/vulkan/anv_entrypoints_gen.py