Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ jobs:
uses: engine3d-dev/ci/.github/workflows/windows.yml@main
with:
package_name: "vulkan-cpp"
version: "6.1"
version: "6.2"
secrets: inherit

linux:
uses: engine3d-dev/ci/.github/workflows/linux.yml@main
with:
package_name: "vulkan-cpp"
version: "6.1"
version: "6.2"
secrets: inherit

mac:
uses: engine3d-dev/ci/.github/workflows/mac.yml@main
with:
package_name: "vulkan-cpp"
version: "6.1"
version: "6.2"
secrets: inherit
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:
uses: engine3d-dev/ci/.github/workflows/deploy_windows.yml@main
with:
package_name: "vulkan-cpp"
version: "6.1"
version: "6.2"
secrets: inherit

linux:
uses: engine3d-dev/ci/.github/workflows/deploy_linux.yml@main
with:
package_name: "vulkan-cpp"
version: "6.1"
version: "6.2"
secrets: inherit

mac:
uses: engine3d-dev/ci/.github/workflows/deploy_mac.yml@main
with:
package_name: "vulkan-cpp"
version: "6.1"
version: "6.2"
secrets: inherit
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 = "6.1"
version = "6.2"
license = "Apache-2.0"
url = "https://github.com/engine3d-dev/vulkan-cpp"
homepage = "https://github.com/engine3d-dev/vulkan-cpp"
Expand Down
2 changes: 1 addition & 1 deletion demos/1-instance/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/10-textures/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/11-depth-buffering/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/13-skybox/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/14-imgui/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/15-dynamic-rendering/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/16-descriptor-indexing/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/17-buffer-device-address/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ main() {
// setting up physical device

std::expected<vk::physical_device, VkResult> physical_device_expected =
api_instance.enumerate_physical_device(vk::physical_gpu::integrated);
api_instance.enumerate_physical_device(vk::physical_gpu::discrete);
vk::physical_device physical_device = physical_device_expected.value();

// setting up logical device
Expand Down
2 changes: 1 addition & 1 deletion demos/17-buffer-device-address/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/2-physical-device/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/3-logical-device/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/4-surface/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/5-swapchain/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/6-graphics-pipeline/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/7-vertex-buffer/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/8-index-uniform-buffers/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion demos/9-uniforms/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/6.1")
self.requires("vulkan-cpp/6.2")

def build(self):
cmake = CMake(self)
Expand Down
11 changes: 9 additions & 2 deletions vulkan-cpp/buffer.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module;
#include <span>
#include <vector>
#include <bit>
#include <limits>

export module vk:buffer;

Expand Down Expand Up @@ -63,8 +64,14 @@ export namespace vk {
m_device, m_handle, &memory_requirements);
uint32_t mapped_memory_requirements =
memory_requirements.memoryTypeBits & p_params.memory_mask;
uint32_t memory_index =
std::countr_zero(mapped_memory_requirements);
uint32_t memory_index = std::numeric_limits<uint32_t>::max();
if (mapped_memory_requirements != 0) {
memory_index = std::countr_zero(mapped_memory_requirements);
}
else {
memory_index =
std::countr_zero(memory_requirements.memoryTypeBits);
}

VkMemoryAllocateInfo memory_alloc_info = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
Expand Down
12 changes: 10 additions & 2 deletions vulkan-cpp/buffer32.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module;
#include <array>
#include <cstring>
#include <bit>
#include <limits>

export module vk:buffer32;

Expand Down Expand Up @@ -50,8 +51,15 @@ export namespace vk {
m_device, m_handle, &memory_requirements);
uint32_t mapped_memory_requirements =
memory_requirements.memoryTypeBits & p_params.memory_mask;
uint32_t memory_index =
std::countr_zero(mapped_memory_requirements);

uint32_t memory_index = std::numeric_limits<uint32_t>::max();
if (mapped_memory_requirements != 0) {
memory_index = std::countr_zero(mapped_memory_requirements);
}
else {
memory_index =
std::countr_zero(memory_requirements.memoryTypeBits);
}

VkMemoryAllocateInfo memory_alloc_info = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
Expand Down
64 changes: 38 additions & 26 deletions vulkan-cpp/dyn/buffer.cppm
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module;

#include <vulkan/vulkan.h>
#include <vector>
#include <span>
#include <bit>
#include <span>
#include <vector>
#include <vulkan/vulkan.h>
#include <limits>

export module vk:buffer_device_address;

Expand Down Expand Up @@ -56,8 +57,15 @@ export namespace vk::dyn {
m_device, m_handle, &memory_requirements);
uint32_t mapped_memory_requirements =
memory_requirements.memoryTypeBits & p_params.memory_mask;
uint32_t memory_index =
std::countr_zero(mapped_memory_requirements);

uint32_t memory_index = std::numeric_limits<uint32_t>::max();
if (mapped_memory_requirements != 0) {
memory_index = std::countr_zero(mapped_memory_requirements);
}
else {
memory_index =
std::countr_zero(memory_requirements.memoryTypeBits);
}

// Required to be set for buffer device addresses
VkMemoryAllocateInfo memory_alloc_info = {
Expand All @@ -83,26 +91,30 @@ export namespace vk::dyn {
for (uint32_t i = 0; i < image_copies.size(); i++) {
const buffer_image_copy image_copy = p_copies[i];
image_copies[i] = {
.bufferOffset = image_copy.offset,
.bufferRowLength = image_copy.row_length,
.bufferImageHeight = image_copy.image_height,
.imageSubresource = {
.aspectMask = static_cast<VkImageAspectFlags>(image_copy.aspect_mask),
.mipLevel = image_copy.mip_level,
.baseArrayLayer = image_copy.base_array_layer,
.layerCount = image_copy.layer_count,
},
.imageOffset = {
static_cast<int32_t>(image_copy.image_offset.width),
static_cast<int32_t>(image_copy.image_offset.height),
static_cast<int32_t>(image_copy.image_offset.depth),
},
.imageExtent = {
image_copy.image_extent.width,
image_copy.image_extent.height,
image_copy.image_extent.depth,
},
};
.bufferOffset = image_copy.offset,
.bufferRowLength = image_copy.row_length,
.bufferImageHeight = image_copy.image_height,
.imageSubresource =
{
.aspectMask =
static_cast<VkImageAspectFlags>(image_copy.aspect_mask),
.mipLevel = image_copy.mip_level,
.baseArrayLayer = image_copy.base_array_layer,
.layerCount = image_copy.layer_count,
},
.imageOffset =
{
static_cast<int32_t>(image_copy.image_offset.width),
static_cast<int32_t>(image_copy.image_offset.height),
static_cast<int32_t>(image_copy.image_offset.depth),
},
.imageExtent =
{
image_copy.image_extent.width,
image_copy.image_extent.height,
image_copy.image_extent.depth,
},
};
}

vkCmdCopyBufferToImage(p_command,
Expand Down Expand Up @@ -171,4 +183,4 @@ export namespace vk::dyn {
VkBuffer m_handle = nullptr;
VkDeviceMemory m_device_memory;
};
};
}; // namespace vk::dyn
11 changes: 9 additions & 2 deletions vulkan-cpp/sample_image.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module;
#include <span>
#include <vector>
#include <bit>
#include <limits>

export module vk:sample_image;

Expand Down Expand Up @@ -78,8 +79,14 @@ export namespace vk {
p_image_params.memory_mask;

// Retrieving the next available bits that have been mapped
uint32_t memory_index =
std::countr_zero(mapped_memory_requirements);
uint32_t memory_index = std::numeric_limits<uint32_t>::max();
if (mapped_memory_requirements != 0) {
memory_index = std::countr_zero(mapped_memory_requirements);
}
else {
memory_index =
std::countr_zero(memory_requirements.memoryTypeBits);
}

// 4. Allocate info
VkMemoryAllocateInfo memory_alloc_info = {
Expand Down
Loading