Fixing the issues with thte debug renderdeferredTask and investigating the avatars perf

This commit is contained in:
Sam Gateau 2018-11-28 01:01:18 -08:00
parent 199fe2178d
commit ba4aec2aff
4 changed files with 211 additions and 3 deletions

View file

@ -294,8 +294,8 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
task.addJob<ToneMappingDeferred>("ToneMapping", toneMappingInputs);
{ // Debug the bounds of the rendered items, still look at the zbuffer
const auto debugInputs = RenderDeferredTaskDebug::Input(items, inputs[1], zones, selectedItems, currentStageFrames, prepareDeferredOutputs, deferredFrameTransform, jitter).asVarying();
task.addJob<RenderDeferredTaskDebug>("DebugRenderDeferredTask", input);
const auto debugInputs = RenderDeferredTaskDebug::Input(fetchedItems, inputs[1], zones, selectedItems, currentStageFrames, prepareDeferredOutputs, deferredFrameTransform, jitter).asVarying();
task.addJob<RenderDeferredTaskDebug>("DebugRenderDeferredTask", debugInputs);
/*task.addJob<DrawBounds>("DrawMetaBounds", metas);
task.addJob<DrawBounds>("DrawOpaqueBounds", opaques);
task.addJob<DrawBounds>("DrawTransparentBounds", transparents);

View file

@ -12,6 +12,7 @@
#ifndef hifi_task_Varying_h
#define hifi_task_Varying_h
#include <type_traits>
#include <tuple>
#include <array>
@ -23,7 +24,7 @@ public:
Varying() {}
Varying(const Varying& var) : _concept(var._concept) {}
Varying& operator=(const Varying& var) {
_concept = var._concept;
_concept = var._concept;
return (*this);
}
template <class T> Varying(const T& data) : _concept(std::make_shared<Model<T>>(data)) {}

View file

@ -0,0 +1,129 @@
"use strict";
//
// Avatars.js
// tablet-engine app
//
// Copyright 2018 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
//
(function() {
var TABLET_BUTTON_NAME = "Avatars";
var QMLAPP_URL = Script.resolvePath("./avatars.qml");
var ICON_URL = Script.resolvePath("../../../system/assets/images/lod-i.svg");
var ACTIVE_ICON_URL = Script.resolvePath("../../../system/assets/images/lod-a.svg");
var onTablet = false; // set this to true to use the tablet, false use a floating window
var onAppScreen = false;
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
var button = tablet.addButton({
text: TABLET_BUTTON_NAME,
icon: ICON_URL,
activeIcon: ACTIVE_ICON_URL
});
var hasEventBridge = false;
var onScreen = false;
var window;
function onClicked() {
if (onTablet) {
if (onAppScreen) {
tablet.gotoHomeScreen();
} else {
tablet.loadQMLSource(QMLAPP_URL);
}
} else {
if (onScreen) {
killWindow()
} else {
createWindow()
}
}
}
function createWindow() {
var qml = Script.resolvePath(QMLAPP_URL);
window = Desktop.createWindow(Script.resolvePath(QMLAPP_URL), {
title: TABLET_BUTTON_NAME,
flags: Desktop.ALWAYS_ON_TOP,
presentationMode: Desktop.PresentationMode.NATIVE,
size: {x: 400, y: 600}
});
window.closed.connect(killWindow);
window.fromQml.connect(fromQml);
onScreen = true
button.editProperties({isActive: true});
}
function killWindow() {
if (window !== undefined) {
window.closed.disconnect(killWindow);
window.fromQml.disconnect(fromQml);
window.close()
window = undefined
}
onScreen = false
button.editProperties({isActive: false})
}
function wireEventBridge(on) {
if (!tablet) {
print("Warning in wireEventBridge(): 'tablet' undefined!");
return;
}
if (on) {
if (!hasEventBridge) {
tablet.fromQml.connect(fromQml);
hasEventBridge = true;
}
} else {
if (hasEventBridge) {
tablet.fromQml.disconnect(fromQml);
hasEventBridge = false;
}
}
}
function onScreenChanged(type, url) {
if (onTablet) {
onAppScreen = (url === QMLAPP_URL);
button.editProperties({isActive: onAppScreen});
wireEventBridge(onAppScreen);
}
}
button.clicked.connect(onClicked);
tablet.screenChanged.connect(onScreenChanged);
Script.scriptEnding.connect(function () {
killWindow()
if (onAppScreen) {
tablet.gotoHomeScreen();
}
button.clicked.disconnect(onClicked);
tablet.screenChanged.disconnect(onScreenChanged);
tablet.removeButton(button);
});
function fromQml(message) {
}
function sendToQml(message) {
if (onTablet) {
tablet.sendToQml(message);
} else {
if (window) {
window.sendToQml(message);
}
}
}
}());

View file

@ -0,0 +1,78 @@
//
// avatars.qml
// scripts/developer/utilities/workload
//
// Created by Sam Gateau on 2018.11.28
// Copyright 2018 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 stylesUit 1.0
import controlsUit 1.0 as HifiControls
import "../lib/plotperf"
import "../render/configSlider"
Item {
id: root
anchors.fill:parent
Component.onCompleted: {
}
Component.onDestruction: {
}
Column {
id: topHeader
spacing: 8
anchors.right: parent.right
anchors.left: parent.left
}
Column {
id: stats
spacing: 4
anchors.right: parent.right
anchors.left: parent.left
anchors.top: topHeader.bottom
anchors.bottom: parent.bottom
function evalEvenHeight() {
// Why do we have to do that manually ? cannot seem to find a qml / anchor / layout mode that does that ?
var numPlots = (children.length + - 2)
return (height - topLine.height - bottomLine.height - spacing * (numPlots - 1)) / (numPlots)
}
Separator {
id: topLine
}
PlotPerf {
title: "Avatars"
height: parent.evalEvenHeight()
object: Stats
valueScale: 1
valueUnit: "num"
plots: [
{
prop: "updatedAvatarCount",
label: "updatedAvatarCount",
color: "#FFFF00"
},
{
prop: "notUpdatedAvatarCount",
label: "notUpdatedAvatarCount",
color: "#00FF00"
}
]
}
Separator {
id: bottomLine
}
}
}