use import instead of codegen
This commit is contained in:
parent
16820bdde2
commit
906cf124f2
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
vulkan_shader.d
|
|
||||||
2
vulkan.d
2
vulkan.d
@ -402,6 +402,8 @@ struct QueueInfo
|
|||||||
bool single_queue;
|
bool single_queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u8[] CONVERT_SHADER_BYTES = import("convert.comp.glsl");
|
||||||
|
|
||||||
Vulkan
|
Vulkan
|
||||||
Init(PlatformHandles platform_handles, u64 permanent_mem, u64 frame_mem)
|
Init(PlatformHandles platform_handles, u64 permanent_mem, u64 frame_mem)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user