Skip to content

Commit 252cd0a

Browse files
committed
fixup: Avoid mixing C++ and C Vulkan types
1 parent fa56c0b commit 252cd0a

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

code/graphics/vulkan/VulkanMemory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ void VulkanMemoryManager::unmapMemory(VulkanAllocation& allocation)
282282
allocation.mappedPtr = nullptr;
283283
}
284284

285-
void VulkanMemoryManager::flushMemory(const VulkanAllocation& allocation, VkDeviceSize offset, VkDeviceSize size)
285+
void VulkanMemoryManager::flushMemory(const VulkanAllocation& allocation, vk::DeviceSize offset, vk::DeviceSize size)
286286
{
287287
if (!m_initialized || allocation.memory == VK_NULL_HANDLE) {
288288
return;
@@ -302,7 +302,7 @@ void VulkanMemoryManager::flushMemory(const VulkanAllocation& allocation, VkDevi
302302
m_device.flushMappedMemoryRanges(range);
303303
}
304304

305-
void VulkanMemoryManager::invalidateMemory(const VulkanAllocation& allocation, VkDeviceSize offset, VkDeviceSize size)
305+
void VulkanMemoryManager::invalidateMemory(const VulkanAllocation& allocation, vk::DeviceSize offset, vk::DeviceSize size)
306306
{
307307
if (!m_initialized || allocation.memory == VK_NULL_HANDLE) {
308308
return;

code/graphics/vulkan/VulkanMemory.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class VulkanRenderer;
1414
* @brief Memory allocation info returned when allocating GPU memory
1515
*/
1616
struct VulkanAllocation {
17-
VkDeviceMemory memory = VK_NULL_HANDLE;
18-
VkDeviceSize offset = 0;
19-
VkDeviceSize size = 0;
17+
vk::DeviceMemory memory = VK_NULL_HANDLE;
18+
vk::DeviceSize offset = 0;
19+
vk::DeviceSize size = 0;
2020
void* mappedPtr = nullptr; // Non-null if memory is mapped
2121
uint32_t memoryTypeIndex = 0;
2222
bool dedicated = false; // True if this is a dedicated allocation
@@ -104,15 +104,15 @@ class VulkanMemoryManager {
104104
* @param offset Offset within the allocation
105105
* @param size Size of the range to flush (VK_WHOLE_SIZE for entire allocation)
106106
*/
107-
void flushMemory(const VulkanAllocation& allocation, VkDeviceSize offset, VkDeviceSize size);
107+
void flushMemory(const VulkanAllocation& allocation, vk::DeviceSize offset, vk::DeviceSize size);
108108

109109
/**
110110
* @brief Invalidate mapped memory to make GPU writes visible to CPU
111111
* @param allocation The allocation containing the range to invalidate
112112
* @param offset Offset within the allocation
113113
* @param size Size of the range to invalidate (VK_WHOLE_SIZE for entire allocation)
114114
*/
115-
void invalidateMemory(const VulkanAllocation& allocation, VkDeviceSize offset, VkDeviceSize size);
115+
void invalidateMemory(const VulkanAllocation& allocation, vk::DeviceSize offset, vk::DeviceSize size);
116116

117117
/**
118118
* @brief Get memory statistics

0 commit comments

Comments
 (0)