Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ef865cf
Renamed vk::physical to vk::physical_gpu for the enum for selecting g…
SpinnerX Jan 23, 2026
ad68199
Added the enums for configuring the graphics pipeline and configured …
SpinnerX Jan 23, 2026
e17cee5
Applied the new configuration to the viewport and rasterizer parameters
SpinnerX Jan 23, 2026
7e71d7f
Updated to use pipeline parameters for configuring the pipeline multi…
SpinnerX Jan 24, 2026
d80599a
Applied the vulkan-cpp configuration API's to be applied for setting …
SpinnerX Jan 24, 2026
4c201c6
Fixed the pipeline configuration to actually apply the parameter corr…
SpinnerX Jan 24, 2026
06123bb
Color blend state fixed with applying the color blend configuration w…
SpinnerX Jan 24, 2026
71ddc6f
Applied configuration for setting depth stencil state and dynamic sta…
SpinnerX Jan 24, 2026
1a728f3
Renamed vk::pipeline_settings to vk::pipeline_params
SpinnerX Jan 24, 2026
7f76881
Cleaned up pipeline.cppm and removed commented code
SpinnerX Jan 24, 2026
80ba6f4
Added boolean for enabling/disabling depth stencil configurations
SpinnerX Jan 24, 2026
f12f8cc
Update: graphics pipeline demos have been update to explicitly set so…
SpinnerX Jan 27, 2026
e75cea5
Update: demo 7 for explicit configuration specified to creating the g…
SpinnerX Jan 27, 2026
aa60cea
Cleaned up pipeline and renamed create to invalidate naming
SpinnerX Jan 27, 2026
8887506
Updated demo 7
SpinnerX Jan 27, 2026
e0eaea7
Fixed mispelled parameter name for address modes specifications for s…
SpinnerX Jan 28, 2026
8606e98
Demos update to specify more graphics pipeline params and rename vk::…
SpinnerX Jan 30, 2026
735f272
Version update to 5.0 and cmake utils version update in conanfile
SpinnerX Jan 30, 2026
d3bd0eb
Fixed setting extent of images to reference to the proper height value
SpinnerX Jan 30, 2026
bb7bd76
Code cleanup and conform to clang-format
SpinnerX Jan 30, 2026
cbb077c
Finalizing formatting code to clang-format
SpinnerX Jan 30, 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
4 changes: 2 additions & 2 deletions 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 = "4.0"
version = "5.0"
license = "Apache-2.0"
url = "https://github.com/engine3d-dev/vulkan-cpp"
homepage = "https://github.com/engine3d-dev/vulkan-cpp"
Expand All @@ -22,7 +22,7 @@ def build_requirements(self):
self.tool_requires("cmake/[^4.0.0]")
self.tool_requires("ninja/[^1.3.0]")
self.test_requires("boost-ext-ut/2.3.1")
self.tool_requires("engine3d-cmake-utils/4.0")
self.tool_requires("engine3d-cmake-utils/5.0")

