New plots to watch the GPU load"

"
This commit is contained in:
samcake 2016-07-15 09:13:55 -07:00
parent 22ac95d463
commit 800d2db8f1
2 changed files with 85 additions and 0 deletions

View file

@ -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(); });

View file

@ -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"
}
]
}
}
}