use import instead of codegen

This commit is contained in:
Matthew 2025-08-20 04:40:39 +10:00
parent 16820bdde2
commit 906cf124f2
3 changed files with 2 additions and 36 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
vulkan_shader.d

View File

@ -402,6 +402,8 @@ struct QueueInfo
bool single_queue;
}
u8[] CONVERT_SHADER_BYTES = import("convert.comp.glsl");
Vulkan
Init(PlatformHandles platform_handles, u64 permanent_mem, u64 frame_mem)
{

View File

@ -1,35 +0,0 @@
version(VULKAN_CODEGEN)
{
import std.file;
import std.string;
import std.path;
import std.stdio;
void main(string[] argv)
{
assert(argv.length > 1, "No argument provided");
ubyte[] shader_bytes = cast(ubyte[])read(argv[1]);
string p = __FILE__.absolutePath;
string codegen_name = chomp(p, baseName(p)) ~ "vulkan_shader.d";
auto f = File(codegen_name, "w");
f.write("ubyte[] CONVERT_SHADER_BYTES = [");
foreach(i, b; shader_bytes)
{
if (i % 50 == 0)
{
f.write("\n\t");
}
f.writef("%d, ", b);
}
f.writeln("\n];");
f.close();
}
}