fixing lots of minor issues
This commit is contained in:
@@ -12,8 +12,6 @@ interface: Interface,
|
||||
mutex: std.Thread.Mutex,
|
||||
condition: std.Thread.Condition,
|
||||
is_signaled: std.atomic.Value(bool),
|
||||
/// Used by impl queues to know when the fence should be signaled
|
||||
concurrent_submits_count: std.atomic.Value(usize),
|
||||
|
||||
pub fn create(device: *Device, allocator: std.mem.Allocator, info: *const vk.FenceCreateInfo) VkError!*Self {
|
||||
const self = allocator.create(Self) catch return VkError.OutOfHostMemory;
|
||||
@@ -34,7 +32,6 @@ pub fn create(device: *Device, allocator: std.mem.Allocator, info: *const vk.Fen
|
||||
.mutex = std.Thread.Mutex{},
|
||||
.condition = std.Thread.Condition{},
|
||||
.is_signaled = std.atomic.Value(bool).init(info.flags.signaled_bit),
|
||||
.concurrent_submits_count = std.atomic.Value(usize).init(0),
|
||||
};
|
||||
return self;
|
||||
}
|
||||
@@ -46,7 +43,7 @@ pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) void {
|
||||
|
||||
pub fn getStatus(interface: *Interface) VkError!void {
|
||||
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
||||
if (!self.is_signaled.load(.monotonic)) {
|
||||
if (!self.is_signaled.load(.acquire)) {
|
||||
return VkError.NotReady;
|
||||
}
|
||||
}
|
||||
@@ -64,7 +61,7 @@ pub fn signal(interface: *Interface) VkError!void {
|
||||
|
||||
pub fn wait(interface: *Interface, timeout: u64) VkError!void {
|
||||
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
||||
if (self.is_signaled.load(.monotonic)) return;
|
||||
if (self.is_signaled.load(.acquire)) return;
|
||||
if (timeout == 0) return VkError.Timeout;
|
||||
|
||||
self.mutex.lock();
|
||||
|
||||
Reference in New Issue
Block a user