Headless: Print the number of pipelines created

Vulkan and Metal pipelines, and OpenGL programs, including those precompiled from the shader cache. Benchmark
times include the compiles, so this shows when two builds differ in how many they need.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-11-04 23:05:36 +01:00
1 parent 77e417e59f
commit 5a5c11f984
5 files changed
+9

No files matched your search

+2
View File
@@ -782,6 +782,7 @@ LinkedShader *ShaderManagerGLES::ApplyFragmentShader(VShaderID VSID, Shader *vs,
// Check if we can link these.
ls = new LinkedShader(render_, VSID, vs, FSID, fs, vs->UseHWTransform());
gpuStats.totals.numPipelinesCreated++;
ls->use(VSID);
const LinkedShaderCacheEntry entry(vs, fs, ls);
linkedShaderCache_.push_back(entry);
@@ -1032,6 +1033,7 @@ bool ShaderManagerGLES::LoadCache(File::IOFile &f) {
fsCache_.Get(fsid, &fs);
if (vs && fs) {
LinkedShader *ls = new LinkedShader(render_, vsid, vs, fsid, fs, vs->UseHWTransform(), true);
gpuStats.totals.numPipelinesCreated++;
LinkedShaderCacheEntry entry(vs, fs, ls);
linkedShaderCache_.push_back(entry);
}
+2
View File
@@ -148,6 +148,8 @@ struct GPUStatsPerFrame {
struct GPUStatsTotals {
// Flip count. Doesn't really belong here.
int numFlips;
// Vulkan and Metal pipelines, and OpenGL programs, including those precompiled from the shader cache.
int numPipelinesCreated;
};
// The ToString function lives in GPUCommonHW.cpp.
+1
View File
@@ -278,6 +278,7 @@ DrawEngineMetal::Pipeline *DrawEngineMetal::GetOrCreatePipeline(const MetalPipel
pipeline->state = [MetalPipelineState new];
pipeline->format = format;
pipelines_.Insert(key, pipeline);
gpuStats.totals.numPipelinesCreated++;
if (vs->Failed() || fs->Failed()) {
[pipeline->state setPipeline:nil];
return pipeline;
+2
View File
@@ -11,6 +11,7 @@
#include "GPU/Vulkan/ShaderManagerVulkan.h"
#include "GPU/Common/ShaderId.h"
#include "GPU/GPUDefinitions.h"
#include "GPU/GPU.h"
#include "Common/GPU/thin3d.h"
#include "Common/GPU/Vulkan/VulkanRenderManager.h"
#include "Common/GPU/Vulkan/VulkanQueueRunner.h"
@@ -396,6 +397,7 @@ VulkanPipeline *PipelineManagerVulkan::GetOrCreatePipeline(VulkanRenderManager *
// If the above failed, we got a null pipeline. We still insert it to keep track.
pipelines_.Insert(key, pipeline);
gpuStats.totals.numPipelinesCreated++;
// Don't return placeholder null pipelines.
if (pipeline && pipeline->pipeline) {
+2
View File
@@ -766,6 +766,8 @@ static bool RunAutoTest(GraphicsContext *graphicsContext, CoreParameter &corePar
}
fprintf(stderr, "Frame stats: %d flips in %d emulated seconds, wall %.1fs, per second:%s\n", total, (int)flipsPerSecond.size(), time_now_d() - startTime, perSecond.c_str());
}
// What shader compiles cost the run, which the times include.
fprintf(stderr, "Pipelines created: %d\n", gpuStats.totals.numPipelinesCreated);
if (coreParameter.bootFromState) {
// Counted from the state's load. More than a few, and the game has gone off its usual path.
fprintf(stderr, "Failed disc reads: %d\n", pspFileSystem.FailedDiscReads());