summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-02-09 14:57:34 +1100
committerquou <quou@disroot.org>2025-02-09 14:57:34 +1100
commitc70a2a2fc4dde5f27fcbe4f353a24f65a08fbabf (patch)
tree2daa1cdb4aa28e7e0189f7e5c864f184d3c34bab
parent44bf93739d07ba65706464b4031d779a995ebbfd (diff)
query_psos
-rw-r--r--video.cpp17
-rw-r--r--video.hpp1
2 files changed, 18 insertions, 0 deletions
diff --git a/video.cpp b/video.cpp
index 7287985..f108319 100644
--- a/video.cpp
+++ b/video.cpp
@@ -4481,3 +4481,20 @@ void Device_Debug_Hooks::on_vram_alloc(size_t size, size_t align) {
(void)size;
(void)align;
}
+
+int Device_Debug_Hooks::query_psos(Pipeline* psos) {
+ Device_Vk* dv = (Device_Vk*)dev;
+ int count = 0;
+ if (psos) {
+ for (auto i : dv->pso_cache) {
+ auto& psok = i.first;
+ psos[count++] = psok.pso;
+ }
+ } else {
+ for (auto i : dv->pso_cache) {
+ (void)i;
+ count++;
+ }
+ }
+ return count;
+}
diff --git a/video.hpp b/video.hpp
index 6d70536..c93093e 100644
--- a/video.hpp
+++ b/video.hpp
@@ -439,6 +439,7 @@ struct Device_Debug_Hooks {
virtual void on_present(Context& ctx);
virtual void on_page_alloc(size_t size);
virtual void on_vram_alloc(size_t size, size_t align);
+ int query_psos(Pipeline* psos);
};
struct Context;