From 800d2db8f163a512ec1f1c50239a31cc42f4d4df Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 15 Jul 2016 09:13:55 -0700 Subject: [PATCH] New plots to watch the GPU load" " --- .../utilities/render/renderStatsGPU.js | 21 ++++++ .../developer/utilities/render/statsGPU.qml | 64 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 scripts/developer/utilities/render/renderStatsGPU.js create mode 100644 scripts/developer/utilities/render/statsGPU.qml diff --git a/scripts/developer/utilities/render/renderStatsGPU.js b/scripts/developer/utilities/render/renderStatsGPU.js new file mode 100644 index 0000000000..c5955b0d5d --- /dev/null +++ b/scripts/developer/utilities/render/renderStatsGPU.js @@ -0,0 +1,21 @@ +// +// renderStats.js +// examples/utilities/tools/render +// +// Sam Gateau, created on 3/22/2016. +// Copyright 2016 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +// Set up the qml ui +var qml = Script.resolvePath('statsGPU.qml'); +var window = new OverlayWindow({ + title: 'Render Stats GPU', + source: qml, + width: 320, + height: 200 +}); +window.setPosition(50, 20); +window.closed.connect(function() { Script.stop(); }); \ No newline at end of file diff --git a/scripts/developer/utilities/render/statsGPU.qml b/scripts/developer/utilities/render/statsGPU.qml new file mode 100644 index 0000000000..0f529d2d7f --- /dev/null +++ b/scripts/developer/utilities/render/statsGPU.qml @@ -0,0 +1,64 @@ +// +// stats.qml +// examples/utilities/render +// +// Created by Zach Pomerantz on 2/8/2016 +// Copyright 2016 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html +// +import QtQuick 2.5 +import QtQuick.Controls 1.4 +import "../lib/plotperf" + +Item { + id: statsUI + anchors.fill:parent + + Column { + id: stats + spacing: 8 + anchors.fill:parent + + property var config: Render.getConfig("Stats") + + function evalEvenHeight() { + // Why do we have to do that manually ? cannot seem to find a qml / anchor / layout mode that does that ? + return (height - spacing * (children.length - 1)) / children.length + } + + + PlotPerf { + title: "Timing" + height: parent.evalEvenHeight() + object: parent.drawOpaqueConfig + valueUnit: "ms" + valueScale: 1 + valueNumDigits: "4" + plots: [ + { + object: Render.getConfig("SurfaceGeometry"), + prop: "gpuTime", + label: "SurfaceGeometryGPU", + color: "#00FFFF" + }, + { + object: Render.getConfig("RenderDeferred"), + prop: "gpuTime", + label: "DeferredLighting", + color: "#FF00FF" + } + , + { + object: Render.getConfig("RangeTimer"), + prop: "gpuTime", + label: "FrameGPU", + color: "#FFFF00" + } + ] + } + } + +} +