From 53638a5dac0a839f184b7ed72485d758f7515532 Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Sun, 10 May 2026 02:09:28 +0200 Subject: [PATCH] test --- build.zig | 1 + src/soft/device/Renderer.zig | 4 ++-- src/vulkan/logger.zig | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index 207ac30..577b747 100644 --- a/build.zig +++ b/build.zig @@ -34,6 +34,7 @@ const RunningMode = enum { const LogType = enum { none, standard, + debug, verbose, }; diff --git a/src/soft/device/Renderer.zig b/src/soft/device/Renderer.zig index 63aa109..0229ed6 100644 --- a/src/soft/device/Renderer.zig +++ b/src/soft/device/Renderer.zig @@ -110,7 +110,7 @@ pub fn draw(self: *Self, vertex_count: usize, instance_count: usize, first_verte defer if (comptime base.config.logs != .none) { const duration = timer.untilNow(io, .real); 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| { @@ -137,7 +137,7 @@ pub fn drawIndexed(self: *Self, index_count: usize, instance_count: usize, first defer if (comptime base.config.logs != .none) { const duration = timer.untilNow(io, .real); 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| { diff --git a/src/vulkan/logger.zig b/src/vulkan/logger.zig index 0825eea..39738bb 100644 --- a/src/vulkan/logger.zig +++ b/src/vulkan/logger.zig @@ -25,6 +25,10 @@ pub fn log(comptime level: std.log.Level, comptime scope: @EnumLiteral(), compti 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 scope_name = @tagName(scope);