OSDN Git Service

vulkan: do not use exported functions internally
authorChia-I Wu <olv@google.com>
Fri, 20 May 2016 08:15:06 +0000 (16:15 +0800)
committerChia-I Wu <olv@google.com>
Mon, 23 May 2016 01:28:30 +0000 (09:28 +0800)
commit3e654dc68a954b150c141c4a2e96418883bd7c9b
tree7ad6d3b182e400e1ce702e763e90ed0d0c9ddba4
parent79994146e18fefe37550111c5703c6a6859644d6
vulkan: do not use exported functions internally

Our vkGet*ProcAddr uses the exported functions.  They will break when any
of the exported functions are overridden (e.g., through LD_PRELOAD).

Unexport and move all exported functions to vulkan::api namespace.
Re-export them by having vkFoo as a wrapper to vulkan::api::Foo.

Another option is to re-export vulkan::api::Foo by having vkFoo as an
alias using __attribute__((alias)).  That results in smaller binaries.
But we will not be able to catch mismatches between vulkan.h and
vulkan.api.

To avoid future breakage, define VK_NO_PROTOTYPES for all files except
api_gen.cpp.

Bug: 28886971
Change-Id: I08fde7ebb247f8c7e040ccf812b40b02094d3c7f
vulkan/libvulkan/Android.mk
vulkan/libvulkan/api_gen.cpp
vulkan/libvulkan/code-generator.tmpl