Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ef2e844
Added fixes for removing void* in replacement with using std::span<T>…
SpinnerX Mar 6, 2026
6fd1629
Reworked the texdture implementations to using std::span and added mo…
SpinnerX Mar 6, 2026
6d3bb50
More cleanup in the texture implementation and added some default par…
SpinnerX Mar 6, 2026
57a02b9
Remove redundant logic for passing in std::span in the texture loadin…
SpinnerX Mar 6, 2026
bb86d77
WIP for mapping uniforms to GPU memory to happen
SpinnerX Mar 7, 2026
70a7a16
Updated demo 12 to using update<T> API
SpinnerX Mar 7, 2026
6be63bb
Removed runtime assertions and made offset a parameter when writing t…
SpinnerX Mar 8, 2026
4d97998
Replaced .write API to .transfer for clear API operation being performed
SpinnerX Mar 8, 2026
a621712
Updated demo 12 to using .transfer API
SpinnerX Mar 8, 2026
a27da98
Removed unused code from demo 12 application.cpp
SpinnerX Mar 8, 2026
ce44de0
clang-format CI update to use version 120 and removed wget step
SpinnerX Mar 8, 2026
e51267d
clang-format demo 12 application.cpp
SpinnerX Mar 8, 2026
9465fe7
Made updates to the git workflows for linter and clang-format
SpinnerX Mar 8, 2026
3ec74f0
clang-format CI update to use include-regex
SpinnerX Mar 8, 2026
98ef1e4
clang-tidy CI updated adding failed exit
SpinnerX Mar 8, 2026
fa9bdb6
Changed to actions/checkout@v4
SpinnerX Mar 8, 2026
1ec35bf
linter updated to have explicit extensions to run clang-tidy on
SpinnerX Mar 8, 2026
f7e3bf5
Added dummy include to trigger linter CI
SpinnerX Mar 8, 2026
25f54e3
Updated linter git workflows
SpinnerX Mar 8, 2026
da5fd91
Updated linter CI condition checks
SpinnerX Mar 9, 2026
cce2892
Correcting linter condition checks
SpinnerX Mar 9, 2026
ca55cab
Added c++23 argument to linter CI
SpinnerX Mar 9, 2026
7d86acf
Added generate compile commands condition
SpinnerX Mar 9, 2026
bdddc34
Fixed linter tidy checks
SpinnerX Mar 9, 2026
667086e
Formatted using clang-format
SpinnerX Mar 9, 2026
b8fc602
Formatted using clang-format on vulkan-cpp
SpinnerX Mar 9, 2026
394813a
Removed commented CI logic in linter CI
SpinnerX Mar 9, 2026
5343fbf
Version update to vulkan-cpp/6.0
SpinnerX Mar 9, 2026
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
7 changes: 2 additions & 5 deletions .github/workflows/clang-format-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ jobs:
name: Formatting Check
runs-on: ubuntu-latest
steps:

- name: 🌐 Downloading .clang-format from TheAtlasEngine
run: wget https://github.com/engine3d-dev/TheAtlasEngine/blob/main/.clang-format -O .clang-format

- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/clang-format-action@v4.14.0
with:
clang-format-version: 19
clang-format-version: 20
check-path: '.'
include-regex: '.*\.(cpp|cppm)$'
fallback-style: 'LLVM' # optional
47 changes: 27 additions & 20 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
name: C++ Linter
name: cpp-linter

on: [pull_request]

jobs:
linux-build:
name: "Linter"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: cpp-linter/cpp-linter-action@main
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: '.clang-format' # Use .clang-format config file
version: 19 # Using clang-tidy19
tidy-checks: '.clang-tidy' # Use .clang-tidy config file
# only 'update' a single comment in a pull request thread.
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
jobs:
cpp-linter:
runs-on: ubuntu-latest
steps:
# - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: cpp-linter/cpp-linter-action@main
id: linter
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: ''
tidy-checks: '.clang-tidy'
extensions: 'cpp, cppm'
files-changed-only: true
thread-comments: false
extra-args: '-std=c++23'

- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
run: exit 1
- name: Fail fast?!
if: ${{ steps.linter.outputs.checks-failed > 0 }}
run: |
echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}"
# for actual deployment
exit 1
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class VulkanCppRecipe(ConanFile):
name = "vulkan-cpp"
version = "5.0"
version = "6.0"
license = "Apache-2.0"
url = "https://github.com/engine3d-dev/vulkan-cpp"
homepage = "https://github.com/engine3d-dev/vulkan-cpp"
Expand Down
83 changes: 53 additions & 30 deletions demos/12-loading-models/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import vk;
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/hash.hpp>

#include <stdio.h>

#include <tiny_obj_loader.h>

static VKAPI_ATTR VkBool32 VKAPI_CALL
Expand Down Expand Up @@ -144,38 +146,42 @@ class obj_model {
indices.push_back(unique_vertices[vertex]);
}
}
vk::vertex_params vertex_info = { .phsyical_memory_properties =
p_physical.memory_properties(),
.vertices = vertices };

m_has_indices = (indices.size() > 0) ? true : false;

