Flutter Engine
The Flutter Engine
vulkan_interface.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_VULKAN_PROCS_VULKAN_INTERFACE_H_
6#define FLUTTER_VULKAN_PROCS_VULKAN_INTERFACE_H_
7
8#include <string>
9
10#include "flutter/fml/build_config.h"
11#include "flutter/fml/logging.h"
12
13#if FML_OS_ANDROID
14#ifndef VK_USE_PLATFORM_ANDROID_KHR
15#define VK_USE_PLATFORM_ANDROID_KHR 1
16#endif // VK_USE_PLATFORM_ANDROID_KHR
17#endif // FML_OS_ANDROID
18
19#if OS_FUCHSIA
20#ifndef VK_USE_PLATFORM_MAGMA_KHR
21#define VK_USE_PLATFORM_MAGMA_KHR 1
22#endif // VK_USE_PLATFORM_MAGMA_KHR
23#ifndef VK_USE_PLATFORM_FUCHSIA
24#define VK_USE_PLATFORM_FUCHSIA 1
25#endif // VK_USE_PLATFORM_FUCHSIA
26#endif // OS_FUCHSIA
27
28#include <vulkan/vulkan.h>
29
30#define VK_CALL_LOG_ERROR(expression) VK_CALL_LOG(expression, ERROR)
31
32#define VK_CALL_LOG_FATAL(expression) VK_CALL_LOG(expression, FATAL)
33
34#define VK_CALL_LOG(expression, severity) \
35 ({ \
36 __typeof__(expression) _rc = (expression); \
37 if (_rc != VK_SUCCESS) { \
38 FML_LOG(severity) << "Vulkan call '" << #expression \
39 << "' failed with error " \
40 << vulkan::VulkanResultToString(_rc); \
41 } \
42 _rc; \
43 })
44
45namespace vulkan {
46
48
49} // namespace vulkan
50
51#endif // FLUTTER_VULKAN_PROCS_VULKAN_INTERFACE_H_
GAsyncResult * result
std::string VulkanResultToString(VkResult result)
VkResult
Definition: vulkan_core.h:140