Skip to content

Commit 8bdb856

Browse files
committed
WIP: Implement vulkan renderer backend
1 parent 13f4aef commit 8bdb856

File tree

75 files changed

+34699
-301
lines changed

Some content is hidden

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

75 files changed

+34699
-301
lines changed

1k/build.profiles

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# --- region platfom:common
77

88
# The axmol shader compiler, legacy name is 'glslcc' before axmol-2.3.0
9-
axslcc=1.13.2+
9+
axslcc=1.15.0+
1010

1111
# The cmake, @gradle @axmol-cmdline
1212
# as latest as possible

3rdparty/glad/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ set(target_name ${lib_name})
44

55
project(${target_name})
66

7-
set(target_src_files "include/glad/gl.h" src/gl.c)
7+
if(AX_RENDER_API STREQUAL "gl")
8+
set(target_src_files "include/glad/gl.h" src/gl.c)
9+
elseif(AX_RENDER_API STREQUAL "vk")
10+
set(target_src_files "include/glad/vulkan.h" src/vulkan.c)
11+
endif()
812

913
add_library(${target_name} ${target_src_files})
1014

3rdparty/glad/include/glad/gl.h

Lines changed: 144 additions & 52 deletions
Large diffs are not rendered by default.

3rdparty/glad/include/glad/vulkan.h

Lines changed: 22075 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/* */
2+
/* File: vk_platform.h */
3+
/* */
4+
/*
5+
** Copyright 2014-2025 The Khronos Group Inc.
6+
**
7+
** SPDX-License-Identifier: Apache-2.0
8+
*/
9+
10+
11+
#ifndef VK_PLATFORM_H_
12+
#define VK_PLATFORM_H_
13+
14+
#ifdef __cplusplus
15+
extern "C"
16+
{
17+
#endif /* __cplusplus */
18+
19+
/*
20+
***************************************************************************************************
21+
* Platform-specific directives and type declarations
22+
***************************************************************************************************
23+
*/
24+
25+
/* Platform-specific calling convention macros.
26+
*
27+
* Platforms should define these so that Vulkan clients call Vulkan commands
28+
* with the same calling conventions that the Vulkan implementation expects.
29+
*
30+
* VKAPI_ATTR - Placed before the return type in function declarations.
31+
* Useful for C++11 and GCC/Clang-style function attribute syntax.
32+
* VKAPI_CALL - Placed after the return type in function declarations.
33+
* Useful for MSVC-style calling convention syntax.
34+
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
35+
*
36+
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
37+
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
38+
*/
39+
#if defined(_WIN32)
40+
/* On Windows, Vulkan commands use the stdcall convention */
41+
#define VKAPI_ATTR
42+
#define VKAPI_CALL __stdcall
43+
#define VKAPI_PTR VKAPI_CALL
44+
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
45+
#error "Vulkan is not supported for the 'armeabi' NDK ABI"
46+
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
47+
/* On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" */
48+
/* calling convention, i.e. float parameters are passed in registers. This */
49+
/* is true even if the rest of the application passes floats on the stack, */
50+
/* as it does by default when compiling for the armeabi-v7a NDK ABI. */
51+
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
52+
#define VKAPI_CALL
53+
#define VKAPI_PTR VKAPI_ATTR
54+
#else
55+
/* On other platforms, use the default calling convention */
56+
#define VKAPI_ATTR
57+
#define VKAPI_CALL
58+
#define VKAPI_PTR
59+
#endif
60+
61+
#if !defined(VK_NO_STDDEF_H)
62+
#include <stddef.h>
63+
#endif /* !defined(VK_NO_STDDEF_H) */
64+
65+
#if !defined(VK_NO_STDINT_H)
66+
#if defined(_MSC_VER) && (_MSC_VER < 1600)
67+
typedef signed __int8 int8_t;
68+
typedef unsigned __int8 uint8_t;
69+
typedef signed __int16 int16_t;
70+
typedef unsigned __int16 uint16_t;
71+
typedef signed __int32 int32_t;
72+
typedef unsigned __int32 uint32_t;
73+
typedef signed __int64 int64_t;
74+
typedef unsigned __int64 uint64_t;
75+
#else
76+
#include <stdint.h>
77+
#endif
78+
#endif /* !defined(VK_NO_STDINT_H) */
79+
80+
#ifdef __cplusplus
81+
} /* extern "C" */
82+
#endif /* __cplusplus */
83+
84+
#endif

0 commit comments

Comments
 (0)