def requirements(self):
self.requires("glfw/3.4")
Expand Down
67 changes: 41 additions & 26 deletions demos/10-textures/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ main() {

// setting up physical device
// TODO: Probably enforce the use of
// vk::enumerate_physical_device({.device_type = vk::physical::discrete})
// vk::enumerate_physical_device({.device_type =
// vk::physical_gpu::discrete})
vk::physical_enumeration enumerate_devices{
.device_type = vk::physical::discrete,
.device_type = vk::physical_gpu::discrete,
};
vk::physical_device physical_device(api_instance, enumerate_devices);

Expand Down Expand Up @@ -228,7 +229,8 @@ main() {
uint32_t mip_levels = 1;
for (uint32_t i = 0; i < swapchain_images.size(); i++) {
vk::image_params swapchain_image_config = {
.extent = { swapchain_extent.width, swapchain_extent.width },
.extent = { .width = swapchain_extent.width,
.height = swapchain_extent.height },
.format = surface_properties.format.format,
.aspect = vk::image_aspect_flags::color_bit,
.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
Expand All @@ -242,7 +244,8 @@ main() {

// Creating Depth Images for depth buffering
vk::image_params image_config = {
.extent = { swapchain_extent.width, swapchain_extent.width },
.extent = { .width = swapchain_extent.width,
.height = swapchain_extent.height },
.format = depth_format,
.aspect = vk::image_aspect_flags::depth_bit,
.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
Expand Down Expand Up @@ -418,18 +421,30 @@ main() {
std::array<VkDescriptorSetLayout, 1> layouts = { set0_resource.layout() };

/*
// This get_pipeline_configuration can work as an easy way for
specfying the vulkan configurations as an ease of setting things up
// TODO: Probably provide a shorthand - which could work as this:
vk::pipeline_settings pipeline_configuration =
This get_pipeline_configuration can work as an easy way for specfying
the vulkan configurations as an ease of setting things up
// TODO: Probably provide a shorthand - which could work as this:
vk::pipeline_settings pipeline_configuration =
vk::get_pipeline_configuration(main_renderpass, geometry_resource);
*/
vk::pipeline_settings pipeline_configuration = {
std::array<vk::color_blend_attachment_state, 1> color_blend_attachments = {
vk::color_blend_attachment_state{},
};

std::array<vk::dynamic_state, 2> dynamic_states = {
vk::dynamic_state::viewport, vk::dynamic_state::scissor
};
vk::pipeline_params pipeline_configuration = {
.renderpass = main_renderpass,
.shader_modules = geometry_resource.handles(),
.vertex_attributes = geometry_resource.vertex_attributes(),
.vertex_bind_attributes = geometry_resource.vertex_bind_attributes(),
.descriptor_layouts = layouts
.descriptor_layouts = layouts,
.color_blend = {
.attachments = color_blend_attachments,
},
.depth_stencil_enabled = true,
.dynamic_states = dynamic_states,
};
vk::pipeline main_graphics_pipeline(logical_device, pipeline_configuration);

Expand All @@ -440,22 +455,22 @@ main() {

// Setting up vertex buffer
std::array<vk::vertex_input, 4> vertices = {
vk::vertex_input{ { -0.5f, -0.5f, 0.f },
{ 1.0f, 0.0f, 0.0f },
{ 0.f, 0.f, 0.f },
{ 1.0f, 0.0f } },
vk::vertex_input{ { 0.5f, -0.5f, 0.f },
{ 0.0f, 1.0f, 0.0f },
{ 0.f, 0.f, 0.f },
{ 0.0f, 0.0f } },
vk::vertex_input{ { 0.5f, 0.5f, 0.f },
{ 0.0f, 0.0f, 1.0f },
{ 0.f, 0.f, 0.f },
{ 0.0f, 1.0f } },
vk::vertex_input{ { -0.5f, 0.5f, 0.f },
{ 1.0f, 1.0f, 1.0f },
{ 0.f, 0.f, 0.f },
{ 1.0f, 1.0f } }
vk::vertex_input{ .position = { -0.5f, -0.5f, 0.f },
.color = { 1.0f, 0.0f, 0.0f },
.normals = { 0.f, 0.f, 0.f },
.uv = { 1.0f, 0.0f } },
vk::vertex_input{ .position = { 0.5f, -0.5f, 0.f },
.color = { 0.0f, 1.0f, 0.0f },
.normals = { 0.f, 0.f, 0.f },
.uv = { 0.0f, 0.0f } },
vk::vertex_input{ .position = { 0.5f, 0.5f, 0.f },
.color = { 0.0f, 0.0f, 1.0f },
.normals = { 0.f, 0.f, 0.f },
.uv = { 0.0f, 1.0f } },
vk::vertex_input{ .position = { -0.5f, 0.5f, 0.f },
.color = { 1.0f, 1.0f, 1.0f },
.normals = { 0.f, 0.f, 0.f },
.uv = { 1.0f, 1.0f } }
};
vk::vertex_params vertex_info = {
.phsyical_memory_properties = physical_device.memory_properties(),
Expand Down
93 changes: 54 additions & 39 deletions demos/11-depth-buffering/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ main() {

// setting up physical device
// TODO: Probably enforce the use of
// vk::enumerate_physical_device({.device_type = vk::physical::discrete})
// vk::enumerate_physical_device({.device_type =
// vk::physical_gpu::discrete})
vk::physical_enumeration enumerate_devices{
.device_type = vk::physical::discrete,
.device_type = vk::physical_gpu::discrete,
};
vk::physical_device physical_device(api_instance, enumerate_devices);

Expand Down Expand Up @@ -221,7 +222,8 @@ main() {
// Setting up the images
for (uint32_t i = 0; i < swapchain_images.size(); i++) {
vk::image_params swapchain_image_config = {
.extent = { swapchain_extent.width, swapchain_extent.width },
.extent = { .width = swapchain_extent.width,
.height = swapchain_extent.height },
.format = surface_properties.format.format,
.aspect = vk::image_aspect_flags::color_bit,
.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
Expand All @@ -236,7 +238,8 @@ main() {

// Creating Images for depth buffering
vk::image_params image_config = {
.extent = { swapchain_extent.width, swapchain_extent.width },
.extent = { .width = swapchain_extent.width,
.height = swapchain_extent.height },
.format = depth_format,
.aspect = vk::image_aspect_flags::depth_bit,
.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
Expand Down Expand Up @@ -416,12 +419,24 @@ main() {

std::array<VkDescriptorSetLayout, 1> layouts = { set0_resource.layout() };

vk::pipeline_settings pipeline_configuration = {
std::array<vk::color_blend_attachment_state, 1> color_blend_attachments = {
vk::color_blend_attachment_state{},
};

std::array<vk::dynamic_state, 2> dynamic_states = {
vk::dynamic_state::viewport, vk::dynamic_state::scissor
};
vk::pipeline_params pipeline_configuration = {
.renderpass = main_renderpass,
.shader_modules = geometry_resource.handles(),
.vertex_attributes = geometry_resource.vertex_attributes(),
.vertex_bind_attributes = geometry_resource.vertex_bind_attributes(),
.descriptor_layouts = layouts
.descriptor_layouts = layouts,
.color_blend = {
.attachments = color_blend_attachments,
},
.depth_stencil_enabled = true,
.dynamic_states = dynamic_states,
};
vk::pipeline main_graphics_pipeline(logical_device, pipeline_configuration);

Expand All @@ -432,39 +447,39 @@ main() {

// Setting up vertex buffer
std::array<vk::vertex_input, 8> vertices = {
vk::vertex_input{ { -0.5f, -0.5f, 0.f },
{ 1.0f, 0.0f, 0.0f },
{ 1.0f, 0.0f, 0.f },
{ 1.0f, 0.0f } },
vk::vertex_input{ { 0.5f, -0.5f, 0.f },
{ 0.0f, 1.0f, 0.0f },
{ 0.0f, 0.0f, 0.f },
{ 0.0f, 0.0f } },
vk::vertex_input{ { 0.5f, 0.5f, 0.f },
{ 0.0f, 0.0f, 1.0f },
{ 0.0f, 1.0f, 0.f },
{ 0.0f, 1.0f } },
vk::vertex_input{ { -0.5f, 0.5f, 0.f },
{ 1.0f, 1.0f, 1.0f },
{ 1.0f, 1.0f, 0.f },
{ 1.0f, 1.0f } },

vk::vertex_input{ { -0.5f, -0.5f, -0.5f },
{ 1.0f, 0.0f, 0.0f },
{ 0.0f, 0.0f, 0.f },
{ 1.0f, 0.0f } },
vk::vertex_input{ { 0.5f, -0.5f, -0.5f },
{ 0.0f, 1.0f, 0.0f },
{ 1.0f, 0.0f, 0.f },
{ 0.0f, 0.0f } },
vk::vertex_input{ { 0.5f, 0.5f, -0.5f },
{ 0.0f, 0.0f, 1.0f },
{ 1.0f, 1.0f, 0.f },
{ 0.0f, 1.0f } },
vk::vertex_input{ { -0.5f, 0.5f, -0.5f },
{ 1.0f, 1.0f, 1.0f },
{ 0.0f, 1.0f, 0.f },
{ 1.0f, 1.0f } }
vk::vertex_input{ .position = { -0.5f, -0.5f, 0.f },
.color = { 1.0f, 0.0f, 0.0f },
.normals = { 1.0f, 0.0f, 0.f },
.uv = { 1.0f, 0.0f } },
vk::vertex_input{ .position = { 0.5f, -0.5f, 0.f },
.color = { 0.0f, 1.0f, 0.0f },
.normals = { 0.0f, 0.0f, 0.f },
.uv = { 0.0f, 0.0f } },
vk::vertex_input{ .position = { 0.5f, 0.5f, 0.f },
.color = { 0.0f, 0.0f, 1.0f },
.normals = { 0.0f, 1.0f, 0.f },
.uv = { 0.0f, 1.0f } },
vk::vertex_input{ .position = { -0.5f, 0.5f, 0.f },
.color = { 1.0f, 1.0f, 1.0f },
.normals = { 1.0f, 1.0f, 0.f },
.uv = { 1.0f, 1.0f } },

vk::vertex_input{ .position = { -0.5f, -0.5f, -0.5f },
.color = { 1.0f, 0.0f, 0.0f },
.normals = { 0.0f, 0.0f, 0.f },
.uv = { 1.0f, 0.0f } },
vk::vertex_input{ .position = { 0.5f, -0.5f, -0.5f },
.color = { 0.0f, 1.0f, 0.0f },
.normals = { 1.0f, 0.0f, 0.f },
.uv = { 0.0f, 0.0f } },
vk::vertex_input{ .position = { 0.5f, 0.5f, -0.5f },
.color = { 0.0f, 0.0f, 1.0f },
.normals = { 1.0f, 1.0f, 0.f },
.uv = { 0.0f, 1.0f } },
vk::vertex_input{ .position = { -0.5f, 0.5f, -0.5f },
.color = { 1.0f, 1.0f, 1.0f },
.normals = { 0.0f, 1.0f, 0.f },
.uv = { 1.0f, 1.0f } }
};
vk::vertex_params vertex_info = {
.phsyical_memory_properties = physical_device.memory_properties(),
Expand Down
27 changes: 21 additions & 6 deletions demos/12-loading-models/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,10 @@ main() {

// setting up physical device
// TODO: Probably enforce the use of
// vk::enumerate_physical_device({.device_type = vk::physical::discrete})
// vk::enumerate_physical_device({.device_type =
// vk::physical_gpu::discrete})
vk::physical_enumeration enumerate_devices{
.device_type = vk::physical::discrete,
.device_type = vk::physical_gpu::discrete,
};
vk::physical_device physical_device(api_instance, enumerate_devices);

Expand Down Expand Up @@ -384,7 +385,8 @@ main() {
uint32_t mip_levels = 1;
for (uint32_t i = 0; i < swapchain_images.size(); i++) {
vk::image_params swapchain_image_config = {
.extent = { swapchain_extent.width, swapchain_extent.width },
.extent = { .width = swapchain_extent.width,
.height = swapchain_extent.height },
.format = surface_properties.format.format,
.aspect = vk::image_aspect_flags::color_bit,
.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
Expand All @@ -398,7 +400,8 @@ main() {

// Creating Images for depth buffering
vk::image_params image_config = {
.extent = { swapchain_extent.width, swapchain_extent.width },
.extent = { .width = swapchain_extent.width,
.height = swapchain_extent.height },
.format = depth_format,
.aspect = vk::image_aspect_flags::depth_bit,
.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
Expand Down Expand Up @@ -584,12 +587,24 @@ main() {

std::array<VkDescriptorSetLayout, 1> layouts = { set0_resource.layout() };

vk::pipeline_settings pipeline_configuration = {
std::array<vk::color_blend_attachment_state, 1> color_blend_attachments = {
vk::color_blend_attachment_state{},
};

std::array<vk::dynamic_state, 2> dynamic_states = {
vk::dynamic_state::viewport, vk::dynamic_state::scissor
};
vk::pipeline_params pipeline_configuration = {
.renderpass = main_renderpass,
.shader_modules = geometry_resource.handles(),
.vertex_attributes = geometry_resource.vertex_attributes(),
.vertex_bind_attributes = geometry_resource.vertex_bind_attributes(),
.descriptor_layouts = layouts
.descriptor_layouts = layouts,
.color_blend = {
.attachments = color_blend_attachments,
},
.depth_stencil_enabled = true,
.dynamic_states = dynamic_states,
};
vk::pipeline main_graphics_pipeline(logical_device, pipeline_configuration);

Expand Down
11 changes: 7 additions & 4 deletions demos/13-skybox/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,10 @@ main() {

// setting up physical device
// TODO: Probably enforce the use of
// vk::enumerate_physical_device({.device_type = vk::physical::discrete})
// vk::enumerate_physical_device({.device_type =
// vk::physical_gpu::discrete})
vk::physical_enumeration enumerate_devices{ .device_type =
vk::physical::discrete };
vk::physical_gpu::discrete };
vk::physical_device physical_device(api_instance, enumerate_devices);

// selecting depth format
Expand Down Expand Up @@ -404,7 +405,8 @@ main() {
for (uint32_t i = 0; i < swapchain_images.size(); i++) {

vk::image_params swapchain_image_config = {
.extent = { swapchain_extent.width, swapchain_extent.width },
.extent = { .width = swapchain_extent.width,
.height = swapchain_extent.height },
.format = surface_properties.format.format,
.aspect = vk::image_aspect_flags::color_bit,
.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
Expand All @@ -418,7 +420,8 @@ main() {

// Creating Images for depth buffering
vk::image_params image_config = {
.extent = { swapchain_extent.width, swapchain_extent.width },
.extent = { .width = swapchain_extent.width,
.height = swapchain_extent.height },
.format = depth_format,
.aspect = vk::image_aspect_flags::depth_bit,
.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
Expand Down
4 changes: 2 additions & 2 deletions demos/2-physical-device/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It is required before you select a vulkan physical device, that you must HAVE a
There are different types of physical devices:

* `vk::physical::integrated` - the device is one embedded or tightly coupled with the host.
* `vk::physical::discrete` - the device is typically a separated processor connected to the host via hyperlink
* `vk::physical_gpu::discrete` - the device is typically a separated processor connected to the host via hyperlink
* `vk::physical::virtualized` - the device typically is a virtual node in a virtualization environment
* `vk::physical::cpu` - device is typically running on the same processor as the host
* `vk::physical::other` - device is typically running on same procesors as the host
Expand All @@ -35,7 +35,7 @@ vk::instance api_instance(/* set params */);

// select a physical device type
vk::physical_params params = {
.device_type = vk::physical::discrete
.device_type = vk::physical_gpu::discrete
};

vk::physical_device selected_device(api_instance, params);
Expand Down
2 changes: 1 addition & 1 deletion demos/2-physical-device/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ main() {

// setting up physical device
vk::physical_enumeration enumerate_devices{ .device_type =
vk::physical::discrete };
vk::physical_gpu::discrete };

vk::physical_device device(api_instance, enumerate_devices);

Expand Down
2 changes: 1 addition & 1 deletion demos/3-logical-device/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ main() {

// setting up physical device
vk::physical_enumeration enumerate_devices{
.device_type = vk::physical::discrete,
.device_type = vk::physical_gpu::discrete,
};
vk::physical_device physical_device(api_instance, enumerate_devices);

Expand Down
2 changes: 1 addition & 1 deletion demos/4-surface/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ main() {

// setting up physical device
vk::physical_enumeration enumerate_devices{
.device_type = vk::physical::discrete,
.device_type = vk::physical_gpu::discrete,
};
vk::physical_device physical_device(api_instance, enumerate_devices);

Expand Down
Loading
Loading