implementing imulextend and umulextend
This commit is contained in:
@@ -62,7 +62,10 @@ fn alloc(context: *anyopaque, len: usize, alignment: Alignment, ret_addr: usize)
|
||||
|
||||
if (self.callbacks) |callbacks| {
|
||||
if (callbacks.pfn_allocation) |pfn_allocation| {
|
||||
return @ptrCast(pfn_allocation(self.callbacks.?.p_user_data, len, alignment.toByteUnits(), self.scope));
|
||||
const ptr: ?[*]u8 = @ptrCast(pfn_allocation(self.callbacks.?.p_user_data, len, alignment.toByteUnits(), self.scope));
|
||||
//std.debug.print("test {*}\n", .{ptr});
|
||||
//std.debug.dumpCurrentStackTrace(.{});
|
||||
return ptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const std = @import("std");
|
||||
const vk = @import("vulkan");
|
||||
const lib = @import("lib.zig");
|
||||
|
||||
pub const VkError = error{
|
||||
NotReady,
|
||||
@@ -58,10 +59,20 @@ pub const VkError = error{
|
||||
|
||||
pub inline fn errorLogger(err: VkError) void {
|
||||
std.log.scoped(.errorLogger).err("Error logger catched a '{s}'", .{@errorName(err)});
|
||||
if (comptime lib.config.logs == .verbose) {
|
||||
if (@errorReturnTrace()) |trace| {
|
||||
std.debug.dumpErrorReturnTrace(trace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub inline fn errorLoggerContext(err: VkError, context: []const u8) void {
|
||||
std.log.scoped(.errorLogger).err("Error logger catched a '{s}' in {s}", .{ @errorName(err), context });
|
||||
if (comptime lib.config.logs == .verbose) {
|
||||
if (@errorReturnTrace()) |trace| {
|
||||
std.debug.dumpErrorReturnTrace(trace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub inline fn toVkResult(err: VkError) vk.Result {
|
||||
|
||||
@@ -14,14 +14,14 @@ comptime {
|
||||
var mutex: std.Io.Mutex = .init;
|
||||
|
||||
pub inline fn fixme(comptime format: []const u8, args: anytype) void {
|
||||
if (comptime !lib.config.logs) {
|
||||
if (comptime lib.config.logs == .none) {
|
||||
return;
|
||||
}
|
||||
std.log.scoped(.FIXME).warn("FIXME: " ++ format, args);
|
||||
}
|
||||
|
||||
pub fn log(comptime level: std.log.Level, comptime scope: @EnumLiteral(), comptime format: []const u8, args: anytype) void {
|
||||
if (comptime !lib.config.logs) {
|
||||
if (comptime lib.config.logs == .none) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user