Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/slangmosh-program'
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Nov 4, 2023
2 parents fb9b9e8 + c61b12b commit adea8a2
Show file tree
Hide file tree
Showing 6 changed files with 361 additions and 58 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ if (TARGET granite-renderer)
endif()
endif()

if (GRANITE_TOOLS)
if (GRANITE_TOOLS AND GRANITE_VULKAN_SPIRV_CROSS AND GRANITE_VULKAN_SHADER_MANAGER_RUNTIME_COMPILER)
add_subdirectory(slangmosh)
endif()

10 changes: 5 additions & 5 deletions filesystem/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ FileHandle ScratchFilesystem::open(const std::string &path, FileMode)
}
}

BlobFilesystem::BlobFilesystem(FileHandle file_, std::string basedir_)
: file(std::move(file_)), base(std::move(basedir_))
BlobFilesystem::BlobFilesystem(FileHandle file_)
: file(std::move(file_))
{
if (!file)
return;
Expand Down Expand Up @@ -560,7 +560,7 @@ std::vector<ListEntry> BlobFilesystem::list(const std::string &path)
auto canon_path = Path::canonicalize_path(path);

std::vector<ListEntry> entries;
if (const auto *zip_dir = find_directory(Path::join(base, canon_path)))
if (const auto *zip_dir = find_directory(canon_path))
{
entries.reserve(zip_dir->dirs.size() + zip_dir->files.size());
for (auto &dir : zip_dir->dirs)
Expand All @@ -573,7 +573,7 @@ std::vector<ListEntry> BlobFilesystem::list(const std::string &path)

bool BlobFilesystem::stat(const std::string &path, FileStat &stat)
{
auto p = Path::join(base, Path::canonicalize_path(path));
auto p = Path::canonicalize_path(path);

if (const auto *zip_file = find_file(p))
{
Expand All @@ -598,7 +598,7 @@ FileHandle BlobFilesystem::open(const std::string &path, FileMode mode)
if (mode != FileMode::ReadOnly)
return {};

auto p = Path::join(base, Path::canonicalize_path(path));
auto p = Path::canonicalize_path(path);
auto *blob_file = find_file(p);
if (!blob_file)
return {};
Expand Down
3 changes: 1 addition & 2 deletions filesystem/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class FileSlice final : public File
class BlobFilesystem final : public FilesystemBackend
{
public:
BlobFilesystem(FileHandle file, std::string basedir);
BlobFilesystem(FileHandle file);

std::vector<ListEntry> list(const std::string &path) override;

Expand All @@ -304,7 +304,6 @@ class BlobFilesystem final : public FilesystemBackend
private:
FileHandle file;
size_t blob_base_offset = 0;
std::string base;

struct BlobFile
{
Expand Down
Loading

0 comments on commit adea8a2

Please sign in to comment.