saving
This commit is contained in:
parent
fc6b0a154a
commit
653f61e8d9
70
build.zig
70
build.zig
|
|
@ -13,12 +13,12 @@ const engineDepList = [_][]const u8{
|
|||
"assets",
|
||||
"audio",
|
||||
"core",
|
||||
"graphics",
|
||||
"papyrus",
|
||||
"platform",
|
||||
"physics",
|
||||
"ui",
|
||||
"vkImgui",
|
||||
// "graphics",
|
||||
// "ui",
|
||||
// "vkImgui",
|
||||
};
|
||||
|
||||
const BuildSystem = @This();
|
||||
|
|
@ -110,20 +110,64 @@ pub fn addProgram(self: *BuildSystem, opts: AddProgramOptions) *std.Build.Step.C
|
|||
mod.addImport("Backlog", self.nw_mod);
|
||||
exe.root_module.addOptions("BacklogOptions", self.options);
|
||||
|
||||
self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/triangle_mesh.vert"), "triangle_mesh_vert");
|
||||
self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/default_lit.frag"), "default_lit");
|
||||
// I want to generate definitions from the spirv-reflect-tool during pre-build.
|
||||
//
|
||||
// shaders will now be part of content, not code. However. .zig code definitions will be generated
|
||||
// from content via the build.zig script.
|
||||
//
|
||||
// heres some thoughts:
|
||||
//
|
||||
// -Dupdate_shaders=true
|
||||
//
|
||||
// -Dupdate_shaders basically adds a run step to the build process 'python', 'tools/scripts/cook-shaders.py'
|
||||
//
|
||||
// 1. ensure spirv-reflect is compiled.
|
||||
// 2. shadercross cooker generates all shader outputs - specifically spv files. they are output to content/_shaders/
|
||||
// - search paths for shaders:
|
||||
// - content/shaders/**
|
||||
// - engine/<module names>/shaders/**
|
||||
// - shaders must have a unique name across the entire project, naming scheme should be <module>.shadername.<stage>.hlsl
|
||||
// 3. spirv-cross --reflect is called on each shader, updating the content/_shaders/defs/shader-name.json folder with up to date .json files
|
||||
//
|
||||
// final tree
|
||||
//
|
||||
// engine/
|
||||
// - ui/
|
||||
// - shaders/
|
||||
// - papyrus.rect.vert.hlsl
|
||||
// content/
|
||||
// - _shaders/
|
||||
// - def/
|
||||
// papyrus.rect.vert.json
|
||||
// - msl/
|
||||
// papyrus.rect.vert.msl
|
||||
// - spv/
|
||||
// papyrus.rect.vert.spv
|
||||
// - dxil/
|
||||
// papyrus.rect.vert.dxil
|
||||
//
|
||||
//
|
||||
// During build:
|
||||
// 1. spirv-reflect is called on each json in each folder and .zig shader interfaces added to the executable as a global import.
|
||||
// 2. if -Dupdate_shaders is not
|
||||
//
|
||||
// At any time:
|
||||
// asset-cooker will cook shaders and place them under content/_shaders/<msl|dxil|dxil>/<shader-name>.<msl|spv|dxil>
|
||||
|
||||
self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/debug.vert"), "debug_vert");
|
||||
self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/debug.frag"), "debug_frag");
|
||||
// self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/triangle_mesh.vert"), "triangle_mesh_vert");
|
||||
// self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/default_lit.frag"), "default_lit");
|
||||
|
||||
self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/skybox/skybox.vert"), "skybox_vert");
|
||||
self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/skybox/skybox.frag"), "skybox_frag");
|
||||
// self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/debug.vert"), "debug_vert");
|
||||
// self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/debug.frag"), "debug_frag");
|
||||
|
||||
self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/ui/shaders/PapyrusRect.vert"), "papyrus_vk_vert");
|
||||
self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/ui/shaders/PapyrusRect.frag"), "papyrus_vk_frag");
|
||||
// self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/skybox/skybox.vert"), "skybox_vert");
|
||||
// self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/graphics/shaders/skybox/skybox.frag"), "skybox_frag");
|
||||
|
||||
self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/ui/shaders/FontSDF.vert"), "FontSDF_vert");
|
||||
self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/ui/shaders/FontSDF.frag"), "FontSDF_frag");
|
||||
// self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/ui/shaders/PapyrusRect.vert"), "papyrus_vk_vert");
|
||||
// self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/ui/shaders/PapyrusRect.frag"), "papyrus_vk_frag");
|
||||
|
||||
// self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/ui/shaders/FontSDF.vert"), "FontSDF_vert");
|
||||
// self.spirvReflect.addShaderInstallRef(exe, self.nw_builder.path("engine/ui/shaders/FontSDF.frag"), "FontSDF_frag");
|
||||
|
||||
b.getInstallStep().dependOn(self.nw_builder.getInstallStep());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
.{
|
||||
.name = "Backlog",
|
||||
.name = .Backlog,
|
||||
.version = "0.0.0",
|
||||
.dependencies = .{
|
||||
.assets = .{ .path = "engine/assets" },
|
||||
.audio = .{ .path = "engine/audio" },
|
||||
.core = .{ .path = "engine/core" },
|
||||
.graphics = .{ .path = "engine/graphics" },
|
||||
.papyrus = .{ .path = "engine/papyrus" },
|
||||
.physics = .{ .path = "engine/physics" },
|
||||
.platform = .{ .path = "engine/platform" },
|
||||
.ui = .{ .path = "engine/ui" },
|
||||
.vkImgui = .{ .path = "engine/vkImgui" },
|
||||
|
||||
// .graphics = .{ .path = "engine/graphics" },
|
||||
// .ui = .{ .path = "engine/ui" },
|
||||
// .vkImgui = .{ .path = "engine/vkImgui" },
|
||||
|
||||
.SpirvReflect = .{ .path = "lib/spirv-reflect-zig" },
|
||||
.ozz = .{ .path = "lib/ozz" },
|
||||
|
|
@ -18,4 +19,5 @@
|
|||
.paths = .{
|
||||
"",
|
||||
},
|
||||
.fingerprint = 0xcf9bab998abe37e3
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
|
@ -0,0 +1,2 @@
|
|||
plunder these ones for features to
|
||||
implement in rend
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue