skia2/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.h
Greg Daniel f33cf451a2 Update VMA to latest version.
This is needed so that we can use non skia supplied vk_mem_alloc.h on
clients that have already updated to newest version. As we transition
to Bazel builds this helps to make it so we can set the rules for
specific clients around VMA without things breaking

Bug: skia:13211
Change-Id: I5d38a3a91a44f6b3fdf75894a3248ee3991dd5d9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531157
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2022-04-18 20:28:30 +00:00

35 lines
1.3 KiB
C

/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
// We use this header to include vk_mem_alloc.h to make sure we always include GrVkDefines.h first.
// We need to do this so that the corect defines are setup before we include vulkan.h inside of
// vk_mem_alloc.h
#ifndef GrVulkanMemoryAllocator_DEFINED
#define GrVulkanMemoryAllocator_DEFINED
// We only ever include this from src files which have already included vulkan.
#ifndef VULKAN_CORE_H_
#error "vulkan_core.h has not been included before trying to include the GrVulkanMemoryAllocator"
#endif
// vk_mem_alloc.h checks to see if VULKAN_H_ has been included before trying to include vulkan.h.
// However, some builds of Skia may not have access to vulkan.h and just have access to
// vulkan_core.h. So we pretend we've already included vulkan.h (if it already hasn't been) which
// will be fine for building internal skia files. If we do fake it out by defining VULKAN_H_ we
// need to make sure to undefine it incase outside client code does later try to include the
// real vulkan.h
#ifndef VULKAN_H_
#define VULKAN_H_
#define GR_NEEDED_TO_DEFINE_VULKAN_H
#endif
#include "include/vk_mem_alloc.h"
#ifdef GR_NEEDED_TO_DEFINE_VULKAN_H
#undef VULKAN_H_
#endif
#endif