Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e450e07
WIP: Implement Vulkan RHI
halx99 Nov 12, 2025
5b6b58f
Implement vk::RenderTextImpl::readPixels
halx99 Nov 13, 2025
f930e53
Improve adapter selection
halx99 Nov 13, 2025
42d9502
Improve VK resources management
halx99 Nov 13, 2025
e7ffe6d
Fix linux vulkan driver not support RGBA for surface
halx99 Nov 14, 2025
98f005f
Fix descriptor sets assemble
halx99 Nov 14, 2025
f1a6c37
vulkan: fix wayland create swapchain fail width/height is 0
halx99 Nov 14, 2025
a7395e0
vulkan: validate inframe state
halx99 Nov 14, 2025
841fda2
Improve rhi::vk::RenderPipelineImpl
halx99 Nov 14, 2025
3bf91b4
vulkan: fix primitive topology class mismatch
halx99 Nov 14, 2025
e4fcedf
vulkan: fix generateMipmaps and add image layout tracker
halx99 Nov 14, 2025
cd39377
vulkan: fix descriptor set layout sampler bindings
halx99 Nov 14, 2025
2e3bb1f
vulkan: captureScreen, captureNode now works
halx99 Nov 15, 2025
7ed3205
vulkan: mesh render instancing draw works
halx99 Nov 15, 2025
d1163e1
vulkan: skybox, terrain rendering works
halx99 Nov 15, 2025
838a286
Update axslcc to v3.0.0
halx99 Nov 15, 2025
15dcc33
Committing clang-format changes
axmol-bot Nov 15, 2025
929ab49
fixup
halx99 Nov 15, 2025
c65e800
fix metal
halx99 Nov 15, 2025
b25bc65
vulkan: implement descriptor set cache
halx99 Nov 16, 2025
e689cbf
vulkan: optimized dynamicStateBits
halx99 Nov 16, 2025
4150b7c
vulkan: improve pipeline cache
halx99 Nov 16, 2025
205d772
renderer: fix shader test
halx99 Nov 16, 2025
d19b1da
vulkan: fix Grid draw by removing POT calc
halx99 Nov 16, 2025
5d8c750
fixup
halx99 Nov 16, 2025
03431e4
Committing clang-format changes
axmol-bot Nov 16, 2025
2698deb
vulkan: make android works
halx99 Nov 19, 2025
654bd2a
fixup
halx99 Nov 19, 2025
e75353b
vulkan: process android VK_ERROR_SURFACE_LOST_KHR
halx99 Nov 19, 2025
d39a60d
Committing clang-format changes
axmol-bot Nov 19, 2025
ec1e662
vulkan: add ci
halx99 Nov 19, 2025
ba179b8
Vulkan: use per-image acquire semaphores to fix Android flicker
halx99 Nov 20, 2025
66b332c
Improve code style
halx99 Nov 20, 2025
d41ba55
Include upload-artifact action in build workflow
halx99 Nov 20, 2025
3ffae03
fixup
halx99 Nov 20, 2025
72de6b1
fix ogl crash issue
halx99 Nov 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,25 @@ jobs:
name: windows_d3d11_x64
path: |
build/bin/cpp-tests/**/*
win32-vk:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Build
shell: pwsh
run: |
.\tools\cmdline\axmol -p win32 -a x64 -xc '-DAX_RENDER_API=vk'
- name: Check prebuilt workflow
shell: pwsh
run: |
./setup.ps1
axmol new HelloCpp
axmol -d .\HelloCpp -xc '-DAX_PREBUILT_DIR=build'
- uses: actions/upload-artifact@v4
with:
name: windows_vk_x64
path: |
build/bin/cpp-tests/**/*
winuwp-ogl:
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -116,6 +135,19 @@ jobs:
- name: Build
shell: pwsh
run: ./tools/cmdline/axmol -p linux -a x64 -t 'cpp-tests,lua-tests' && ./tools/cmdline/axmol run -p linux -a x64 -t unit-tests -wait
linux-vk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Install dependencies
run: |
AX_ROOT=`pwd`
echo -e "y" | pwsh $AX_ROOT/setup.ps1

