flutter_flutter/engine/src/flutter/vulkan/vulkan_interface.h
Chinmay Garde 56e7bf84b1 Wire up Fuchsia SDK related updated for shell dependencies. #8869
This does not actually import the runners into the engine. It only sets up the targets so they need no modifications are necessary when the migration is done. The engine has been verified to build in both buildroots.
2019-05-06 18:01:59 -07:00

64 lines
1.7 KiB
C++

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_VULKAN_VULKAN_INTERFACE_H_
#define FLUTTER_VULKAN_VULKAN_INTERFACE_H_
#include <string>
#include "flutter/fml/build_config.h"
#include "flutter/fml/logging.h"
#if !defined(FUCHSIA_SDK)
#define VULKAN_LINK_STATICALLY OS_FUCHSIA
#endif // !defined(FUCHSIA_SDK)
#if OS_ANDROID
#ifndef VK_USE_PLATFORM_ANDROID_KHR
#define VK_USE_PLATFORM_ANDROID_KHR 1
#endif // VK_USE_PLATFORM_ANDROID_KHR
#endif // OS_ANDROID
#if OS_FUCHSIA
#ifndef VK_USE_PLATFORM_MAGMA_KHR
#define VK_USE_PLATFORM_MAGMA_KHR 1
#endif // VK_USE_PLATFORM_MAGMA_KHR
#ifndef VK_USE_PLATFORM_FUCHSIA
#define VK_USE_PLATFORM_FUCHSIA 1
#endif // VK_USE_PLATFORM_FUCHSIA
#endif // OS_FUCHSIA
#if !VULKAN_LINK_STATICALLY
#define VK_NO_PROTOTYPES 1
#endif // !VULKAN_LINK_STATICALLY
#include <vulkan/vulkan.h>
#ifndef NDEBUG
#define VK_CALL_LOG_ERROR(expression) \
({ \
__typeof__(expression) _rc = (expression); \
if (_rc != VK_SUCCESS) { \
FML_DLOG(INFO) << "Vulkan call '" << #expression \
<< "' failed with error " \
<< vulkan::VulkanResultToString(_rc); \
} \
_rc; \
})
#else // NDEBUG
#define VK_CALL_LOG_ERROR(expression) (expression)
#endif // NDEBUG
namespace vulkan {
std::string VulkanResultToString(VkResult result);
} // namespace vulkan
#endif // FLUTTER_VULKAN_VULKAN_INTERFACE_H_