Skip to content

Commit 4ba9a3b

Browse files
committed
Fix compilation with VULKAN_HPP_TYPESAFE_CONVERSION=0
Fixes #81
1 parent c0eabc4 commit 4ba9a3b

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.github/workflows/build-custom-vulkan.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,5 @@ jobs:
125125
run: build ${{env.vk || env.modules && 'v1.4.344' || 'v1.4.327'}} -DVULKAN_HPP_NO_SMART_HANDLE
126126
- if: ${{!cancelled()}}
127127
run: build ${{env.vk || env.modules && 'v1.4.344' || 'v1.4.327'}} -DVULKAN_HPP_USE_REFLECT -DVULKAN_HPP_HANDLES_MOVE_EXCHANGE
128+
- if: ${{!cancelled()}}
129+
run: build ${{env.vk || env.modules && 'v1.4.344' || 'v1.4.327'}} -DVULKAN_HPP_TYPESAFE_CONVERSION=0

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)