Merge branch 'master' of github.com:highfidelity/hifi into bullet-constraints-1

This commit is contained in:
Seth Alves 2017-04-21 17:19:47 -07:00
commit 17b83dd64c
62 changed files with 250 additions and 201 deletions

View file

@ -210,6 +210,7 @@ endforeach()
file(GLOB_RECURSE JS_SRC scripts/*.js)
add_custom_target(js SOURCES ${JS_SRC})
GroupSources("scripts")
if (UNIX)
install(

View file

@ -65,6 +65,7 @@ set(INTERFACE_SRCS ${INTERFACE_SRCS} "${QT_UI_HEADERS}" "${QT_RESOURCES}")
file(GLOB_RECURSE QML_SRC resources/qml/*.qml resources/qml/*.js)
add_custom_target(qml SOURCES ${QML_SRC})
GroupSources("resources/qml")
if (UNIX)
install(

View file

@ -244,16 +244,16 @@ Item {
id: octreeCol
spacing: 4; x: 4; y: 4;
StatText {
text: " Frame timing:"
text: "Engine: " + root.engineFrameTime.toFixed(1) + " ms"
}
StatText {
text: " Batch: " + root.batchFrameTime.toFixed(1) + " ms"
text: "Batch: " + root.batchFrameTime.toFixed(1) + " ms"
}
StatText {
text: " GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
text: "GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
}
StatText {
text: " Avatar: " + root.avatarSimulationTime.toFixed(1) + " ms"
text: "Avatar: " + root.avatarSimulationTime.toFixed(1) + " ms"
}
StatText {
text: "Triangles: " + root.triangles +

Binary file not shown.

View file

@ -594,7 +594,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
_aboutToQuit(false),
_notifiedPacketVersionMismatchThisDomain(false),
_maxOctreePPS(maxOctreePacketsPerSecond.get()),
_lastFaceTrackerUpdate(0)
_lastFaceTrackerUpdate(0),
_snapshotSound(nullptr)
{
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
@ -1454,6 +1455,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
return entityServerNode && !isPhysicsEnabled();
});
QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
_snapshotSound = DependencyManager::get<SoundCache>()->getSound(QUrl::fromLocalFile(inf.absoluteFilePath()));
QVariant testProperty = property(hifi::properties::TEST);
qDebug() << testProperty;
if (testProperty.isValid()) {
@ -1776,12 +1780,17 @@ void Application::cleanupBeforeQuit() {
// stop QML
DependencyManager::destroy<OffscreenUi>();
if (_snapshotSoundInjector != nullptr) {
_snapshotSoundInjector->stop();
}
// stop audio after QML, as there are unexplained audio crashes originating in qtwebengine
// stop the AudioClient, synchronously
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
"stop", Qt::BlockingQueuedConnection);
// destroy Audio so it and its threads have a chance to go down safely
DependencyManager::destroy<AudioClient>();
DependencyManager::destroy<AudioInjectorManager>();
@ -6406,15 +6415,24 @@ void Application::loadAddAvatarBookmarkDialog() const {
}
void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio) {
postLambdaEvent([notify, includeAnimated, aspectRatio, this] {
QMediaPlayer* player = new QMediaPlayer();
QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
player->play();
//keep sound thread out of event loop scope
AudioInjectorOptions options;
options.localOnly = true;
options.stereo = true;
if (_snapshotSoundInjector) {
_snapshotSoundInjector->setOptions(options);
_snapshotSoundInjector->restart();
} else {
QByteArray samples = _snapshotSound->getByteArray();
_snapshotSoundInjector = AudioInjector::playSound(samples, options);
}
postLambdaEvent([notify, includeAnimated, aspectRatio, this] {
// Get a screenshot and save it
QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));
// If we're not doing an animated snapshot as well...
if (!includeAnimated || !(SnapshotAnimated::alsoTakeAnimatedSnapshot.get())) {
// Tell the dependency manager that the capture of the still snapshot has taken place.
@ -6425,6 +6443,7 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa
}
});
}
void Application::shareSnapshot(const QString& path, const QUrl& href) {
postLambdaEvent([path, href] {
// not much to do here, everything is done in snapshot code...
@ -6782,6 +6801,13 @@ void Application::updateDisplayMode() {
if (!active) {
qFatal("Failed to activate fallback plugin");
}
// We've changed the selection - it should be reflected in the menu
QAction* action = menu->getActionForOption(newDisplayPlugin->getName());
if (!action) {
qFatal("Failed to find activated plugin");
}
action->setChecked(true);
}
_offscreenContext->makeCurrent();

View file

@ -73,6 +73,7 @@
#include <model/Skybox.h>
#include <ModelScriptingInterface.h>
#include "Sound.h"
class OffscreenGLCanvas;
class GLCanvas;
@ -80,6 +81,7 @@ class FaceTracker;
class MainWindow;
class AssetUpload;
class CompositorHelper;
class AudioInjector;
namespace controller {
class StateController;
@ -683,6 +685,8 @@ private:
QTimer _addAssetToWorldErrorTimer;
FileScriptingInterface* _fileDownload;
AudioInjector* _snapshotSoundInjector { nullptr };
SharedSoundPointer _snapshotSound;
};

View file

@ -242,7 +242,7 @@ void SkeletonModel::updateAttitude() {
void SkeletonModel::simulate(float deltaTime, bool fullUpdate) {
updateAttitude();
if (fullUpdate) {
setBlendshapeCoefficients(_owningAvatar->getHead()->getBlendshapeCoefficients());
setBlendshapeCoefficients(_owningAvatar->getHead()->getSummedBlendshapeCoefficients());
Model::simulate(deltaTime, fullUpdate);

View file

@ -335,6 +335,8 @@ void Stats::updateStats(bool force) {
// Update Frame timing (in ms)
STAT_UPDATE(gpuFrameTime, (float)gpuContext->getFrameTimerGPUAverage());
STAT_UPDATE(batchFrameTime, (float)gpuContext->getFrameTimerBatchAverage());
auto config = qApp->getRenderEngine()->getConfiguration().get();
STAT_UPDATE(engineFrameTime, (float) config->getCPURunTime());
STAT_UPDATE(avatarSimulationTime, (float)avatarManager->getAvatarSimulationTime());

View file

@ -128,6 +128,7 @@ class Stats : public QQuickItem {
STATS_PROPERTY(int, gpuFreeMemory, 0)
STATS_PROPERTY(float, gpuFrameTime, 0)
STATS_PROPERTY(float, batchFrameTime, 0)
STATS_PROPERTY(float, engineFrameTime, 0)
STATS_PROPERTY(float, avatarSimulationTime, 0)
public:
@ -250,6 +251,7 @@ signals:
void gpuFreeMemoryChanged();
void gpuFrameTimeChanged();
void batchFrameTimeChanged();
void engineFrameTimeChanged();
void avatarSimulationTimeChanged();
void rectifiedTextureCountChanged();
void decimatedTextureCountChanged();

View file

@ -967,6 +967,7 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
const int coefficientsSize = sizeof(float) * numCoefficients;
PACKET_READ_CHECK(FaceTrackerCoefficients, coefficientsSize);
_headData->_blendshapeCoefficients.resize(numCoefficients); // make sure there's room for the copy!
_headData->_baseBlendshapeCoefficients.resize(numCoefficients);
memcpy(_headData->_blendshapeCoefficients.data(), sourceBuffer, coefficientsSize);
sourceBuffer += coefficientsSize;
int numBytesRead = sourceBuffer - startSection;

View file

@ -15,6 +15,7 @@
#include <QtCore/QJsonObject>
#include <QtCore/QJsonArray>
#include <QVector>
#include <FaceshiftConstants.h>
#include <GLMHelpers.h>
@ -38,6 +39,8 @@ HeadData::HeadData(AvatarData* owningAvatar) :
_rightEyeBlink(0.0f),
_averageLoudness(0.0f),
_browAudioLift(0.0f),
_baseBlendshapeCoefficients(QVector<float>(0, 0.0f)),
_currBlendShapeCoefficients(QVector<float>(0, 0.0f)),
_owningAvatar(owningAvatar)
{
@ -86,6 +89,24 @@ static const QMap<QString, int>& getBlendshapesLookupMap() {
return blendshapeLookupMap;
}
const QVector<float>& HeadData::getSummedBlendshapeCoefficients() {
int maxSize = std::max(_baseBlendshapeCoefficients.size(), _blendshapeCoefficients.size());
if (_currBlendShapeCoefficients.size() != maxSize) {
_currBlendShapeCoefficients.resize(maxSize);
}
for (int i = 0; i < maxSize; i++) {
if (i >= _baseBlendshapeCoefficients.size()) {
_currBlendShapeCoefficients[i] = _blendshapeCoefficients[i];
} else if (i >= _blendshapeCoefficients.size()) {
_currBlendShapeCoefficients[i] = _baseBlendshapeCoefficients[i];
} else {
_currBlendShapeCoefficients[i] = _baseBlendshapeCoefficients[i] + _blendshapeCoefficients[i];
}
}
return _currBlendShapeCoefficients;
}
void HeadData::setBlendshape(QString name, float val) {
const auto& blendshapeLookupMap = getBlendshapesLookupMap();
@ -96,7 +117,10 @@ void HeadData::setBlendshape(QString name, float val) {
if (_blendshapeCoefficients.size() <= it.value()) {
_blendshapeCoefficients.resize(it.value() + 1);
}
_blendshapeCoefficients[it.value()] = val;
if (_baseBlendshapeCoefficients.size() <= it.value()) {
_baseBlendshapeCoefficients.resize(it.value() + 1);
}
_baseBlendshapeCoefficients[it.value()] = val;
}
}

View file

@ -59,6 +59,7 @@ public:
void setBlendshape(QString name, float val);
const QVector<float>& getBlendshapeCoefficients() const { return _blendshapeCoefficients; }
const QVector<float>& getSummedBlendshapeCoefficients();
void setBlendshapeCoefficients(const QVector<float>& blendshapeCoefficients) { _blendshapeCoefficients = blendshapeCoefficients; }
const glm::vec3& getLookAtPosition() const { return _lookAtPosition; }
@ -92,6 +93,8 @@ protected:
float _browAudioLift;
QVector<float> _blendshapeCoefficients;
QVector<float> _baseBlendshapeCoefficients;
QVector<float> _currBlendShapeCoefficients;
AvatarData* _owningAvatar;
private:

View file

@ -338,7 +338,7 @@ void AmbientOcclusionEffect::updateGaussianDistribution() {
GaussianDistribution::evalSampling(coefs, Parameters::GAUSSIAN_COEFS_LENGTH, _parametersBuffer->getBlurRadius(), _parametersBuffer->getBlurDeviation());
}
void AmbientOcclusionEffect::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs) {
void AmbientOcclusionEffect::run(const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
@ -478,7 +478,7 @@ const gpu::PipelinePointer& DebugAmbientOcclusion::getDebugPipeline() {
return _debugPipeline;
}
void DebugAmbientOcclusion::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs) {
void DebugAmbientOcclusion::run(const render::RenderContextPointer& renderContext, const Inputs& inputs) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());

View file

@ -114,7 +114,7 @@ public:
AmbientOcclusionEffect();
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs);
// Class describing the uniform buffer with all the parameters common to the AO shaders
@ -200,7 +200,7 @@ public:
DebugAmbientOcclusion();
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
private:

View file

@ -100,7 +100,7 @@ const gpu::PipelinePointer& Antialiasing::getBlendPipeline() {
return _blendPipeline;
}
void Antialiasing::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const gpu::FramebufferPointer& sourceBuffer) {
void Antialiasing::run(const render::RenderContextPointer& renderContext, const gpu::FramebufferPointer& sourceBuffer) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());

View file

@ -31,7 +31,7 @@ public:
Antialiasing();
~Antialiasing();
void configure(const Config& config) {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const gpu::FramebufferPointer& sourceBuffer);
void run(const render::RenderContextPointer& renderContext, const gpu::FramebufferPointer& sourceBuffer);
const gpu::PipelinePointer& getAntialiasingPipeline();
const gpu::PipelinePointer& getBlendPipeline();

View file

@ -391,7 +391,7 @@ void DebugDeferredBuffer::configure(const Config& config) {
_size = config.size;
}
void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& inputs) {
void DebugDeferredBuffer::run(const RenderContextPointer& renderContext, const Inputs& inputs) {
if (_mode == Off) {
return;
}

View file

@ -45,7 +45,7 @@ public:
~DebugDeferredBuffer();
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
protected:
friend class DebugDeferredBufferConfig;

View file

@ -63,7 +63,7 @@ void DeferredFrameTransform::update(RenderArgs* args) {
}
}
void GenerateDeferredFrameTransform::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, DeferredFrameTransformPointer& frameTransform) {
void GenerateDeferredFrameTransform::run(const render::RenderContextPointer& renderContext, DeferredFrameTransformPointer& frameTransform) {
if (!frameTransform) {
frameTransform = std::make_shared<DeferredFrameTransform>();
}

View file

@ -70,7 +70,7 @@ public:
GenerateDeferredFrameTransform() {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, DeferredFrameTransformPointer& frameTransform);
void run(const render::RenderContextPointer& renderContext, DeferredFrameTransformPointer& frameTransform);
private:
};

View file

@ -479,7 +479,7 @@ model::MeshPointer DeferredLightingEffect::getSpotLightMesh() {
return _spotLightMesh;
}
void PreparePrimaryFramebuffer::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, gpu::FramebufferPointer& primaryFramebuffer) {
void PreparePrimaryFramebuffer::run(const RenderContextPointer& renderContext, gpu::FramebufferPointer& primaryFramebuffer) {
auto framebufferCache = DependencyManager::get<FramebufferCache>();
auto framebufferSize = framebufferCache->getFrameBufferSize();
@ -512,7 +512,7 @@ void PreparePrimaryFramebuffer::run(const SceneContextPointer& sceneContext, con
primaryFramebuffer = _primaryFramebuffer;
}
void PrepareDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs) {
void PrepareDeferred::run(const RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs) {
auto args = renderContext->args;
auto primaryFramebuffer = inputs.get0();
@ -553,7 +553,7 @@ void PrepareDeferred::run(const SceneContextPointer& sceneContext, const RenderC
}
void RenderDeferredSetup::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext,
const DeferredFrameTransformPointer& frameTransform,
const DeferredFramebufferPointer& deferredFramebuffer,
const LightingModelPointer& lightingModel,
@ -681,7 +681,7 @@ RenderDeferredLocals::RenderDeferredLocals() :
}
void RenderDeferredLocals::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
void RenderDeferredLocals::run(const render::RenderContextPointer& renderContext,
const DeferredFrameTransformPointer& frameTransform,
const DeferredFramebufferPointer& deferredFramebuffer,
const LightingModelPointer& lightingModel,
@ -746,7 +746,7 @@ void RenderDeferredLocals::run(const render::SceneContextPointer& sceneContext,
}
}
void RenderDeferredCleanup::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext) {
void RenderDeferredCleanup::run(const render::RenderContextPointer& renderContext) {
auto args = renderContext->args;
auto& batch = (*args->_batch);
{
@ -792,7 +792,7 @@ RenderDeferred::RenderDeferred() {
void RenderDeferred::configure(const Config& config) {
}
void RenderDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& inputs) {
void RenderDeferred::run(const RenderContextPointer& renderContext, const Inputs& inputs) {
PROFILE_RANGE(render, "DeferredLighting");
auto deferredTransform = inputs.get0();
@ -813,11 +813,11 @@ void RenderDeferred::run(const SceneContextPointer& sceneContext, const RenderCo
args->_batch = &batch;
_gpuTimer->begin(batch);
setupJob.run(sceneContext, renderContext, deferredTransform, deferredFramebuffer, lightingModel, surfaceGeometryFramebuffer, ssaoFramebuffer, subsurfaceScatteringResource);
setupJob.run(renderContext, deferredTransform, deferredFramebuffer, lightingModel, surfaceGeometryFramebuffer, ssaoFramebuffer, subsurfaceScatteringResource);
lightsJob.run(sceneContext, renderContext, deferredTransform, deferredFramebuffer, lightingModel, surfaceGeometryFramebuffer, lightClusters);
lightsJob.run(renderContext, deferredTransform, deferredFramebuffer, lightingModel, surfaceGeometryFramebuffer, lightClusters);
cleanupJob.run(sceneContext, renderContext);
cleanupJob.run(renderContext);
_gpuTimer->end(batch);
args->_context->appendFrameBatch(batch);

View file

@ -127,7 +127,7 @@ class PreparePrimaryFramebuffer {
public:
using JobModel = render::Job::ModelO<PreparePrimaryFramebuffer, gpu::FramebufferPointer>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, gpu::FramebufferPointer& primaryFramebuffer);
void run(const render::RenderContextPointer& renderContext, gpu::FramebufferPointer& primaryFramebuffer);
gpu::FramebufferPointer _primaryFramebuffer;
};
@ -141,7 +141,7 @@ public:
using JobModel = render::Job::ModelIO<PrepareDeferred, Inputs, Outputs>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs);
DeferredFramebufferPointer _deferredFramebuffer;
};
@ -150,7 +150,7 @@ class RenderDeferredSetup {
public:
// using JobModel = render::Job::ModelI<RenderDeferredSetup, DeferredFrameTransformPointer>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
void run(const render::RenderContextPointer& renderContext,
const DeferredFrameTransformPointer& frameTransform,
const DeferredFramebufferPointer& deferredFramebuffer,
const LightingModelPointer& lightingModel,
@ -163,7 +163,7 @@ class RenderDeferredLocals {
public:
using JobModel = render::Job::ModelI<RenderDeferredLocals, DeferredFrameTransformPointer>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
void run(const render::RenderContextPointer& renderContext,
const DeferredFrameTransformPointer& frameTransform,
const DeferredFramebufferPointer& deferredFramebuffer,
const LightingModelPointer& lightingModel,
@ -181,7 +181,7 @@ class RenderDeferredCleanup {
public:
using JobModel = render::Job::Model<RenderDeferredCleanup>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext);
void run(const render::RenderContextPointer& renderContext);
};
using RenderDeferredConfig = render::GPUJobConfig;
@ -196,7 +196,7 @@ public:
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
RenderDeferredSetup setupJob;
RenderDeferredLocals lightsJob;

View file

@ -68,7 +68,7 @@ const gpu::PipelinePointer& HitEffect::getHitEffectPipeline() {
return _hitEffectPipeline;
}
void HitEffect::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext) {
void HitEffect::run(const render::RenderContextPointer& renderContext) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
RenderArgs* args = renderContext->args;

View file

@ -26,7 +26,7 @@ public:
HitEffect();
~HitEffect();
void configure(const Config& config) {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext);
void run(const render::RenderContextPointer& renderContext);
const gpu::PipelinePointer& getHitEffectPipeline();

View file

@ -558,7 +558,7 @@ void LightClusteringPass::configure(const Config& config) {
_freeze = config.freeze;
}
void LightClusteringPass::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& output) {
void LightClusteringPass::run(const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& output) {
auto args = renderContext->args;
auto deferredTransform = inputs.get0();
@ -697,7 +697,7 @@ const gpu::PipelinePointer DebugLightClusters::getDrawClusterContentPipeline() {
}
void DebugLightClusters::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs) {
void DebugLightClusters::run(const render::RenderContextPointer& renderContext, const Inputs& inputs) {
if (!(doDrawClusterFromDepth || doDrawContent || doDrawGrid)) {
return;
}

View file

@ -176,7 +176,7 @@ public:
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& output);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& output);
protected:
LightClustersPointer _lightClusters;
@ -221,7 +221,7 @@ public:
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
protected:
gpu::BufferPointer _gridBuffer;

View file

@ -179,7 +179,7 @@ void MakeLightingModel::configure(const Config& config) {
_lightingModel->setWireframe(config.enableWireframe);
}
void MakeLightingModel::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, LightingModelPointer& lightingModel) {
void MakeLightingModel::run(const render::RenderContextPointer& renderContext, LightingModelPointer& lightingModel) {
lightingModel = _lightingModel;

View file

@ -171,7 +171,7 @@ public:
MakeLightingModel();
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, LightingModelPointer& lightingModel);
void run(const render::RenderContextPointer& renderContext, LightingModelPointer& lightingModel);
private:
LightingModelPointer _lightingModel;

View file

@ -218,14 +218,14 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
task.addJob<Blit>("Blit", primaryFramebuffer);
}
void BeginGPURangeTimer::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, gpu::RangeTimerPointer& timer) {
void BeginGPURangeTimer::run(const render::RenderContextPointer& renderContext, gpu::RangeTimerPointer& timer) {
timer = _gpuTimer;
gpu::doInBatch(renderContext->args->_context, [&](gpu::Batch& batch) {
_gpuTimer->begin(batch);
});
}
void EndGPURangeTimer::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const gpu::RangeTimerPointer& timer) {
void EndGPURangeTimer::run(const render::RenderContextPointer& renderContext, const gpu::RangeTimerPointer& timer) {
gpu::doInBatch(renderContext->args->_context, [&](gpu::Batch& batch) {
timer->end(batch);
});
@ -235,7 +235,7 @@ void EndGPURangeTimer::run(const render::SceneContextPointer& sceneContext, cons
}
void DrawDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& inputs) {
void DrawDeferred::run(const RenderContextPointer& renderContext, const Inputs& inputs) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
@ -272,7 +272,7 @@ void DrawDeferred::run(const SceneContextPointer& sceneContext, const RenderCont
ShapeKey globalKey = keyBuilder.build();
args->_globalShapeKey = globalKey._flags.to_ulong();
renderShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn, globalKey);
renderShapes(renderContext, _shapePlumber, inItems, _maxDrawn, globalKey);
args->_batch = nullptr;
args->_globalShapeKey = 0;
@ -281,7 +281,7 @@ void DrawDeferred::run(const SceneContextPointer& sceneContext, const RenderCont
config->setNumDrawn((int)inItems.size());
}
void DrawStateSortDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& inputs) {
void DrawStateSortDeferred::run(const RenderContextPointer& renderContext, const Inputs& inputs) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
@ -319,9 +319,9 @@ void DrawStateSortDeferred::run(const SceneContextPointer& sceneContext, const R
args->_globalShapeKey = globalKey._flags.to_ulong();
if (_stateSort) {
renderStateSortShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn, globalKey);
renderStateSortShapes(renderContext, _shapePlumber, inItems, _maxDrawn, globalKey);
} else {
renderShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn, globalKey);
renderShapes(renderContext, _shapePlumber, inItems, _maxDrawn, globalKey);
}
args->_batch = nullptr;
args->_globalShapeKey = 0;
@ -336,7 +336,7 @@ DrawOverlay3D::DrawOverlay3D(bool opaque) :
initOverlay3DPipelines(*_shapePlumber);
}
void DrawOverlay3D::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& inputs) {
void DrawOverlay3D::run(const RenderContextPointer& renderContext, const Inputs& inputs) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
@ -378,7 +378,7 @@ void DrawOverlay3D::run(const SceneContextPointer& sceneContext, const RenderCon
// Setup lighting model for all items;
batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer());
renderShapes(sceneContext, renderContext, _shapePlumber, inItems, _maxDrawn);
renderShapes(renderContext, _shapePlumber, inItems, _maxDrawn);
args->_batch = nullptr;
});
}
@ -403,7 +403,7 @@ gpu::PipelinePointer DrawStencilDeferred::getOpaquePipeline() {
return _opaquePipeline;
}
void DrawStencilDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const DeferredFramebufferPointer& deferredFramebuffer) {
void DrawStencilDeferred::run(const RenderContextPointer& renderContext, const DeferredFramebufferPointer& deferredFramebuffer) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
@ -430,7 +430,7 @@ void DrawStencilDeferred::run(const SceneContextPointer& sceneContext, const Ren
args->_batch = nullptr;
}
void DrawBackgroundDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& inputs) {
void DrawBackgroundDeferred::run(const RenderContextPointer& renderContext, const Inputs& inputs) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
@ -458,7 +458,7 @@ void DrawBackgroundDeferred::run(const SceneContextPointer& sceneContext, const
batch.setProjectionTransform(projMat);
batch.setViewTransform(viewMat);
renderItems(sceneContext, renderContext, inItems);
renderItems(renderContext, inItems);
// _gpuTimer.end(batch);
});
args->_batch = nullptr;
@ -466,7 +466,7 @@ void DrawBackgroundDeferred::run(const SceneContextPointer& sceneContext, const
// std::static_pointer_cast<Config>(renderContext->jobConfig)->gpuTime = _gpuTimer.getAverage();
}
void Blit::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const gpu::FramebufferPointer& srcFramebuffer) {
void Blit::run(const RenderContextPointer& renderContext, const gpu::FramebufferPointer& srcFramebuffer) {
assert(renderContext->args);
assert(renderContext->args->_context);

View file

@ -23,7 +23,7 @@ public:
BeginGPURangeTimer(const std::string& name) : _gpuTimer(std::make_shared<gpu::RangeTimer>(name)) {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, gpu::RangeTimerPointer& timer);
void run(const render::RenderContextPointer& renderContext, gpu::RangeTimerPointer& timer);
protected:
gpu::RangeTimerPointer _gpuTimer;
@ -39,7 +39,7 @@ public:
EndGPURangeTimer() {}
void configure(const Config& config) {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const gpu::RangeTimerPointer& timer);
void run(const render::RenderContextPointer& renderContext, const gpu::RangeTimerPointer& timer);
protected:
};
@ -74,7 +74,7 @@ public:
DrawDeferred(render::ShapePlumberPointer shapePlumber) : _shapePlumber{ shapePlumber } {}
void configure(const Config& config) { _maxDrawn = config.maxDrawn; }
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
protected:
render::ShapePlumberPointer _shapePlumber;
@ -112,7 +112,7 @@ public:
DrawStateSortDeferred(render::ShapePlumberPointer shapePlumber) : _shapePlumber{ shapePlumber } {}
void configure(const Config& config) { _maxDrawn = config.maxDrawn; _stateSort = config.stateSort; }
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
protected:
render::ShapePlumberPointer _shapePlumber;
@ -125,7 +125,7 @@ class DrawStencilDeferred {
public:
using JobModel = render::Job::ModelI<DrawStencilDeferred, std::shared_ptr<DeferredFramebuffer>>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const std::shared_ptr<DeferredFramebuffer>& deferredFramebuffer);
void run(const render::RenderContextPointer& renderContext, const std::shared_ptr<DeferredFramebuffer>& deferredFramebuffer);
protected:
gpu::PipelinePointer _opaquePipeline;
@ -143,7 +143,7 @@ public:
using JobModel = render::Job::ModelI<DrawBackgroundDeferred, Inputs, Config>;
void configure(const Config& config) {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
protected:
gpu::RangeTimerPointer _gpuTimer;
@ -177,7 +177,7 @@ public:
DrawOverlay3D(bool opaque);
void configure(const Config& config) { _maxDrawn = config.maxDrawn; }
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
protected:
render::ShapePlumberPointer _shapePlumber;
@ -189,7 +189,7 @@ class Blit {
public:
using JobModel = render::Job::ModelI<Blit, gpu::FramebufferPointer>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const gpu::FramebufferPointer& srcFramebuffer);
void run(const render::RenderContextPointer& renderContext, const gpu::FramebufferPointer& srcFramebuffer);
};
class RenderDeferredTask {

View file

@ -59,7 +59,7 @@ void RenderForwardTask::build(JobModel& task, const render::Varying& input, rend
task.addJob<Blit>("Blit", framebuffer);
}
void PrepareFramebuffer::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext,
void PrepareFramebuffer::run(const RenderContextPointer& renderContext,
gpu::FramebufferPointer& framebuffer) {
auto framebufferCache = DependencyManager::get<FramebufferCache>();
auto framebufferSize = framebufferCache->getFrameBufferSize();
@ -100,7 +100,7 @@ void PrepareFramebuffer::run(const SceneContextPointer& sceneContext, const Rend
framebuffer = _framebuffer;
}
void Draw::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext,
void Draw::run(const RenderContextPointer& renderContext,
const Inputs& items) {
RenderArgs* args = renderContext->args;
@ -117,7 +117,7 @@ void Draw::run(const SceneContextPointer& sceneContext, const RenderContextPoint
batch.setModelTransform(Transform());
// Render items
renderStateSortShapes(sceneContext, renderContext, _shapePlumber, items, -1);
renderStateSortShapes(renderContext, _shapePlumber, items, -1);
});
args->_batch = nullptr;
}
@ -142,7 +142,7 @@ const gpu::PipelinePointer Stencil::getPipeline() {
return _stencilPipeline;
}
void Stencil::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
void Stencil::run(const RenderContextPointer& renderContext) {
RenderArgs* args = renderContext->args;
gpu::doInBatch(args->_context, [&](gpu::Batch& batch) {
@ -158,7 +158,7 @@ void Stencil::run(const SceneContextPointer& sceneContext, const RenderContextPo
args->_batch = nullptr;
}
void DrawBackground::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext,
void DrawBackground::run(const RenderContextPointer& renderContext,
const Inputs& background) {
RenderArgs* args = renderContext->args;
@ -177,7 +177,7 @@ void DrawBackground::run(const SceneContextPointer& sceneContext, const RenderCo
batch.setProjectionTransform(projMat);
batch.setViewTransform(viewMat);
renderItems(sceneContext, renderContext, background);
renderItems(renderContext, background);
});
args->_batch = nullptr;
}

View file

@ -31,7 +31,7 @@ public:
using Inputs = gpu::FramebufferPointer;
using JobModel = render::Job::ModelO<PrepareFramebuffer, Inputs>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
void run(const render::RenderContextPointer& renderContext,
gpu::FramebufferPointer& framebuffer);
private:
@ -44,7 +44,7 @@ public:
using JobModel = render::Job::ModelI<Draw, Inputs>;
Draw(const render::ShapePlumberPointer& shapePlumber) : _shapePlumber(shapePlumber) {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
void run(const render::RenderContextPointer& renderContext,
const Inputs& items);
private:
@ -55,7 +55,7 @@ class Stencil {
public:
using JobModel = render::Job::Model<Stencil>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext);
void run(const render::RenderContextPointer& renderContext);
private:
const gpu::PipelinePointer getPipeline();
@ -67,7 +67,7 @@ public:
using Inputs = render::ItemBounds;
using JobModel = render::Job::ModelI<DrawBackground, Inputs>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
void run(const render::RenderContextPointer& renderContext,
const Inputs& background);
};

View file

@ -31,7 +31,7 @@
using namespace render;
void RenderShadowMap::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
void RenderShadowMap::run(const render::RenderContextPointer& renderContext,
const render::ShapeBounds& inShapes) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
@ -74,7 +74,7 @@ void RenderShadowMap::run(const render::SceneContextPointer& sceneContext, const
if (items.first.isSkinned()) {
skinnedShapeKeys.push_back(items.first);
} else {
renderItems(sceneContext, renderContext, items.second);
renderItems(renderContext, items.second);
}
}
@ -82,7 +82,7 @@ void RenderShadowMap::run(const render::SceneContextPointer& sceneContext, const
args->_pipeline = shadowSkinnedPipeline;
batch.setPipeline(shadowSkinnedPipeline->pipeline);
for (const auto& key : skinnedShapeKeys) {
renderItems(sceneContext, renderContext, inShapes.at(key));
renderItems(renderContext, inShapes.at(key));
}
args->_pipeline = nullptr;
@ -139,7 +139,7 @@ void RenderShadowTask::configure(const Config& configuration) {
// Task::configure(configuration);
}
void RenderShadowSetup::run(const SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, Output& output) {
void RenderShadowSetup::run(const render::RenderContextPointer& renderContext, Output& output) {
auto lightStage = DependencyManager::get<DeferredLightingEffect>()->getLightStage();
const auto globalShadow = lightStage->getShadow(0);
@ -157,7 +157,7 @@ void RenderShadowSetup::run(const SceneContextPointer& sceneContext, const rende
args->_renderMode = RenderArgs::SHADOW_RENDER_MODE;
}
void RenderShadowTeardown::run(const SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Input& input) {
void RenderShadowTeardown::run(const render::RenderContextPointer& renderContext, const Input& input) {
RenderArgs* args = renderContext->args;
// Reset the render args

View file

@ -24,7 +24,7 @@ public:
using JobModel = render::Job::ModelI<RenderShadowMap, render::ShapeBounds>;
RenderShadowMap(render::ShapePlumberPointer shapePlumber) : _shapePlumber{ shapePlumber } {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
void run(const render::RenderContextPointer& renderContext,
const render::ShapeBounds& inShapes);
protected:
@ -56,14 +56,14 @@ class RenderShadowSetup {
public:
using Output = RenderArgs::RenderMode;
using JobModel = render::Job::ModelO<RenderShadowSetup, Output>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, Output& output);
void run(const render::RenderContextPointer& renderContext, Output& output);
};
class RenderShadowTeardown {
public:
using Input = RenderArgs::RenderMode;
using JobModel = render::Job::ModelI<RenderShadowTeardown, Input>;
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Input& input);
void run(const render::RenderContextPointer& renderContext, const Input& input);
};
#endif // hifi_RenderShadowTask_h

View file

@ -134,7 +134,7 @@ void SubsurfaceScattering::configure(const Config& config) {
_scatteringResource->setShowDiffusedNormal(config.showDiffusedNormal);
}
void SubsurfaceScattering::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, Outputs& outputs) {
void SubsurfaceScattering::run(const render::RenderContextPointer& renderContext, Outputs& outputs) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
@ -506,7 +506,7 @@ gpu::PipelinePointer DebugSubsurfaceScattering::getShowLUTPipeline() {
}
void DebugSubsurfaceScattering::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs) {
void DebugSubsurfaceScattering::run(const render::RenderContextPointer& renderContext, const Inputs& inputs) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());

View file

@ -132,7 +132,7 @@ public:
SubsurfaceScattering();
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, Outputs& outputs);
void run(const render::RenderContextPointer& renderContext, Outputs& outputs);
private:
SubsurfaceScatteringResourcePointer _scatteringResource;
@ -170,7 +170,7 @@ public:
DebugSubsurfaceScattering();
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
private:

View file

@ -133,7 +133,7 @@ LinearDepthPass::LinearDepthPass() {
void LinearDepthPass::configure(const Config& config) {
}
void LinearDepthPass::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs) {
void LinearDepthPass::run(const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
@ -404,7 +404,7 @@ void SurfaceGeometryPass::configure(const Config& config) {
}
void SurfaceGeometryPass::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs) {
void SurfaceGeometryPass::run(const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());

View file

@ -74,7 +74,7 @@ public:
LinearDepthPass();
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs);
private:
typedef gpu::BufferView UniformBufferView;
@ -169,7 +169,7 @@ public:
SurfaceGeometryPass();
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs);
float getCurvatureDepthThreshold() const { return _parametersBuffer.get<Parameters>().curvatureInfo.x; }

View file

@ -88,7 +88,7 @@ void ToneMappingDeferred::configure(const Config& config) {
_toneMappingEffect.setToneCurve((ToneMappingEffect::ToneCurve)config.curve);
}
void ToneMappingDeferred::run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs) {
void ToneMappingDeferred::run(const render::RenderContextPointer& renderContext, const Inputs& inputs) {
auto lightingBuffer = inputs.get0()->getRenderBuffer(0);
auto destFbo = inputs.get1();

View file

@ -89,7 +89,7 @@ public:
using JobModel = render::Job::ModelI<ToneMappingDeferred, Inputs, Config>;
void configure(const Config& config);
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext, const Inputs& inputs);
void run(const render::RenderContextPointer& renderContext, const Inputs& inputs);
ToneMappingEffect _toneMappingEffect;
};

View file

@ -200,7 +200,7 @@ void BlurGaussian::configure(const Config& config) {
}
void BlurGaussian::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const gpu::FramebufferPointer& sourceFramebuffer, gpu::FramebufferPointer& blurredFramebuffer) {
void BlurGaussian::run(const RenderContextPointer& renderContext, const gpu::FramebufferPointer& sourceFramebuffer, gpu::FramebufferPointer& blurredFramebuffer) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
@ -308,7 +308,7 @@ void BlurGaussianDepthAware::configure(const Config& config) {
}
void BlurGaussianDepthAware::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& SourceAndDepth, gpu::FramebufferPointer& blurredFramebuffer) {
void BlurGaussianDepthAware::run(const RenderContextPointer& renderContext, const Inputs& SourceAndDepth, gpu::FramebufferPointer& blurredFramebuffer) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());

View file

@ -105,7 +105,7 @@ public:
BlurGaussian(bool generateOutputFramebuffer = false);
void configure(const Config& config);
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const gpu::FramebufferPointer& sourceFramebuffer, gpu::FramebufferPointer& blurredFramebuffer);
void run(const RenderContextPointer& renderContext, const gpu::FramebufferPointer& sourceFramebuffer, gpu::FramebufferPointer& blurredFramebuffer);
protected:
@ -141,7 +141,7 @@ public:
BlurGaussianDepthAware(bool generateNewOutput = false, const BlurParamsPointer& params = BlurParamsPointer());
void configure(const Config& config);
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const Inputs& SourceAndDepth, gpu::FramebufferPointer& blurredFramebuffer);
void run(const RenderContextPointer& renderContext, const Inputs& SourceAndDepth, gpu::FramebufferPointer& blurredFramebuffer);
const BlurParamsPointer& getParameters() const { return _parameters; }

View file

@ -16,20 +16,13 @@
namespace render {
class SceneContext {
public:
ScenePointer _scene;
SceneContext() {}
};
using SceneContextPointer = std::shared_ptr<SceneContext>;
class JobConfig;
class JobConfig;
class RenderContext {
public:
RenderArgs* args;
std::shared_ptr<JobConfig> jobConfig{ nullptr };
ScenePointer _scene;
};
using RenderContextPointer = std::shared_ptr<RenderContext>;

View file

@ -61,10 +61,10 @@ void render::cullItems(const RenderContextPointer& renderContext, const CullFunc
details._rendered += (int)outItems.size();
}
void FetchNonspatialItems::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, ItemBounds& outItems) {
void FetchNonspatialItems::run(const RenderContextPointer& renderContext, ItemBounds& outItems) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
auto& scene = sceneContext->_scene;
auto& scene = renderContext->_scene;
outItems.clear();
@ -82,11 +82,11 @@ void FetchSpatialTree::configure(const Config& config) {
_lodAngle = config.lodAngle;
}
void FetchSpatialTree::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, ItemSpatialTree::ItemSelection& outSelection) {
void FetchSpatialTree::run(const RenderContextPointer& renderContext, ItemSpatialTree::ItemSelection& outSelection) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
RenderArgs* args = renderContext->args;
auto& scene = sceneContext->_scene;
auto& scene = renderContext->_scene;
// start fresh
outSelection.clear();
@ -112,12 +112,12 @@ void CullSpatialSelection::configure(const Config& config) {
_skipCulling = config.skipCulling;
}
void CullSpatialSelection::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext,
void CullSpatialSelection::run(const RenderContextPointer& renderContext,
const ItemSpatialTree::ItemSelection& inSelection, ItemBounds& outItems) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
RenderArgs* args = renderContext->args;
auto& scene = sceneContext->_scene;
auto& scene = renderContext->_scene;
auto& details = args->_details.edit(_detailType);
details._considered += (int)inSelection.numItems();

View file

@ -25,7 +25,7 @@ namespace render {
class FetchNonspatialItems {
public:
using JobModel = Job::ModelO<FetchNonspatialItems, ItemBounds>;
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, ItemBounds& outItems);
void run(const RenderContextPointer& renderContext, ItemBounds& outItems);
};
class FetchSpatialTreeConfig : public Job::Config {
@ -63,7 +63,7 @@ namespace render {
ItemFilter _filter{ ItemFilter::Builder::opaqueShape().withoutLayered() };
void configure(const Config& config);
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, ItemSpatialTree::ItemSelection& outSelection);
void run(const RenderContextPointer& renderContext, ItemSpatialTree::ItemSelection& outSelection);
};
class CullSpatialSelectionConfig : public Job::Config {
@ -106,7 +106,7 @@ namespace render {
ItemFilter _filter{ ItemFilter::Builder::opaqueShape().withoutLayered() };
void configure(const Config& config);
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection, ItemBounds& outItems);
void run(const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection, ItemBounds& outItems);
};
}

View file

@ -84,12 +84,11 @@ void DrawSceneOctree::configure(const Config& config) {
}
void DrawSceneOctree::run(const SceneContextPointer& sceneContext,
const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection) {
void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
RenderArgs* args = renderContext->args;
auto& scene = sceneContext->_scene;
auto& scene = renderContext->_scene;
std::static_pointer_cast<Config>(renderContext->jobConfig)->numAllocatedCells = (int)scene->getSpatialTree().getNumAllocatedCells();
std::static_pointer_cast<Config>(renderContext->jobConfig)->numFreeCells = (int)scene->getSpatialTree().getNumFreeCells();
@ -196,12 +195,11 @@ void DrawItemSelection::configure(const Config& config) {
}
void DrawItemSelection::run(const SceneContextPointer& sceneContext,
const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection) {
void DrawItemSelection::run(const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
RenderArgs* args = renderContext->args;
auto& scene = sceneContext->_scene;
auto& scene = renderContext->_scene;
gpu::doInBatch(args->_context, [&](gpu::Batch& batch) {
glm::mat4 projMat;

View file

@ -71,7 +71,7 @@ namespace render {
DrawSceneOctree() {}
void configure(const Config& config);
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& selection);
void run(const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& selection);
const gpu::PipelinePointer getDrawCellBoundsPipeline();
const gpu::PipelinePointer getDrawLODReticlePipeline();
@ -129,7 +129,7 @@ namespace render {
DrawItemSelection() {}
void configure(const Config& config);
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& selection);
void run(const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& selection);
const gpu::PipelinePointer getDrawItemBoundPipeline();
};

View file

@ -103,13 +103,11 @@ void DrawStatus::configure(const Config& config) {
_showNetwork = config.showNetwork;
}
void DrawStatus::run(const SceneContextPointer& sceneContext,
const RenderContextPointer& renderContext,
const ItemBounds& inItems) {
void DrawStatus::run(const RenderContextPointer& renderContext, const ItemBounds& inItems) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
RenderArgs* args = renderContext->args;
auto& scene = sceneContext->_scene;
auto& scene = renderContext->_scene;
const int NUM_STATUS_VEC4_PER_ITEM = 2;
const int VEC4_LENGTH = 4;

View file

@ -45,7 +45,7 @@ namespace render {
DrawStatus(const gpu::TexturePointer statusIconMap) { setStatusIconMap(statusIconMap); }
void configure(const Config& config);
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems);
void run(const RenderContextPointer& renderContext, const ItemBounds& inItems);
const gpu::PipelinePointer getDrawItemBoundsPipeline();
const gpu::PipelinePointer getDrawItemStatusPipeline();

View file

@ -25,8 +25,8 @@
using namespace render;
void render::renderItems(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, int maxDrawnItems) {
auto& scene = sceneContext->_scene;
void render::renderItems(const RenderContextPointer& renderContext, const ItemBounds& inItems, int maxDrawnItems) {
auto& scene = renderContext->_scene;
RenderArgs* args = renderContext->args;
int numItemsToDraw = (int)inItems.size();
@ -55,9 +55,9 @@ void renderShape(RenderArgs* args, const ShapePlumberPointer& shapeContext, cons
}
}
void render::renderShapes(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext,
void render::renderShapes(const RenderContextPointer& renderContext,
const ShapePlumberPointer& shapeContext, const ItemBounds& inItems, int maxDrawnItems, const ShapeKey& globalKey) {
auto& scene = sceneContext->_scene;
auto& scene = renderContext->_scene;
RenderArgs* args = renderContext->args;
int numItemsToDraw = (int)inItems.size();
@ -70,9 +70,9 @@ void render::renderShapes(const SceneContextPointer& sceneContext, const RenderC
}
}
void render::renderStateSortShapes(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext,
void render::renderStateSortShapes(const RenderContextPointer& renderContext,
const ShapePlumberPointer& shapeContext, const ItemBounds& inItems, int maxDrawnItems, const ShapeKey& globalKey) {
auto& scene = sceneContext->_scene;
auto& scene = renderContext->_scene;
RenderArgs* args = renderContext->args;
int numItemsToDraw = (int)inItems.size();
@ -123,7 +123,7 @@ void render::renderStateSortShapes(const SceneContextPointer& sceneContext, cons
}
}
void DrawLight::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inLights) {
void DrawLight::run(const RenderContextPointer& renderContext, const ItemBounds& inLights) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
RenderArgs* args = renderContext->args;
@ -131,7 +131,7 @@ void DrawLight::run(const SceneContextPointer& sceneContext, const RenderContext
// render lights
gpu::doInBatch(args->_context, [&](gpu::Batch& batch) {
args->_batch = &batch;
renderItems(sceneContext, renderContext, inLights, _maxDrawn);
renderItems(renderContext, inLights, _maxDrawn);
args->_batch = nullptr;
});
@ -163,7 +163,7 @@ const gpu::PipelinePointer DrawBounds::getPipeline() {
return _boundsPipeline;
}
void DrawBounds::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext,
void DrawBounds::run(const RenderContextPointer& renderContext,
const Inputs& items) {
RenderArgs* args = renderContext->args;

View file

@ -16,9 +16,9 @@
namespace render {
void renderItems(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, int maxDrawnItems = -1);
void renderShapes(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ShapePlumberPointer& shapeContext, const ItemBounds& inItems, int maxDrawnItems = -1, const ShapeKey& globalKey = ShapeKey());
void renderStateSortShapes(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ShapePlumberPointer& shapeContext, const ItemBounds& inItems, int maxDrawnItems = -1, const ShapeKey& globalKey = ShapeKey());
void renderItems(const RenderContextPointer& renderContext, const ItemBounds& inItems, int maxDrawnItems = -1);
void renderShapes(const RenderContextPointer& renderContext, const ShapePlumberPointer& shapeContext, const ItemBounds& inItems, int maxDrawnItems = -1, const ShapeKey& globalKey = ShapeKey());
void renderStateSortShapes(const RenderContextPointer& renderContext, const ShapePlumberPointer& shapeContext, const ItemBounds& inItems, int maxDrawnItems = -1, const ShapeKey& globalKey = ShapeKey());
class DrawLightConfig : public Job::Config {
Q_OBJECT
@ -43,7 +43,7 @@ public:
using JobModel = Job::ModelI<DrawLight, ItemBounds, Config>;
void configure(const Config& config) { _maxDrawn = config.maxDrawn; }
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inLights);
void run(const RenderContextPointer& renderContext, const ItemBounds& inLights);
protected:
int _maxDrawn; // initialized by Config
};
@ -59,7 +59,7 @@ public:
using JobModel = render::Job::ModelI<DrawBounds, Inputs, Config>;
void configure(const Config& configuration) {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
void run(const render::RenderContextPointer& renderContext,
const Inputs& items);
private:

View file

@ -35,7 +35,6 @@ public:
};
Engine::Engine() : Task("Engine", EngineTask::JobModel::create()),
_sceneContext(std::make_shared<SceneContext>()),
_renderContext(std::make_shared<RenderContext>())
{
}

View file

@ -32,18 +32,16 @@ namespace render {
void load();
// Register the scene
void registerScene(const ScenePointer& scene) { _sceneContext->_scene = scene; }
void registerScene(const ScenePointer& scene) { _renderContext->_scene = scene; }
// Push a RenderContext
void setRenderContext(const RenderContext& renderContext) { (*_renderContext) = renderContext; }
// acces the RenderContext
RenderContextPointer getRenderContext() const { return _renderContext; }
// Render a frame
// Must have a scene registered and a context set
void run() { assert(_sceneContext && _renderContext); Task::run(_sceneContext, _renderContext); }
void run() { assert(_renderContext); Task::run(_renderContext); }
protected:
SceneContextPointer _sceneContext;
RenderContextPointer _renderContext;
};
using EnginePointer = std::shared_ptr<Engine>;

View file

@ -14,7 +14,7 @@
using namespace render;
void EngineStats::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
void EngineStats::run(const RenderContextPointer& renderContext) {
// Tick time
quint64 msecsElapsed = _frameTimer.restart();

View file

@ -99,7 +99,7 @@ namespace render {
EngineStats() { _frameTimer.start(); }
void configure(const Config& configuration) {}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext);
void run(const RenderContextPointer& renderContext);
};
}

View file

@ -21,8 +21,8 @@
using namespace render;
void FilterLayeredItems::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
auto& scene = sceneContext->_scene;
void FilterLayeredItems::run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
auto& scene = renderContext->_scene;
// Clear previous values
outItems.clear();
@ -36,7 +36,7 @@ void FilterLayeredItems::run(const SceneContextPointer& sceneContext, const Rend
}
}
void SliceItems::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
void SliceItems::run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
outItems.clear();
std::static_pointer_cast<Config>(renderContext->jobConfig)->setNumItems((int)inItems.size());
@ -51,8 +51,8 @@ void SliceItems::run(const SceneContextPointer& sceneContext, const RenderContex
}
void SelectItems::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
auto selection = sceneContext->_scene->getSelection(_name);
void SelectItems::run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
auto selection = renderContext->_scene->getSelection(_name);
const auto& selectedItems = selection.getItems();
outItems.clear();
@ -67,8 +67,8 @@ void SelectItems::run(const SceneContextPointer& sceneContext, const RenderConte
}
}
void SelectSortItems::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
auto selection = sceneContext->_scene->getSelection(_name);
void SelectSortItems::run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
auto selection = renderContext->_scene->getSelection(_name);
const auto& selectedItems = selection.getItems();
outItems.clear();
@ -98,8 +98,8 @@ void SelectSortItems::run(const SceneContextPointer& sceneContext, const RenderC
}
}
void MetaToSubItems::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemIDs& outItems) {
auto& scene = sceneContext->_scene;
void MetaToSubItems::run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemIDs& outItems) {
auto& scene = renderContext->_scene;
// Now we have a selection of items to render
outItems.clear();

View file

@ -41,8 +41,8 @@ namespace render {
ItemFilterArray _filters;
void configure(const Config& config) {}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBoundsArray& outItems) {
auto& scene = sceneContext->_scene;
void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBoundsArray& outItems) {
auto& scene = renderContext->_scene;
// Clear previous values
for (size_t i = 0; i < NUM_FILTERS; i++) {
@ -73,7 +73,7 @@ namespace render {
int _keepLayer { 0 };
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
};
// SliceItems job config defining the slice range
@ -107,7 +107,7 @@ namespace render {
_rangeLength = config.rangeLength;
}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
};
// Keep items belonging to the job selection
@ -118,7 +118,7 @@ namespace render {
std::string _name;
SelectItems(const Selection::Name& name) : _name(name) {}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
};
// Same as SelectItems but reorder the output to match the selection order
@ -129,7 +129,7 @@ namespace render {
std::string _name;
SelectSortItems(const Selection::Name& name) : _name(name) {}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
};
// From meta-Items, generate the sub-items
@ -139,7 +139,7 @@ namespace render {
MetaToSubItems() {}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemIDs& outItems);
void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemIDs& outItems);
};
}

View file

@ -40,11 +40,11 @@ struct BackToFrontSort {
}
};
void render::depthSortItems(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, bool frontToBack, const ItemBounds& inItems, ItemBounds& outItems) {
void render::depthSortItems(const RenderContextPointer& renderContext, bool frontToBack, const ItemBounds& inItems, ItemBounds& outItems) {
assert(renderContext->args);
assert(renderContext->args->hasViewFrustum());
auto& scene = sceneContext->_scene;
auto& scene = renderContext->_scene;
RenderArgs* args = renderContext->args;
@ -80,8 +80,8 @@ void render::depthSortItems(const SceneContextPointer& sceneContext, const Rende
}
}
void PipelineSortShapes::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ShapeBounds& outShapes) {
auto& scene = sceneContext->_scene;
void PipelineSortShapes::run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ShapeBounds& outShapes) {
auto& scene = renderContext->_scene;
outShapes.clear();
for (const auto& item : inItems) {
@ -100,7 +100,7 @@ void PipelineSortShapes::run(const SceneContextPointer& sceneContext, const Rend
}
}
void DepthSortShapes::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ShapeBounds& inShapes, ShapeBounds& outShapes) {
void DepthSortShapes::run(const RenderContextPointer& renderContext, const ShapeBounds& inShapes, ShapeBounds& outShapes) {
outShapes.clear();
outShapes.reserve(inShapes.size());
@ -111,10 +111,10 @@ void DepthSortShapes::run(const SceneContextPointer& sceneContext, const RenderC
outItems = outShapes.insert(std::make_pair(pipeline.first, ItemBounds{})).first;
}
depthSortItems(sceneContext, renderContext, _frontToBack, inItems, outItems->second);
depthSortItems(renderContext, _frontToBack, inItems, outItems->second);
}
}
void DepthSortItems::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
depthSortItems(sceneContext, renderContext, _frontToBack, inItems, outItems);
void DepthSortItems::run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
depthSortItems(renderContext, _frontToBack, inItems, outItems);
}

View file

@ -15,12 +15,12 @@
#include "Engine.h"
namespace render {
void depthSortItems(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, bool frontToBack, const ItemBounds& inItems, ItemBounds& outItems);
void depthSortItems(const RenderContextPointer& renderContext, bool frontToBack, const ItemBounds& inItems, ItemBounds& outItems);
class PipelineSortShapes {
public:
using JobModel = Job::ModelIO<PipelineSortShapes, ItemBounds, ShapeBounds>;
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ShapeBounds& outShapes);
void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ShapeBounds& outShapes);
};
class DepthSortShapes {
@ -30,7 +30,7 @@ namespace render {
bool _frontToBack;
DepthSortShapes(bool frontToBack = true) : _frontToBack(frontToBack) {}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ShapeBounds& inShapes, ShapeBounds& outShapes);
void run(const RenderContextPointer& renderContext, const ShapeBounds& inShapes, ShapeBounds& outShapes);
};
class DepthSortItems {
@ -40,7 +40,7 @@ namespace render {
bool _frontToBack;
DepthSortItems(bool frontToBack = true) : _frontToBack(frontToBack) {}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
};
}

View file

@ -451,17 +451,17 @@ template<class T> void jobConfigure(T&, const JobConfig&) {
template<class T> void jobConfigure(T&, const TaskConfig&) {
// nop, as the default TaskConfig was used, so the data does not need a configure method
}
template <class T> void jobRun(T& data, const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const JobNoIO& input, JobNoIO& output) {
data.run(sceneContext, renderContext);
template <class T> void jobRun(T& data, const RenderContextPointer& renderContext, const JobNoIO& input, JobNoIO& output) {
data.run(renderContext);
}
template <class T, class I> void jobRun(T& data, const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const I& input, JobNoIO& output) {
data.run(sceneContext, renderContext, input);
template <class T, class I> void jobRun(T& data, const RenderContextPointer& renderContext, const I& input, JobNoIO& output) {
data.run(renderContext, input);
}
template <class T, class O> void jobRun(T& data, const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const JobNoIO& input, O& output) {
data.run(sceneContext, renderContext, output);
template <class T, class O> void jobRun(T& data, const RenderContextPointer& renderContext, const JobNoIO& input, O& output) {
data.run(renderContext, output);
}
template <class T, class I, class O> void jobRun(T& data, const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const I& input, O& output) {
data.run(sceneContext, renderContext, input, output);
template <class T, class I, class O> void jobRun(T& data, const RenderContextPointer& renderContext, const I& input, O& output) {
data.run(renderContext, input, output);
}
// The guts of a job
@ -479,7 +479,7 @@ public:
virtual QConfigPointer& getConfiguration() { return _config; }
virtual void applyConfiguration() = 0;
virtual void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) = 0;
virtual void run(const RenderContextPointer& renderContext) = 0;
protected:
void setCPURunTime(double mstime) { std::static_pointer_cast<Config>(_config)->setCPURunTime(mstime); }
@ -529,10 +529,10 @@ public:
jobConfigure(_data, *std::static_pointer_cast<C>(_config));
}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) override {
void run(const RenderContextPointer& renderContext) override {
renderContext->jobConfig = std::static_pointer_cast<Config>(_config);
if (renderContext->jobConfig->alwaysEnabled || renderContext->jobConfig->isEnabled()) {
jobRun(_data, sceneContext, renderContext, _input.get<I>(), _output.edit<O>());
jobRun(_data, renderContext, _input.get<I>(), _output.edit<O>());
}
renderContext->jobConfig.reset();
}
@ -554,12 +554,12 @@ public:
return concept->_data;
}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
void run(const RenderContextPointer& renderContext) {
PerformanceTimer perfTimer(_name.c_str());
PROFILE_RANGE(render, _name.c_str());
auto start = usecTimestampNow();
_concept->run(sceneContext, renderContext);
_concept->run(renderContext);
_concept->setCPURunTime((double)(usecTimestampNow() - start) / 1000.0);
}
@ -669,11 +669,11 @@ public:
}
}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) override {
void run(const RenderContextPointer& renderContext) override {
auto config = std::static_pointer_cast<C>(_config);
if (config->alwaysEnabled || config->enabled) {
for (auto job : _jobs) {
job.run(sceneContext, renderContext);
job.run(renderContext);
}
}
}

View file

@ -97,17 +97,17 @@ void TestWindow::beginFrame() {
#ifdef DEFERRED_LIGHTING
gpu::FramebufferPointer primaryFramebuffer;
_preparePrimaryFramebuffer.run(_sceneContext, _renderContext, primaryFramebuffer);
_preparePrimaryFramebuffer.run(_renderContext, primaryFramebuffer);
DeferredFrameTransformPointer frameTransform;
_generateDeferredFrameTransform.run(_sceneContext, _renderContext, frameTransform);
_generateDeferredFrameTransform.run(_renderContext, frameTransform);
LightingModelPointer lightingModel;
_generateLightingModel.run(_sceneContext, _renderContext, lightingModel);
_generateLightingModel.run(_renderContext, lightingModel);
_prepareDeferredInputs.edit0() = primaryFramebuffer;
_prepareDeferredInputs.edit1() = lightingModel;
_prepareDeferred.run(_sceneContext, _renderContext, _prepareDeferredInputs, _prepareDeferredOutputs);
_prepareDeferred.run(_renderContext, _prepareDeferredInputs, _prepareDeferredOutputs);
_renderDeferredInputs.edit0() = frameTransform; // Pass the deferredFrameTransform
@ -144,7 +144,7 @@ void TestWindow::endFrame() {
batch.setResourceTexture(0, nullptr);
});
_renderDeferred.run(_sceneContext, _renderContext, _renderDeferredInputs);
_renderDeferred.run(_renderContext, _renderDeferredInputs);
gpu::doInBatch(_renderArgs->_context, [&](gpu::Batch& batch) {
PROFILE_RANGE_BATCH(batch, "blit");

View file

@ -31,7 +31,6 @@ protected:
#ifdef DEFERRED_LIGHTING
// Prepare the ShapePipelines
render::ShapePlumberPointer _shapePlumber { std::make_shared<render::ShapePlumber>() };
render::SceneContextPointer _sceneContext{ std::make_shared<render::SceneContext>() };
render::RenderContextPointer _renderContext{ std::make_shared<render::RenderContext>() };
gpu::PipelinePointer _opaquePipeline;
model::LightPointer _light { std::make_shared<model::Light>() };