- name: Build
shell: pwsh
run: ./tools/cmdline/axmol -p linux -a x64 -t 'cpp-tests,lua-tests' -xc '-DAX_RENDER_API=vk'
osx-arm64:
runs-on: macos-latest
steps:
Expand Down Expand Up @@ -157,6 +189,22 @@ jobs:
path: |
templates/**/*.apk
tests/**/*.apk
android-vk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Build
shell: pwsh
run: |
$AX_ROOT = $(Get-Location).Path
./tools/cmdline/axmol -p android -a arm64 -xc '-DAX_RENDER_API=vk'
- uses: actions/upload-artifact@v4
with:
name: android_arm64_vk
path: |
templates/**/*.apk
tests/**/*.apk
ios:
runs-on: macos-latest
strategy:
Expand Down
2 changes: 1 addition & 1 deletion 1k/build.profiles
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# --- region platfom:common

# The axmol shader compiler, legacy name is 'glslcc' before axmol-2.3.0
axslcc=1.13.2+
axslcc=3.0.0+

# The cmake, @gradle @axmol-cmdline
# as latest as possible
Expand Down
20 changes: 15 additions & 5 deletions 3rdparty/glad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ set(target_name ${lib_name})

project(${target_name})

set(target_src_files "include/glad/gl.h" src/gl.c)
if(AX_RENDER_API STREQUAL "gl")
set(target_src_files "include/glad/gl.h" src/gl.c)
elseif(AX_RENDER_API STREQUAL "vk")
set(target_src_files "include/glad/vulkan.h" src/vulkan.c)
endif()

add_library(${target_name} ${target_src_files})

Expand All @@ -20,10 +24,16 @@ if(BUILD_SHARED_LIBS)
endif()

if(ANDROID)
target_compile_definitions(${target_name}
PUBLIC GLAD_GLES2=1
PUBLIC GLAD_GLES2_USE_SYSTEM_EGL=1 # refer: https://github.com/Dav1dde/glad/pull/438
)
if(AX_RENDER_API STREQUAL "gl")
target_compile_definitions(${target_name}
PUBLIC GLAD_GLES2=1
PUBLIC GLAD_GLES2_USE_SYSTEM_EGL=1 # refer: https://github.com/Dav1dde/glad/pull/438
)
elseif(AX_RENDER_API STREQUAL "vk")
target_compile_definitions(${target_name}
PUBLIC VK_USE_PLATFORM_ANDROID_KHR=1
)
endif()
endif()

target_include_directories(${target_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
196 changes: 144 additions & 52 deletions 3rdparty/glad/include/glad/gl.h

Large diffs are not rendered by default.

22,075 changes: 22,075 additions & 0 deletions 3rdparty/glad/include/glad/vulkan.h

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions 3rdparty/glad/include/vk_platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* */
/* File: vk_platform.h */
/* */
/*
** Copyright 2014-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/


#ifndef VK_PLATFORM_H_
#define VK_PLATFORM_H_

#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */

/*
***************************************************************************************************
* Platform-specific directives and type declarations
***************************************************************************************************
*/

/* Platform-specific calling convention macros.
*
* Platforms should define these so that Vulkan clients call Vulkan commands
* with the same calling conventions that the Vulkan implementation expects.
*
* VKAPI_ATTR - Placed before the return type in function declarations.
* Useful for C++11 and GCC/Clang-style function attribute syntax.
* VKAPI_CALL - Placed after the return type in function declarations.
* Useful for MSVC-style calling convention syntax.
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
*
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
*/
#if defined(_WIN32)
/* On Windows, Vulkan commands use the stdcall convention */
#define VKAPI_ATTR
#define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
#error "Vulkan is not supported for the 'armeabi' NDK ABI"
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
/* On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" */
/* calling convention, i.e. float parameters are passed in registers. This */
/* is true even if the rest of the application passes floats on the stack, */
/* as it does by default when compiling for the armeabi-v7a NDK ABI. */
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
#define VKAPI_CALL
#define VKAPI_PTR VKAPI_ATTR
#else
/* On other platforms, use the default calling convention */
#define VKAPI_ATTR
#define VKAPI_CALL
#define VKAPI_PTR
#endif

#if !defined(VK_NO_STDDEF_H)
#include <stddef.h>
#endif /* !defined(VK_NO_STDDEF_H) */

#if !defined(VK_NO_STDINT_H)
#if defined(_MSC_VER) && (_MSC_VER < 1600)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
#endif /* !defined(VK_NO_STDINT_H) */

#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */

#endif
Loading
Loading