Skip to content

Commit e8dc377

Browse files
committed
switch to fixed default device heap
1 parent 393ad1b commit e8dc377

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

rvk/instance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static VkBool32 debug_callback(VkDebugUtilsMessageSeverityFlagBitsEXT sev,
112112
if(is_error) RPP_DEBUG_BREAK;
113113
#endif
114114

115-
return is_error;
115+
return false;
116116
}
117117

118118
Slice<const char*> Instance::baseline_extensions() {

rvk/rvk.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ Vk::Vk(Config config) {
199199
if(heap_size < Math::MB(128)) {
200200
die("[rvk] Device heap is too small: %mb / 128mb.", heap_size / Math::MB(1));
201201
}
202-
if(config.device_heap_margin > heap_size) {
203-
warn("[rvk] Requested device heap margin is larger than the heap, using 64mb margin.");
204-
config.device_heap_margin = Math::MB(64);
202+
if(config.device_heap > heap_size) {
203+
warn("[rvk] Requested device margin is larger than available, using entire heap.");
204+
config.device_heap = heap_size;
205205
}
206206

207207
u64 allocated = 0;
208-
u64 target = device->heap_size(Heap::device) - config.device_heap_margin;
208+
u64 target = config.device_heap;
209209
while(allocated < target) {
210210
u64 size = Math::min(target - allocated, physical_device->max_allocation());
211211
device_memories.push(

rvk/rvk.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct Config {
3838
Function<VkSurfaceKHR(VkInstance)> create_surface;
3939

4040
u64 host_heap = Math::GB(1);
41-
u64 device_heap_margin = Math::GB(1);
41+
u64 device_heap = Math::MB(4094);
4242
};
4343

4444
bool startup(Config config);
@@ -118,13 +118,13 @@ void submit(Commands& cmds, u32 index, Slice<const Sem_Ref> wait, Slice<const Se
118118

119119
template<typename F>
120120
requires Invocable<F, Commands&>
121-
auto sync(F&& f, Queue_Family family = Queue_Family::graphics, u32 index = 0)
122-
-> Invoke_Result<F, Commands&>;
121+
auto sync(F&& f, Queue_Family family = Queue_Family::graphics,
122+
u32 index = 0) -> Invoke_Result<F, Commands&>;
123123

124124
template<typename F>
125125
requires Invocable<F, Commands&>
126-
auto async(Async::Pool<>& pool, F&& f, Queue_Family family = Queue_Family::graphics, u32 index = 0)
127-
-> Async::Task<Invoke_Result<F, Commands&>>;
126+
auto async(Async::Pool<>& pool, F&& f, Queue_Family family = Queue_Family::graphics,
127+
u32 index = 0) -> Async::Task<Invoke_Result<F, Commands&>>;
128128

129129
} // namespace rvk
130130

0 commit comments

Comments
 (0)