Loading materials and textures
This commit is contained in:
20
src/engine/QueueSharingMode.zig
Normal file
20
src/engine/QueueSharingMode.zig
Normal file
@@ -0,0 +1,20 @@
|
||||
const QueueSharingMode = @This();
|
||||
|
||||
const vk = @import("vulkan");
|
||||
|
||||
threadlocal var qsm: QueueSharingMode = undefined;
|
||||
|
||||
buffer: [2]u32,
|
||||
sharing_mode: vk.SharingMode,
|
||||
queue_family_index_count: u32,
|
||||
p_queue_family_indices: ?[*]const u32,
|
||||
|
||||
pub fn resolve(a: u32, b: u32) *const QueueSharingMode {
|
||||
const self = &qsm;
|
||||
const same = a == b;
|
||||
self.buffer = .{ a, b };
|
||||
self.sharing_mode = if (same) .exclusive else .concurrent;
|
||||
self.queue_family_index_count = if (same) 0 else 2;
|
||||
self.p_queue_family_indices = if (same) null else &self.buffer;
|
||||
return self;
|
||||
}
|
||||
Reference in New Issue
Block a user