summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChad Versace <chadversary@chromium.org>2017-08-29 14:41:24 -0700
committerChad Versace <chadversary@chromium.org>2017-09-18 14:26:54 -0700
commitf07ac34e6f3cb61f99009ab9065e1f6a1bc8a945 (patch)
tree0dd25597c9f8a7e844e9dee1bfa8977acd9f90de /include
parent5872ccc9ac6034902fa46835df99637ced7ff4c8 (diff)
vulkan: Add #ifdef hack to vk_android_native_buffer.h
This patch consolidates many potential `#ifdef ANDROID` messes throughout src/vulkan and src/intel/vulkan into a simple, localized hack. The hack is an `#ifdef ANDROID` in vk_android_native_buffer.h that, on non-Android platorms, avoids including the Android platform headers and typedefs any Android-specific types to void*. This hack doesn't remove *all* the `#ifdef ANDROID`s in upcoming patches, but it does remove a lot. I first tried implementing VK_ANDROID_native_buffer without this hack, but eventually gave up when the yak shaving became too much. Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/vulkan/vk_android_native_buffer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/vulkan/vk_android_native_buffer.h b/include/vulkan/vk_android_native_buffer.h
index d0ebf81353..a658b49243 100644
--- a/include/vulkan/vk_android_native_buffer.h
+++ b/include/vulkan/vk_android_native_buffer.h
@@ -17,8 +17,13 @@
#ifndef __VK_ANDROID_NATIVE_BUFFER_H__
#define __VK_ANDROID_NATIVE_BUFFER_H__
+/* MESA: A hack to avoid #ifdefs in driver code. */
+#ifdef ANDROID
#include <system/window.h>
#include <vulkan/vulkan.h>
+#else
+typedef void *buffer_handle_t;
+#endif
#ifdef __cplusplus
extern "C" {