12 #ifndef hifi_render_EngineStats_h
13 #define hifi_render_EngineStats_h
15 #include <gpu/Context.h>
17 #include <QElapsedTimer>
24 class EngineStatsConfig :
public Job::Config{
27 Q_PROPERTY(quint32 bufferCPUCount MEMBER bufferCPUCount NOTIFY newStats)
28 Q_PROPERTY(quint32 bufferGPUCount MEMBER bufferGPUCount NOTIFY newStats)
29 Q_PROPERTY(qint64 bufferCPUMemSize MEMBER bufferCPUMemSize NOTIFY newStats)
30 Q_PROPERTY(qint64 bufferGPUMemSize MEMBER bufferGPUMemSize NOTIFY newStats)
32 Q_PROPERTY(quint32 textureCPUCount MEMBER textureCPUCount NOTIFY newStats)
33 Q_PROPERTY(quint32 textureGPUCount MEMBER textureGPUCount NOTIFY newStats)
34 Q_PROPERTY(quint32 textureResidentGPUCount MEMBER textureResidentGPUCount NOTIFY newStats)
35 Q_PROPERTY(quint32 textureFramebufferGPUCount MEMBER textureFramebufferGPUCount NOTIFY newStats)
36 Q_PROPERTY(quint32 textureResourceGPUCount MEMBER textureResourceGPUCount NOTIFY newStats)
37 Q_PROPERTY(quint32 textureExternalGPUCount MEMBER textureExternalGPUCount NOTIFY newStats)
39 Q_PROPERTY(qint64 textureCPUMemSize MEMBER textureCPUMemSize NOTIFY newStats)
40 Q_PROPERTY(qint64 textureGPUMemSize MEMBER textureGPUMemSize NOTIFY newStats)
41 Q_PROPERTY(qint64 textureResidentGPUMemSize MEMBER textureResidentGPUMemSize NOTIFY newStats)
42 Q_PROPERTY(qint64 textureFramebufferGPUMemSize MEMBER textureFramebufferGPUMemSize NOTIFY newStats)
43 Q_PROPERTY(qint64 textureResourceGPUMemSize MEMBER textureResourceGPUMemSize NOTIFY newStats)
44 Q_PROPERTY(qint64 textureExternalGPUMemSize MEMBER textureExternalGPUMemSize NOTIFY newStats)
46 Q_PROPERTY(quint32 texturePendingGPUTransferCount MEMBER texturePendingGPUTransferCount NOTIFY newStats)
47 Q_PROPERTY(qint64 texturePendingGPUTransferSize MEMBER texturePendingGPUTransferSize NOTIFY newStats)
48 Q_PROPERTY(qint64 textureResourcePopulatedGPUMemSize MEMBER textureResourcePopulatedGPUMemSize NOTIFY newStats)
50 Q_PROPERTY(quint32 frameAPIDrawcallCount MEMBER frameAPIDrawcallCount NOTIFY newStats)
51 Q_PROPERTY(quint32 frameDrawcallCount MEMBER frameDrawcallCount NOTIFY newStats)
52 Q_PROPERTY(quint32 frameDrawcallRate MEMBER frameDrawcallRate NOTIFY newStats)
54 Q_PROPERTY(quint32 frameTriangleCount MEMBER frameTriangleCount NOTIFY newStats)
55 Q_PROPERTY(quint32 frameTriangleRate MEMBER frameTriangleRate NOTIFY newStats)
57 Q_PROPERTY(quint32 frameTextureCount MEMBER frameTextureCount NOTIFY newStats)
58 Q_PROPERTY(quint32 frameTextureRate MEMBER frameTextureRate NOTIFY newStats)
59 Q_PROPERTY(quint64 frameTextureMemoryUsage MEMBER frameTextureMemoryUsage NOTIFY newStats)
61 Q_PROPERTY(quint32 frameSetPipelineCount MEMBER frameSetPipelineCount NOTIFY newStats)
62 Q_PROPERTY(quint32 frameSetInputFormatCount MEMBER frameSetInputFormatCount NOTIFY newStats)
66 EngineStatsConfig() : Job::Config(true) {}
68 quint32 bufferCPUCount{ 0 };
69 quint32 bufferGPUCount{ 0 };
70 qint64 bufferCPUMemSize { 0 };
71 qint64 bufferGPUMemSize { 0 };
73 quint32 textureCPUCount{ 0 };
74 quint32 textureGPUCount { 0 };
75 quint32 textureResidentGPUCount { 0 };
76 quint32 textureFramebufferGPUCount { 0 };
77 quint32 textureResourceGPUCount { 0 };
78 quint32 textureExternalGPUCount { 0 };
79 quint32 texturePendingGPUTransferCount { 0 };
81 qint64 textureCPUMemSize { 0 };
82 qint64 textureGPUMemSize { 0 };
83 qint64 textureResidentGPUMemSize { 0 };
84 qint64 textureFramebufferGPUMemSize { 0 };
85 qint64 textureResourceGPUMemSize { 0 };
86 qint64 textureExternalGPUMemSize { 0 };
87 qint64 texturePendingGPUTransferSize { 0 };
88 qint64 textureResourcePopulatedGPUMemSize { 0 };
90 quint32 frameAPIDrawcallCount{ 0 };
91 quint32 frameDrawcallCount{ 0 };
92 quint32 frameDrawcallRate{ 0 };
94 quint32 frameTriangleCount{ 0 };
95 quint32 frameTriangleRate{ 0 };
97 quint32 frameTextureCount{ 0 };
98 quint32 frameTextureRate{ 0 };
99 quint64 frameTextureMemoryUsage{ 0 };
101 quint32 frameSetPipelineCount{ 0 };
103 quint32 frameSetInputFormatCount{ 0 };
107 gpu::ContextStats _gpuStats;
108 QElapsedTimer _frameTimer;
110 using Config = EngineStatsConfig;
111 using JobModel = Job::Model<EngineStats, Config>;
113 EngineStats() { _frameTimer.start(); }
115 void configure(
const Config& configuration) {}
116 void run(
const RenderContextPointer& renderContext);