upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorubiquitarianism <283527159+ubiquitarianism@users.noreply.github.com>2026-11-23 21:27:26 -0500
committerGitHub <noreply@github.com>2026-11-23 21:27:26 -0500
commite6ca5cb29ede877fa0b2bb6666ae1e3f10e3b2df (patch)
tree3683df0d08f1ea45200a16550bfe0b5c9ed51222 /runtime/src
parent091aa263359e5c05d148dd18af35cda6226ee384 (diff)
parent642880a217f4fbed23b4de2746e27ab9834e3a0b (diff)
Merge pull request #19 from moffington/contrib/pipeline-library-upstream
Add slot-67 pipeline-library shader build and runtime loading
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/shader_library.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/runtime/src/shader_library.h b/runtime/src/shader_library.h
index 352e54325..2fe53d4ec 100644
--- a/runtime/src/shader_library.h
+++ b/runtime/src/shader_library.h
@@ -829,7 +829,10 @@ public:
829 // when it is there: 829 // when it is there:
830 // - <dir>/fspx/index.json, the FidelityFX DLL's FSPX programs, entries named "fspx/<name>" (docs/fspx.md); 830 // - <dir>/fspx/index.json, the FidelityFX DLL's FSPX programs, entries named "fspx/<name>" (docs/fspx.md);
831 // - <dir>/bvh/index.json, XboxBvhBuilder.dll's FSSM programs, entries named "bvh/<name>" and found by 831 // - <dir>/bvh/index.json, XboxBvhBuilder.dll's FSSM programs, entries named "bvh/<name>" and found by
832 // fssm_sha256 like the game's own shaders (docs/embedded_shaders.md). 832 // fssm_sha256 like the game's own shaders (docs/embedded_shaders.md);
833 // - <dir>/library/index.json, the compute programs of the pipeline library in shaders.rpf, which the executable
834 // creates with slot 67; entries named "library/<name>" and found by fspx_code_sha256 and fspx_state_sha256
835 // like the FSPX ones (docs/shader_library.md).
833 // Entries with neither fssm_sha256 nor fspx_code_sha256 cannot be found by content and are skipped. Both folders 836 // Entries with neither fssm_sha256 nor fspx_code_sha256 cannot be found by content and are skipped. Both folders
834 // are optional: a missing or unreadable index there leaves the main one, and the other folder's, loaded. 837 // are optional: a missing or unreadable index there leaves the main one, and the other folder's, loaded.
835 bool load(const std::filesystem::path& dir, std::string* error = nullptr) { 838 bool load(const std::filesystem::path& dir, std::string* error = nullptr) {
@@ -849,7 +852,7 @@ public:
849 } catch (...) { 852 } catch (...) {
850 return fail("index.json could not be read"); 853 return fail("index.json could not be read");
851 } 854 }
852 for (const char* sub_folder : {"fspx", "bvh"}) { 855 for (const char* sub_folder : {"fspx", "bvh", "library"}) {
853 try { 856 try {
854 const auto ignore = [](const std::string&) { return false; }; 857 const auto ignore = [](const std::string&) { return false; };
855 const std::filesystem::path sub = folder / sub_folder; 858 const std::filesystem::path sub = folder / sub_folder;
@@ -865,8 +868,9 @@ public:
865 // The folder load() read, made absolute; empty before. 868 // The folder load() read, made absolute; empty before.
866 const std::filesystem::path& directory() const { return dir_; } 869 const std::filesystem::path& directory() const { return dir_; }
867 std::size_t size() const { return count_; } 870 std::size_t size() const { return count_; }
868 // Entries loaded from <dir>/fspx/index.json. A corpus of RPF containers never reaches these: their programs 871 // Entries loaded from <dir>/fspx/index.json and <dir>/library/index.json. A corpus of RPF containers never
869 // come from FidelityFX DLLs, so callers comparing reached entries with size() must leave them out. 872 // reaches these: their programs come from FidelityFX DLLs and the pipeline library, so callers comparing reached
873 // entries with size() must leave them out.
870 std::size_t fspx_size() const { return fspx_count_; } 874 std::size_t fspx_size() const { return fspx_count_; }
871 // Entries loaded from <dir>/bvh/index.json. No RPF container reaches these either: XboxBvhBuilder.dll passes 875 // Entries loaded from <dir>/bvh/index.json. No RPF container reaches these either: XboxBvhBuilder.dll passes
872 // their containers itself. 876 // their containers itself.
@@ -1041,7 +1045,7 @@ private:
1041 e.max_primitives = u32(meta.find("max_primitives")); 1045 e.max_primitives = u32(meta.find("max_primitives"));
1042 if (by_fspx) fspx_entries_[{e.stage, e.fspx_code_sha256}].push_back(e); 1046 if (by_fspx) fspx_entries_[{e.stage, e.fspx_code_sha256}].push_back(e);
1043 if (by_fssm) entries_[{e.stage, e.fssm_sha256}].push_back(std::move(e)); 1047 if (by_fssm) entries_[{e.stage, e.fssm_sha256}].push_back(std::move(e));
1044 if (by_fspx && prefix == "fspx/") ++fspx_count_; 1048 if (by_fspx && (prefix == "fspx/" || prefix == "library/")) ++fspx_count_;
1045 if (prefix == "bvh/") ++bvh_count_; 1049 if (prefix == "bvh/") ++bvh_count_;
1046 ++count_; 1050 ++count_;
1047 } 1051 }