if (m_has_indices) {
m_indices_size = indices.size();
}
m_indices_size = vertices.size();
m_indices_size = indices.size();
vk::vertex_params vertex_info = {
.phsyical_memory_properties = p_physical.memory_properties(),
};

vk::index_params index_info = { .phsyical_memory_properties =
p_physical.memory_properties(),
.indices = indices };
m_vertex_buffer = vk::vertex_buffer(p_device, vertex_info);
m_index_buffer = vk::index_buffer(p_device, index_info);
p_physical.memory_properties() };

m_vertex_buffer = vk::vertex_buffer(p_device, vertices, vertex_info);
m_index_buffer = vk::index_buffer(p_device, indices, index_info);
m_is_loaded = true;
}

[[nodiscard]] bool loaded() const { return m_is_loaded; }

void bind(const VkCommandBuffer& p_command) {
m_vertex_buffer.bind(p_command);
if (m_index_buffer.size() > 0) {

if (m_has_indices) {
m_index_buffer.bind(p_command);
}
}

void draw(const VkCommandBuffer& p_command) {
if (m_index_buffer.size() > 0) {
vkCmdDrawIndexed(p_command,
static_cast<uint32_t>(m_index_buffer.size()),
1,
0,
0,
0);
if (m_has_indices) {
vkCmdDrawIndexed(p_command, m_indices_size, 1, 0, 0, 0);
}
else {
vkCmdDraw(p_command, m_vertex_buffer.size(), 1, 0, 0);
vkCmdDraw(p_command, m_indices_size, 1, 0, 0);
}
}

Expand All @@ -186,6 +192,8 @@ class obj_model {

private:
bool m_is_loaded = false;
bool m_has_indices = false;
uint32_t m_indices_size = 0;
vk::vertex_buffer m_vertex_buffer{};
vk::index_buffer m_index_buffer{};
};
Expand Down Expand Up @@ -465,10 +473,14 @@ main() {

// Now creating a vulkan graphics pipeline for the shader loading
std::array<vk::shader_source, 2> shader_sources = {
vk::shader_source{ .filename = "shader_samples/sample5/test.vert.spv",
.stage = vk::shader_stage::vertex },
vk::shader_source{ .filename = "shader_samples/sample5/test.frag.spv",
.stage = vk::shader_stage::fragment },
vk::shader_source{
.filename = "shader_samples/sample5/test.vert.spv",
.stage = vk::shader_stage::vertex,
},
vk::shader_source{
.filename = "shader_samples/sample5/test.frag.spv",
.stage = vk::shader_stage::fragment,
},
};

// Setting up vertex attributes in the test shaders
Expand Down Expand Up @@ -571,25 +583,34 @@ main() {
physical_device);

// Setting up descriptor sets for handling uniforms
vk::uniform_params test_ubo_info = { .phsyical_memory_properties =
physical_device.memory_properties(),
.size_bytes = sizeof(global_uniform) };
vk::uniform_params test_ubo_info = {
.phsyical_memory_properties = physical_device.memory_properties()
};
vk::uniform_buffer test_ubo =
vk::uniform_buffer(logical_device, test_ubo_info);
vk::uniform_buffer(logical_device, sizeof(global_uniform), test_ubo_info);
// std::println("uniform_buffer.alive() = {}", test_ubo.alive());

std::array<vk::write_buffer, 1> uniforms0 = { vk::write_buffer{
.buffer = test_ubo, .offset = 0, .range = test_ubo.size_bytes() } };
std::array<vk::write_buffer, 1> uniforms0 = {
vk::write_buffer{
.buffer = test_ubo,
.offset = 0,
.range = static_cast<uint32_t>(test_ubo.size_bytes()),
},
};
std::array<vk::write_buffer_descriptor, 1> uniforms = {
vk::write_buffer_descriptor{ .dst_binding = 0, .uniforms = uniforms0 }
vk::write_buffer_descriptor{
.dst_binding = 0,
.uniforms = uniforms0,
},
};

// Loading a texture
vk::texture_info config_texture = {
.phsyical_memory_properties = physical_device.memory_properties(),
.filepath = std::filesystem::path("asset_samples/viking_room.png")
};
vk::texture texture1(logical_device, config_texture);
vk::texture texture1(logical_device,
std::filesystem::path("asset_samples/viking_room.png"),
config_texture);

std::array<vk::write_image, 1> samplers = {
vk::write_image{
Expand Down Expand Up @@ -656,7 +677,9 @@ main() {
10.0f)
};
ubo.proj[1][1] *= -1;
test_ubo.update(&ubo);

std::array<global_uniform, 1> ubo_arr = { ubo };
test_ubo.transfer<global_uniform>(ubo_arr);

// Before we can send stuff to the GPU, since we already updated the
// descriptor set 0 beforehand, we must bind that descriptor resource
Expand Down
2 changes: 1 addition & 1 deletion demos/12-loading-models/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def requirements(self):
self.requires("glm/1.0.1")
self.requires("stb/cci.20230920")
self.requires("tinyobjloader/2.0.0-rc10")
self.requires("vulkan-cpp/5.0")
self.requires("vulkan-cpp/6.0")

def build(self):
cmake = CMake(self)
Expand Down
Loading
Loading