From b39a57daa1358dc52af82911f2a590c4c571a347 Mon Sep 17 00:00:00 2001 From: GoldenbergDaniel Date: Sat, 16 Nov 2024 05:40:45 -0500 Subject: [PATCH 1/2] Improve Odin gen --- src/shdc/generators/sokolodin.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shdc/generators/sokolodin.cc b/src/shdc/generators/sokolodin.cc index d0372fe5..a0281a3d 100644 --- a/src/shdc/generators/sokolodin.cc +++ b/src/shdc/generators/sokolodin.cc @@ -206,7 +206,7 @@ void SokolOdinGenerator::gen_shader_desc_func(const GenInput& gen, const Program l("{}.bytecode.ptr = &{}\n", dsn, info.bytecode_array_name); l("{}.bytecode.size = {}\n", dsn, info.bytecode_array_size); } else { - l("{}.source = transmute(cstring)&{}\n", dsn, info.source_array_name); + l("{}.source = cast(cstring)&{}\n", dsn, info.source_array_name); const char* d3d11_tgt = nullptr; if (slang == Slang::HLSL4) { d3d11_tgt = (0 == stage_index) ? "vs_4_0" : "ps_4_0"; @@ -331,7 +331,7 @@ void SokolOdinGenerator::gen_shader_desc_func(const GenInput& gen, const Program } void SokolOdinGenerator::gen_shader_array_start(const GenInput& gen, const std::string& array_name, size_t num_bytes, Slang::Enum slang) { - l("@(private)\n{} := [{}]u8 {{\n", array_name, num_bytes); + l("@(private=\"file\")\n{} := [{}]u8 {{\n", array_name, num_bytes); } void SokolOdinGenerator::gen_shader_array_end(const GenInput& gen) { From 9fcfdde30415634a0a618aced916a5ad38b693c5 Mon Sep 17 00:00:00 2001 From: GoldenbergDaniel Date: Sat, 16 Nov 2024 05:53:20 -0500 Subject: [PATCH 2/2] @(private) -> @(private=file) --- src/shdc/generators/sokolodin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shdc/generators/sokolodin.cc b/src/shdc/generators/sokolodin.cc index a0281a3d..68aef46d 100644 --- a/src/shdc/generators/sokolodin.cc +++ b/src/shdc/generators/sokolodin.cc @@ -206,7 +206,7 @@ void SokolOdinGenerator::gen_shader_desc_func(const GenInput& gen, const Program l("{}.bytecode.ptr = &{}\n", dsn, info.bytecode_array_name); l("{}.bytecode.size = {}\n", dsn, info.bytecode_array_size); } else { - l("{}.source = cast(cstring)&{}\n", dsn, info.source_array_name); + l("{}.source = transmute(cstring)&{}\n", dsn, info.source_array_name); const char* d3d11_tgt = nullptr; if (slang == Slang::HLSL4) { d3d11_tgt = (0 == stage_index) ? "vs_4_0" : "ps_4_0";