Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a12cd9a

Browse files
committed
speed up vulkan dnn, and support ios and apple m1 chip.
1 parent d2143bc commit a12cd9a

File tree

116 files changed

+18860
-11430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+18860
-11430
lines changed

3rdparty/include/vulkan/vk_platform.h

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,9 @@
22
// File: vk_platform.h
33
//
44
/*
5-
** Copyright (c) 2014-2017 The Khronos Group Inc.
5+
** Copyright 2014-2023 The Khronos Group Inc.
66
**
7-
** Licensed under the Apache License, Version 2.0 (the "License");
8-
** you may not use this file except in compliance with the License.
9-
** You may obtain a copy of the License at
10-
**
11-
** http://www.apache.org/licenses/LICENSE-2.0
12-
**
13-
** Unless required by applicable law or agreed to in writing, software
14-
** distributed under the License is distributed on an "AS IS" BASIS,
15-
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
** See the License for the specific language governing permissions and
17-
** limitations under the License.
7+
** SPDX-License-Identifier: Apache-2.0
188
*/
199

2010

@@ -52,7 +42,7 @@ extern "C"
5242
#define VKAPI_CALL __stdcall
5343
#define VKAPI_PTR VKAPI_CALL
5444
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
55-
#error "Vulkan isn't supported for the 'armeabi' NDK ABI"
45+
#error "Vulkan is not supported for the 'armeabi' NDK ABI"
5646
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
5747
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
5848
// calling convention, i.e. float parameters are passed in registers. This
@@ -68,7 +58,9 @@ extern "C"
6858
#define VKAPI_PTR
6959
#endif
7060

71-
#include <stddef.h>
61+
#if !defined(VK_NO_STDDEF_H)
62+
#include <stddef.h>
63+
#endif // !defined(VK_NO_STDDEF_H)
7264

7365
#if !defined(VK_NO_STDINT_H)
7466
#if defined(_MSC_VER) && (_MSC_VER < 1600)

3rdparty/include/vulkan/vulkan.h

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,9 @@
22
#define VULKAN_H_ 1
33

44
/*
5-
** Copyright (c) 2015-2018 The Khronos Group Inc.
5+
** Copyright 2015-2023 The Khronos Group Inc.
66
**
7-
** Licensed under the Apache License, Version 2.0 (the "License");
8-
** you may not use this file except in compliance with the License.
9-
** You may obtain a copy of the License at
10-
**
11-
** http://www.apache.org/licenses/LICENSE-2.0
12-
**
13-
** Unless required by applicable law or agreed to in writing, software
14-
** distributed under the License is distributed on an "AS IS" BASIS,
15-
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
** See the License for the specific language governing permissions and
17-
** limitations under the License.
7+
** SPDX-License-Identifier: Apache-2.0
188
*/
199

2010
#include "vk_platform.h"
@@ -38,20 +28,16 @@
3828
#include "vulkan_macos.h"
3929
#endif
4030

41-
42-
#ifdef VK_USE_PLATFORM_MIR_KHR
43-
#include <mir_toolkit/client_types.h>
44-
#include "vulkan_mir.h"
31+
#ifdef VK_USE_PLATFORM_METAL_EXT
32+
#include "vulkan_metal.h"
4533
#endif
4634

47-
4835
#ifdef VK_USE_PLATFORM_VI_NN
4936
#include "vulkan_vi.h"
5037
#endif
5138

5239

5340
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
54-
#include <wayland-client.h>
5541
#include "vulkan_wayland.h"
5642
#endif
5743

@@ -74,10 +60,40 @@
7460
#endif
7561

7662

63+
#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
64+
#include <directfb.h>
65+
#include "vulkan_directfb.h"
66+
#endif
67+
68+
7769
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
7870
#include <X11/Xlib.h>
7971
#include <X11/extensions/Xrandr.h>
8072
#include "vulkan_xlib_xrandr.h"
8173
#endif
8274

75+
76+
#ifdef VK_USE_PLATFORM_GGP
77+
#include <ggp_c/vulkan_types.h>
78+
#include "vulkan_ggp.h"
79+
#endif
80+
81+
82+
#ifdef VK_USE_PLATFORM_SCREEN_QNX
83+
#include <screen/screen.h>
84+
#include "vulkan_screen.h"
85+
#endif
86+
87+
88+
#ifdef VK_USE_PLATFORM_SCI
89+
#include <nvscisync.h>
90+
#include <nvscibuf.h>
91+
#include "vulkan_sci.h"
92+
#endif
93+
94+
95+
#ifdef VK_ENABLE_BETA_EXTENSIONS
96+
#include "vulkan_beta.h"
97+
#endif
98+
8399
#endif // VULKAN_H_

3rdparty/include/vulkan/vulkan_android.h

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
11
#ifndef VULKAN_ANDROID_H_
22
#define VULKAN_ANDROID_H_ 1
33

4-
#ifdef __cplusplus
5-
extern "C" {
6-
#endif
7-
84
/*
9-
** Copyright (c) 2015-2018 The Khronos Group Inc.
5+
** Copyright 2015-2023 The Khronos Group Inc.
106
**
11-
** Licensed under the Apache License, Version 2.0 (the "License");
12-
** you may not use this file except in compliance with the License.
13-
** You may obtain a copy of the License at
14-
**
15-
** http://www.apache.org/licenses/LICENSE-2.0
16-
**
17-
** Unless required by applicable law or agreed to in writing, software
18-
** distributed under the License is distributed on an "AS IS" BASIS,
19-
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20-
** See the License for the specific language governing permissions and
21-
** limitations under the License.
7+
** SPDX-License-Identifier: Apache-2.0
228
*/
239

2410
/*
@@ -27,22 +13,24 @@ extern "C" {
2713
*/
2814

2915

16+
#ifdef __cplusplus
17+
extern "C" {
18+
#endif
19+
20+
21+
3022
#define VK_KHR_android_surface 1
3123
struct ANativeWindow;
32-
3324
#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
3425
#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
35-
3626
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
37-
3827
typedef struct VkAndroidSurfaceCreateInfoKHR {
3928
VkStructureType sType;
4029
const void* pNext;
4130
VkAndroidSurfaceCreateFlagsKHR flags;
4231
struct ANativeWindow* window;
4332
} VkAndroidSurfaceCreateInfoKHR;
4433

45-
4634
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
4735

4836
#ifndef VK_NO_PROTOTYPES
@@ -53,12 +41,11 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
5341
VkSurfaceKHR* pSurface);
5442
#endif
5543

44+
5645
#define VK_ANDROID_external_memory_android_hardware_buffer 1
5746
struct AHardwareBuffer;
58-
59-
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3
47+
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5
6048
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
61-
6249
typedef struct VkAndroidHardwareBufferUsageANDROID {
6350
VkStructureType sType;
6451
void* pNext;
@@ -103,6 +90,18 @@ typedef struct VkExternalFormatANDROID {
10390
uint64_t externalFormat;
10491
} VkExternalFormatANDROID;
10592

93+
typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID {
94+
VkStructureType sType;
95+
void* pNext;
96+
VkFormat format;
97+
uint64_t externalFormat;
98+
VkFormatFeatureFlags2 formatFeatures;
99+
VkComponentMapping samplerYcbcrConversionComponents;
100+
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
101+
VkSamplerYcbcrRange suggestedYcbcrRange;
102+
VkChromaLocation suggestedXChromaOffset;
103+
VkChromaLocation suggestedYChromaOffset;
104+
} VkAndroidHardwareBufferFormatProperties2ANDROID;
106105

107106
typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
108107
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);

0 commit comments

Comments
 (0)