Skip to content

Commit e0a1d1b

Browse files
committed
Fix compilation with VULKAN_HPP_TYPESAFE_CONVERSION=0
Fixes #81
1 parent 3fd234d commit e0a1d1b

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
cmake "${FLAGS[@]}" -DCMAKE_CXX_FLAGS="$CXX_FLAGS -DVULKAN_HPP_NO_SMART_HANDLE"
9696
cmake --build build --clean-first
9797
98-
cmake "${FLAGS[@]}" -DCMAKE_CXX_FLAGS="$CXX_FLAGS -DVULKAN_HPP_NO_EXCEPTIONS -DVULKAN_HPP_USE_REFLECT -DVULKAN_HPP_HANDLES_MOVE_EXCHANGE"
98+
cmake "${FLAGS[@]}" -DCMAKE_CXX_FLAGS="$CXX_FLAGS -DVULKAN_HPP_NO_EXCEPTIONS -DVULKAN_HPP_USE_REFLECT -DVULKAN_HPP_HANDLES_MOVE_EXCHANGE -DVULKAN_HPP_TYPESAFE_CONVERSION=0"
9999
cmake --build build --clean-first
100100
101101
echo Building with latest Vulkan...
@@ -105,7 +105,7 @@ jobs:
105105
cmake "${FLAGS[@]}" -DCMAKE_CXX_FLAGS="$CXX_FLAGS -DVULKAN_HPP_NO_SMART_HANDLE"
106106
cmake --build build --clean-first
107107
108-
cmake "${FLAGS[@]}" -DCMAKE_CXX_FLAGS="$CXX_FLAGS -DVULKAN_HPP_NO_EXCEPTIONS -DVULKAN_HPP_USE_REFLECT -DVULKAN_HPP_HANDLES_MOVE_EXCHANGE"
108+
cmake "${FLAGS[@]}" -DCMAKE_CXX_FLAGS="$CXX_FLAGS -DVULKAN_HPP_NO_EXCEPTIONS -DVULKAN_HPP_USE_REFLECT -DVULKAN_HPP_HANDLES_MOVE_EXCHANGE -DVULKAN_HPP_TYPESAFE_CONVERSION=0"
109109
cmake --build build --clean-first
110110
111111
mv VulkanMemoryAllocator/include/vk_mem_alloc.h include

VmaHppGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ void generateHandles(const Source& source, Symbols& symbols) {
19441944
using UniqueBase::UniqueBase;
19451945
protected:
19461946
template <typename T> void destroy(T t) VULKAN_HPP_NOEXCEPT {
1947-
vmaDestroyBuffer(getOwner(), t, nullptr);
1947+
vmaDestroyBuffer(static_cast<VmaAllocator>(getOwner()), static_cast<VkBuffer>(t), nullptr);
19481948
}
19491949
};
19501950
};
@@ -1955,7 +1955,7 @@ void generateHandles(const Source& source, Symbols& symbols) {
19551955
using UniqueBase::UniqueBase;
19561956
protected:
19571957
template <typename T> void destroy(T t) VULKAN_HPP_NOEXCEPT {
1958-
vmaDestroyImage(getOwner(), t, nullptr);
1958+
vmaDestroyImage(static_cast<VmaAllocator>(getOwner()), static_cast<VkImage>(t), nullptr);
19591959
}
19601960
};
19611961
};

include/vk_mem_alloc_handles.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ namespace VULKAN_HPP_NAMESPACE {
12901290
using UniqueBase::UniqueBase;
12911291
protected:
12921292
template <typename T> void destroy(T t) VULKAN_HPP_NOEXCEPT {
1293-
vmaDestroyBuffer(getOwner(), t, nullptr);
1293+
vmaDestroyBuffer(static_cast<VmaAllocator>(getOwner()), static_cast<VkBuffer>(t), nullptr);
12941294
}
12951295
};
12961296
};
@@ -1301,7 +1301,7 @@ namespace VULKAN_HPP_NAMESPACE {
13011301
using UniqueBase::UniqueBase;
13021302
protected:
13031303
template <typename T> void destroy(T t) VULKAN_HPP_NOEXCEPT {
1304-
vmaDestroyImage(getOwner(), t, nullptr);
1304+
vmaDestroyImage(static_cast<VmaAllocator>(getOwner()), static_cast<VkImage>(t), nullptr);
13051305
}
13061306
};
13071307
};

samples/CompileCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void checkStructs() {
8484
void checkHandles() {
8585
vma::Allocator allocator;
8686
allocator = nullptr;
87-
allocator = static_cast<VmaAllocator>(VK_NULL_HANDLE);
87+
allocator = VK_NULL_HANDLE;
8888

8989
if (allocator) throw;
9090
if (!allocator) {}

0 commit comments

Comments
 (0)