Skip to content

Commit 1ae23fa

Browse files
committed
Use uint64 for Buffer offset and size
1 parent cf54f53 commit 1ae23fa

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/engine/renderer-vulkan/GraphicsCore/ExecutionGraph/ExecutionGraph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ struct BufferNode {
194194
uint8 id;
195195
uint16 bufferID;
196196
BufferSrc src = BUFFER_EXECUTION_GRAPH;
197-
uint32 size;
197+
uint64 size;
198198
uint32 usage;
199199
uint32 heap;
200200
};

src/engine/renderer-vulkan/GraphicsCore/Memory/EngineAllocator.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ Buffer EngineAllocator::AllocBuffer( const MemoryHeap::MemoryType type, MemoryPo
296296
vkBindBufferMemory2( device, 1, &bindInfo );
297297

298298
Buffer res {
299-
.buffer = buffer,
300-
.offset = ( uint32 ) ( address - ( uint64 ) pool.memory ),
301-
.size = ( uint32 ) reqs.size,
302-
.usage = bufferInfo.usage
299+
.buffer = buffer,
300+
.offset = address - ( uint64 ) pool.memory,
301+
.size = reqs.size,
302+
.usage = bufferInfo.usage
303303
};
304304

305305
MemoryHeap& heap = MemoryHeapFromType( type );
@@ -317,7 +317,7 @@ Buffer EngineAllocator::AllocBuffer( const MemoryHeap::MemoryType type, MemoryPo
317317
return res;
318318
}
319319

320-
Buffer EngineAllocator::AllocDedicatedBuffer( const MemoryHeap::MemoryType type, const uint32 size, const VkBufferUsageFlags usage ) {
320+
Buffer EngineAllocator::AllocDedicatedBuffer( const MemoryHeap::MemoryType type, const uint64 size, const VkBufferUsageFlags usage ) {
321321
MemoryPool pool;
322322

323323
MemoryRequirements reqs = GetBufferRequirements( usage, size );

src/engine/renderer-vulkan/GraphicsCore/Memory/EngineAllocator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ struct MemoryRegionUsage {
7373
struct Buffer {
7474
VkBuffer buffer;
7575

76-
uint32 offset;
77-
uint32 size;
76+
uint64 offset;
77+
uint64 size;
7878

7979
uint32 usage;
8080

@@ -114,7 +114,7 @@ class EngineAllocator {
114114
MemoryPool AllocMemoryPool( const MemoryHeap::MemoryType type, const uint64 size, const bool image, const void* dedicatedResource = nullptr );
115115

116116
Buffer AllocBuffer( const MemoryHeap::MemoryType type, MemoryPool& pool, const MemoryRequirements& reqs, const VkBufferUsageFlags flags );
117-
Buffer AllocDedicatedBuffer( const MemoryHeap::MemoryType type, const uint32 size, const VkBufferUsageFlags flags );
117+
Buffer AllocDedicatedBuffer( const MemoryHeap::MemoryType type, const uint64 size, const VkBufferUsageFlags flags );
118118

119119

120120
private:

0 commit comments

Comments
 (0)