fixing CI
This commit is contained in:
@@ -15,6 +15,6 @@ pub const DEVICE_ID = 0x600DCAFE;
|
||||
|
||||
pub const std_options = base.std_options;
|
||||
|
||||
comptime {
|
||||
_ = base;
|
||||
test {
|
||||
std.testing.refAllDeclsRecursive(@This());
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const vk = @import("vulkan");
|
||||
const VkError = @import("error_set.zig").VkError;
|
||||
const Dispatchable = @import("Dispatchable.zig").Dispatchable;
|
||||
@@ -7,8 +8,10 @@ const PhysicalDevice = @import("PhysicalDevice.zig");
|
||||
const root = @import("root");
|
||||
|
||||
comptime {
|
||||
if (!@hasDecl(root, "VULKAN_VERSION")) {
|
||||
@compileError("Missing VULKAN_VERSION in module root");
|
||||
if (!builtin.is_test) {
|
||||
if (!@hasDecl(root, "VULKAN_VERSION")) {
|
||||
@compileError("Missing VULKAN_VERSION in module root");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +53,11 @@ pub fn enumerateExtensionProperties(layer_name: ?[]const u8, property_count: *u3
|
||||
}
|
||||
|
||||
pub fn enumerateVersion(version: *u32) VkError!void {
|
||||
version.* = @bitCast(root.VULKAN_VERSION);
|
||||
if (!builtin.is_test) {
|
||||
version.* = @bitCast(root.VULKAN_VERSION);
|
||||
} else {
|
||||
version.* = @bitCast(vk.makeApiVersion(0, 1, 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
pub fn releasePhysicalDevices(self: *Self, allocator: std.mem.Allocator) VkError!void {
|
||||
|
||||
@@ -40,7 +40,3 @@ pub inline fn getLogVerboseLevel() LogVerboseLevel {
|
||||
comptime {
|
||||
_ = lib_vulkan;
|
||||
}
|
||||
|
||||
test {
|
||||
std.testing.refAllDeclsRecursive(@This());
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ const std = @import("std");
|
||||
const vk = @import("vulkan");
|
||||
const root = @import("root");
|
||||
const lib = @import("lib.zig");
|
||||
const builtin = @import("builtin");
|
||||
|
||||
const logger = @import("logger.zig");
|
||||
const error_set = @import("error_set.zig");
|
||||
@@ -124,8 +125,11 @@ pub export fn strollCreateInstance(p_infos: ?*const vk.InstanceCreateInfo, callb
|
||||
|
||||
const allocator = VulkanAllocator.init(callbacks, .instance).allocator();
|
||||
|
||||
// Will call impl instead of interface as root refs the impl module
|
||||
const instance = root.Instance.create(allocator, infos) catch |err| return toVkResult(err);
|
||||
var instance: *lib.Instance = undefined;
|
||||
if (!builtin.is_test) {
|
||||
// Will call impl instead of interface as root refs the impl module
|
||||
instance = root.Instance.create(allocator, infos) catch |err| return toVkResult(err);
|
||||
}
|
||||
instance.requestPhysicalDevices(allocator) catch |err| return toVkResult(err);
|
||||
|
||||
p_instance.* = (Dispatchable(Instance).wrap(allocator, instance) catch |err| return toVkResult(err)).toVkHandle(vk.Instance);
|
||||
|
||||
@@ -5,11 +5,10 @@ const root = @import("root");
|
||||
const lib = @import("lib.zig");
|
||||
|
||||
comptime {
|
||||
if (!@hasDecl(root, "DRIVER_NAME")) {
|
||||
@compileError("Missing DRIVER_NAME in module root");
|
||||
}
|
||||
if (!@hasDecl(root, "DRIVER_LOGS_ENV_NAME")) {
|
||||
@compileError("Missing DRIVER_LOGS_ENV_NAME in module root");
|
||||
if (!builtin.is_test) {
|
||||
if (!@hasDecl(root, "DRIVER_NAME")) {
|
||||
@compileError("Missing DRIVER_NAME in module root");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +66,10 @@ pub fn log(comptime level: std.log.Level, comptime scope: @Type(.enum_literal),
|
||||
|
||||
out_config.setColor(writer, .magenta) catch {};
|
||||
writer.print("[StrollDriver ", .{}) catch return;
|
||||
out_config.setColor(writer, .cyan) catch {};
|
||||
writer.print(root.DRIVER_NAME, .{}) catch return;
|
||||
if (!builtin.is_test) {
|
||||
out_config.setColor(writer, .cyan) catch {};
|
||||
writer.print(root.DRIVER_NAME, .{}) catch return;
|
||||
}
|
||||
out_config.setColor(writer, .yellow) catch {};
|
||||
writer.print(" {d:02}:{d:02}:{d:02}.{d:03}", .{ now.hour, now.minute, now.second, @divFloor(now.nanosecond, std.time.ns_per_ms) }) catch return;
|
||||
out_config.setColor(writer, .magenta) catch {};
|
||||
|
||||
Reference in New Issue
Block a user