reorganize files a tad
This commit is contained in:
parent
49226a528f
commit
ca34198c6d
|
@ -0,0 +1,31 @@
|
|||
const settings = @import("settings");
|
||||
|
||||
const dev_standard = [_][*:0]u8{
|
||||
"KHR_swapchain",
|
||||
"EXT_memory_budget",
|
||||
"EXT_hdr_metadata",
|
||||
"KHR_shader_float16_int8",
|
||||
"KHR_16bit_storage",
|
||||
"KHR_push_descriptor",
|
||||
"EXT_memory_priority",
|
||||
"KHR_bind_memory2",
|
||||
"KHR_shader_float_controls",
|
||||
"KHR_spirv_1_4",
|
||||
"EXT_conditional_rendering",
|
||||
"KHR_draw_indirect_count",
|
||||
};
|
||||
|
||||
const dev_rt = if (settings.rt_on) [_][*:0]u8{
|
||||
"KHR_acceleration_structure",
|
||||
"KHR_ray_tracing_pipeline",
|
||||
"KHR_ray_query",
|
||||
"KHR_deferred_host_operations",
|
||||
} else {};
|
||||
|
||||
pub const dev = dev_standard ++ dev_rt;
|
||||
|
||||
pub const inst = [_][*:0]u8{
|
||||
"KHR_get_physical_device_properties2",
|
||||
"EXT_swapchain_colorspace",
|
||||
if (settings.messenger_on) "EXT_debug_utils" else void,
|
||||
};
|
|
@ -2,52 +2,15 @@ const std = @import("std");
|
|||
const vk = @import("vulkan");
|
||||
const glfw = @import("glfw");
|
||||
|
||||
const settings = @import("settings");
|
||||
const settings = @import("settings.zig");
|
||||
const extensions = @import("extensions.zig");
|
||||
const layers = @import("layers.zig").layers;
|
||||
|
||||
const DebugMessenger = @import("debug.zig").DebugMessenger;
|
||||
|
||||
// TODO temp allocator
|
||||
const allocator = std.heap.GeneralPurposeAllocator;
|
||||
|
||||
const Layers = struct {
|
||||
pub const enabled = [_][*:0]u8{
|
||||
if (settings.khronos_layer_on) "KHRONOS_validation" else void,
|
||||
if (settings.assist_layer_on) "LUNARG_assistant_layer" else void,
|
||||
};
|
||||
};
|
||||
|
||||
const Extensions = struct {
|
||||
const dev_standard = [_][*:0]u8{
|
||||
"KHR_swapchain",
|
||||
"EXT_memory_budget",
|
||||
"EXT_hdr_metadata",
|
||||
"KHR_shader_float16_int8",
|
||||
"KHR_16bit_storage",
|
||||
"KHR_push_descriptor",
|
||||
"EXT_memory_priority",
|
||||
"KHR_bind_memory2",
|
||||
"KHR_shader_float_controls",
|
||||
"KHR_spirv_1_4",
|
||||
"EXT_conditional_rendering",
|
||||
"KHR_draw_indirect_count",
|
||||
};
|
||||
|
||||
const dev_rt = if (settings.rt_on) [_][*:0]u8{
|
||||
"KHR_acceleration_structure",
|
||||
"KHR_ray_tracing_pipeline",
|
||||
"KHR_ray_query",
|
||||
"KHR_deferred_host_operations",
|
||||
} else {};
|
||||
|
||||
pub const dev = dev_standard ++ dev_rt;
|
||||
|
||||
pub const inst = [_][*:0]u8{
|
||||
"KHR_get_physical_device_properties2",
|
||||
"EXT_swapchain_colorspace",
|
||||
if (settings.messenger_on) "EXT_debug_utils" else void,
|
||||
};
|
||||
};
|
||||
|
||||
pub const Instance = struct {
|
||||
const Self = @This();
|
||||
|
||||
|
@ -122,7 +85,7 @@ pub const Instance = struct {
|
|||
fn getLayers(avail_layers: *std.StringArrayHashMap) !std.ArrayList([*:0]const u8) {
|
||||
const list = try std.ArrayList([*:0]const u8).init(allocator);
|
||||
|
||||
for (Layers.enabled) |ext| {
|
||||
for (layers.enabled) |ext| {
|
||||
if (avail_layers.contains(ext)) {
|
||||
list.append(ext);
|
||||
}
|
||||
|
@ -161,7 +124,7 @@ pub const Instance = struct {
|
|||
}
|
||||
}
|
||||
|
||||
for (Extensions.inst) |ext| {
|
||||
for (extensions.inst) |ext| {
|
||||
if (avail_exts.contains(ext)) {
|
||||
list.append(ext);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
const settings = @import("settings.zig");
|
||||
|
||||
pub const layers = [_][*:0]u8{
|
||||
if (settings.khronos_layer_on) "KHRONOS_validation" else void,
|
||||
if (settings.assist_layer_on) "LUNARG_assistant_layer" else void,
|
||||
};
|
|
@ -0,0 +1,9 @@
|
|||
// Compile-time settings for Vulkan.
|
||||
|
||||
pub const app_name = "efemra";
|
||||
pub const engine_name = "efemra";
|
||||
|
||||
pub const khronos_layer_on = true;
|
||||
pub const assist_layer_on = true;
|
||||
pub const messenger_on = true;
|
||||
pub const rt_on = false;
|
Loading…
Reference in New Issue