test
This commit is contained in:
@@ -34,6 +34,7 @@ const RunningMode = enum {
|
|||||||
const LogType = enum {
|
const LogType = enum {
|
||||||
none,
|
none,
|
||||||
standard,
|
standard,
|
||||||
|
debug,
|
||||||
verbose,
|
verbose,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ pub fn draw(self: *Self, vertex_count: usize, instance_count: usize, first_verte
|
|||||||
defer if (comptime base.config.logs != .none) {
|
defer if (comptime base.config.logs != .none) {
|
||||||
const duration = timer.untilNow(io, .real);
|
const duration = timer.untilNow(io, .real);
|
||||||
const ms = duration.toMicroseconds();
|
const ms = duration.toMicroseconds();
|
||||||
std.log.scoped(.SoftwareRenderer).debug("Drawcall stats:\n> Took {d}us\n> Allocated {d} KB", .{ ms, @divTrunc(arena.queryCapacity(), 1000) });
|
std.log.scoped(.SoftwareRenderer).warn("Drawcall stats:\n> Took {d}us\n> Allocated {d} KB", .{ ms, @divTrunc(arena.queryCapacity(), 1000) });
|
||||||
};
|
};
|
||||||
|
|
||||||
self.vertexShaderStage(allocator, &draw_call, vertex_count, instance_count, first_vertex, first_instance, null) catch |err| {
|
self.vertexShaderStage(allocator, &draw_call, vertex_count, instance_count, first_vertex, first_instance, null) catch |err| {
|
||||||
@@ -137,7 +137,7 @@ pub fn drawIndexed(self: *Self, index_count: usize, instance_count: usize, first
|
|||||||
defer if (comptime base.config.logs != .none) {
|
defer if (comptime base.config.logs != .none) {
|
||||||
const duration = timer.untilNow(io, .real);
|
const duration = timer.untilNow(io, .real);
|
||||||
const ms = duration.toMicroseconds();
|
const ms = duration.toMicroseconds();
|
||||||
std.log.scoped(.SoftwareRenderer).debug("Drawcall indexed stats:\n> Took {d}us\n> Allocated {d} KB", .{ ms, @divTrunc(arena.queryCapacity(), 1000) });
|
std.log.scoped(.SoftwareRenderer).warn("Drawcall indexed stats:\n> Took {d}us\n> Allocated {d} KB", .{ ms, @divTrunc(arena.queryCapacity(), 1000) });
|
||||||
};
|
};
|
||||||
|
|
||||||
self.vertexShaderStage(allocator, &draw_call, index_count, instance_count, 0, first_instance, indices) catch |err| {
|
self.vertexShaderStage(allocator, &draw_call, index_count, instance_count, 0, first_instance, indices) catch |err| {
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ pub fn log(comptime level: std.log.Level, comptime scope: @EnumLiteral(), compti
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (comptime (lib.config.logs != .debug or lib.config.logs != .verbose) and (level == .info or level == .debug)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const io = std.Options.debug_io;
|
const io = std.Options.debug_io;
|
||||||
|
|
||||||
const scope_name = @tagName(scope);
|
const scope_name = @tagName(scope);
|
||||||
|
|||||||
Reference in New Issue
Block a user