Skip to content

Commit

Permalink
move util.cc/.h into formats subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Mar 16, 2024
1 parent f6684e6 commit b40ec7f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ pub fn build_exe(
"reflection.cc",
"spirv.cc",
"spirvcross.cc",
"util.cc",
"formats/bare.cc",
"formats/sokol.cc",
"formats/sokolnim.cc",
"formats/sokolodin.cc",
"formats/sokolrust.cc",
"formats/sokolzig.cc",
"formats/yaml.cc",
"formats/util.cc",
};
const incl_dirs = [_][]const u8{
"src/shdc",
Expand Down
4 changes: 2 additions & 2 deletions src/shdc/formats/bare.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ static ErrMsg write_shader_sources_and_blobs(const Args& args,
const BytecodeBlob* fs_blob = find_bytecode_blob_by_shader_name(prog.fs_name, inp, bytecode);

const std::string file_path_base = fmt::format("{}_{}{}_{}", args.output, mod_prefix(inp), prog.name, Slang::to_str(slang));
const std::string file_path_vs = fmt::format("{}_vs{}", file_path_base, util::slang_file_extension(slang, vs_blob));
const std::string file_path_fs = fmt::format("{}_fs{}", file_path_base, util::slang_file_extension(slang, fs_blob));
const std::string file_path_vs = fmt::format("{}_vs{}", file_path_base, util::slang_file_extension(slang, vs_blob != nullptr));
const std::string file_path_fs = fmt::format("{}_fs{}", file_path_base, util::slang_file_extension(slang, fs_blob != nullptr));

ErrMsg err;
err = write_stage(file_path_vs, vs_src, vs_blob);
Expand Down
2 changes: 1 addition & 1 deletion src/shdc/util.cc → src/shdc/formats/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "fmt/format.h"
#include "pystring.h"

namespace shdc::util {
namespace shdc::formats::util {

using namespace refl;

Expand Down
2 changes: 1 addition & 1 deletion src/shdc/util.h → src/shdc/formats/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "types/slang.h"
#include "types/reflection/uniform.h"

namespace shdc::util {
namespace shdc::formats::util {

// utility functions for generators
ErrMsg check_errors(const Input& inp, const Spirvcross& spirvcross, Slang::Enum slang);
Expand Down
4 changes: 2 additions & 2 deletions src/shdc/formats/yaml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ static ErrMsg write_shader_sources_and_blobs(const Args& args,
const BytecodeBlob* fs_blob = find_bytecode_blob_by_shader_name(prog.fs_name, inp, bytecode);

const std::string file_path_base = fmt::format("{}_{}{}_{}", args.output, mod_prefix(inp), prog.name, Slang::to_str(slang));
const std::string file_path_vs = fmt::format("{}_vs{}", file_path_base, util::slang_file_extension(slang, vs_blob));
const std::string file_path_fs = fmt::format("{}_fs{}", file_path_base, util::slang_file_extension(slang, fs_blob));
const std::string file_path_vs = fmt::format("{}_vs{}", file_path_base, util::slang_file_extension(slang, vs_blob != nullptr));
const std::string file_path_fs = fmt::format("{}_fs{}", file_path_base, util::slang_file_extension(slang, fs_blob != nullptr));

L(" -\n");
L(" name: {}\n", prog.name);
Expand Down

0 comments on commit b40ec7f

Please # to comment.