shader: report compiled counts by guest stage

This commit is contained in:
nmzik
2026-09-07 07:34:01 +04:00
parent 2a54310876
commit 34ebfe40c3
@@ -19,6 +19,7 @@
#include "loader/systemContent.h"
#include <algorithm>
#include <array>
#include <atomic>
#include <cctype>
#include <cstdio>
@@ -365,7 +366,16 @@ struct PipelineCache::ProgramCache {
input_info.stage = {.program = &permutation.program, .resources = std::move(resources)};
permutation.program.bindings.AdvancePushData(push_data_cursor);
std::printf("Num compiled %" PRIu64 " shaders\n", next_shader_id);
std::array<size_t, static_cast<size_t>(ShaderType::Mesh) + 1> counts {};
for (const auto& [key, source]: programs) {
counts[static_cast<size_t>(key.stage)] += source.permutations.size();
}
// Guest geometry shaders are compiled through the host mesh stage.
std::printf("Shaders: VS %zu | PS %zu | CS %zu | GS %zu\n",
counts[static_cast<size_t>(ShaderType::Vertex)],
counts[static_cast<size_t>(ShaderType::Pixel)],
counts[static_cast<size_t>(ShaderType::Compute)],
counts[static_cast<size_t>(ShaderType::Mesh)]);
return permutation.handle;
}