From d5158875af56062039ca58d76e8de9cf1a452c11 Mon Sep 17 00:00:00 2001 From: HifiExperiments Date: Wed, 23 Oct 2024 15:53:35 -0700 Subject: [PATCH] remove unnecessary stage::getNames --- libraries/render-utils/src/FadeEffect.cpp | 4 ++-- libraries/render-utils/src/FadeEffectJobs.cpp | 2 +- libraries/render-utils/src/HighlightEffect.cpp | 8 ++++---- libraries/render/src/render/DrawStatus.cpp | 2 +- libraries/render/src/render/Scene.cpp | 12 ++++++------ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libraries/render-utils/src/FadeEffect.cpp b/libraries/render-utils/src/FadeEffect.cpp index 402865da4c..7714489e87 100644 --- a/libraries/render-utils/src/FadeEffect.cpp +++ b/libraries/render-utils/src/FadeEffect.cpp @@ -43,7 +43,7 @@ render::ShapePipeline::ItemSetter FadeEffect::getItemUniformSetter() const { if (!render::TransitionStage::isIndexInvalid(item.getTransitionId())) { const auto& scene = args->_scene; const auto& batch = args->_batch; - auto transitionStage = scene->getStage(render::TransitionStage::getName()); + auto transitionStage = scene->getStage(); auto& transitionState = transitionStage->getTransition(item.getTransitionId()); if (transitionState.paramsBuffer._size != sizeof(gpu::StructBuffer)) { @@ -76,7 +76,7 @@ render::ShapePipeline::ItemSetter FadeEffect::getItemStoredSetter() { return [this](const render::ShapePipeline& shapePipeline, render::Args* args, const render::Item& item) { if (!render::TransitionStage::isIndexInvalid(item.getTransitionId())) { auto scene = args->_scene; - auto transitionStage = scene->getStage(render::TransitionStage::getName()); + auto transitionStage = scene->getStage(); auto& transitionState = transitionStage->getTransition(item.getTransitionId()); const auto fadeCategory = FadeJob::transitionToCategory[transitionState.eventType]; diff --git a/libraries/render-utils/src/FadeEffectJobs.cpp b/libraries/render-utils/src/FadeEffectJobs.cpp index 6f6205060a..c4cfbd9d1e 100644 --- a/libraries/render-utils/src/FadeEffectJobs.cpp +++ b/libraries/render-utils/src/FadeEffectJobs.cpp @@ -559,7 +559,7 @@ void FadeJob::configure(const Config& config) { void FadeJob::run(const render::RenderContextPointer& renderContext, FadeJob::Output& output) { Config* jobConfig = static_cast(renderContext->jobConfig.get()); auto scene = renderContext->args->_scene; - auto transitionStage = scene->getStage(render::TransitionStage::getName()); + auto transitionStage = scene->getStage(); uint64_t now = usecTimestampNow(); const double deltaTime = (int64_t(now) - int64_t(_previousTime)) / double(USECS_PER_SECOND); render::Transaction transaction; diff --git a/libraries/render-utils/src/HighlightEffect.cpp b/libraries/render-utils/src/HighlightEffect.cpp index c1f7c5dac8..57aecd7741 100644 --- a/libraries/render-utils/src/HighlightEffect.cpp +++ b/libraries/render-utils/src/HighlightEffect.cpp @@ -156,7 +156,7 @@ void DrawHighlightMask::run(const render::RenderContextPointer& renderContext, c _boundsBuffer = std::make_shared(sizeof(render::ItemBound)); } - auto highlightStage = renderContext->_scene->getStage(render::HighlightStage::getName()); + auto highlightStage = renderContext->_scene->getStage(); auto highlightId = _sharedParameters->_highlightIds[_highlightPassIndex]; if (!inShapes.empty() && !render::HighlightStage::isIndexInvalid(highlightId)) { @@ -244,7 +244,7 @@ void DrawHighlight::run(const render::RenderContextPointer& renderContext, const if (sceneDepthBuffer) { auto args = renderContext->args; - auto highlightStage = renderContext->_scene->getStage(render::HighlightStage::getName()); + auto highlightStage = renderContext->_scene->getStage(); auto highlightId = _sharedParameters->_highlightIds[_highlightPassIndex]; if (!render::HighlightStage::isIndexInvalid(highlightId)) { auto& highlight = highlightStage->getHighlight(highlightId); @@ -408,7 +408,7 @@ gpu::PipelinePointer& DebugHighlight::getDepthPipeline() { void SelectionToHighlight::run(const render::RenderContextPointer& renderContext, const Inputs& inputs, Outputs& outputs) { auto scene = renderContext->_scene; - auto highlightStage = scene->getStage(render::HighlightStage::getName()); + auto highlightStage = scene->getStage(); auto outlines = inputs.get0(); auto framebuffer = inputs.get1(); @@ -570,7 +570,7 @@ void AppendNonMetaOutlines::run(const render::RenderContextPointer& renderContex void HighlightCleanup::run(const render::RenderContextPointer& renderContext, const Inputs& inputs) { auto scene = renderContext->_scene; - auto highlightStage = scene->getStage(render::HighlightStage::getName()); + auto highlightStage = scene->getStage(); for (auto index : inputs.get0()) { std::string selectionName = highlightStage->getHighlight(index)._selectionName; diff --git a/libraries/render/src/render/DrawStatus.cpp b/libraries/render/src/render/DrawStatus.cpp index 68bf07bd0b..925cffdae1 100644 --- a/libraries/render/src/render/DrawStatus.cpp +++ b/libraries/render/src/render/DrawStatus.cpp @@ -153,7 +153,7 @@ void DrawStatus::run(const RenderContextPointer& renderContext, const Input& inp // We have a transition. Show this icon. status.setScale(1.0f); // Is this a valid transition ID according to FadeJob? - auto transitionStage = scene->getStage(TransitionStage::getName()); + auto transitionStage = scene->getStage(); if (transitionStage) { if (transitionStage->isTransitionUsed(transitionID)) { // Valid, active transition diff --git a/libraries/render/src/render/Scene.cpp b/libraries/render/src/render/Scene.cpp index 58707bf4db..a9bb2a5856 100644 --- a/libraries/render/src/render/Scene.cpp +++ b/libraries/render/src/render/Scene.cpp @@ -382,7 +382,7 @@ void Scene::updateItems(const Transaction::Updates& transactions) { } void Scene::resetTransitionItems(const Transaction::TransitionResets& transactions) { - auto transitionStage = getStage(TransitionStage::getName()); + auto transitionStage = getStage(); if (!transitionStage) { return; @@ -425,7 +425,7 @@ void Scene::removeTransitionItems(const Transaction::TransitionRemoves& transact } void Scene::queryTransitionItems(const Transaction::TransitionQueries& transactions) { - auto transitionStage = getStage(TransitionStage::getName()); + auto transitionStage = getStage(); if (!transitionStage) { return; @@ -467,7 +467,7 @@ void Scene::resetTransitionFinishedOperator(const Transaction::TransitionFinishe } void Scene::resetHighlights(const Transaction::HighlightResets& transactions) { - auto outlineStage = getStage(HighlightStage::getName()); + auto outlineStage = getStage(); if (outlineStage) { for (auto& transaction : transactions) { const auto& selectionName = std::get<0>(transaction); @@ -484,7 +484,7 @@ void Scene::resetHighlights(const Transaction::HighlightResets& transactions) { } void Scene::removeHighlights(const Transaction::HighlightRemoves& transactions) { - auto outlineStage = getStage(HighlightStage::getName()); + auto outlineStage = getStage(); if (outlineStage) { for (auto& selectionName : transactions) { auto outlineId = outlineStage->getHighlightIdBySelection(selectionName); @@ -497,7 +497,7 @@ void Scene::removeHighlights(const Transaction::HighlightRemoves& transactions) } void Scene::queryHighlights(const Transaction::HighlightQueries& transactions) { - auto outlineStage = getStage(HighlightStage::getName()); + auto outlineStage = getStage(); if (outlineStage) { for (auto& transaction : transactions) { const auto& selectionName = std::get<0>(transaction); @@ -551,7 +551,7 @@ void Scene::setItemTransition(ItemID itemId, Index transitionId) { } void Scene::removeItemTransition(ItemID itemId) { - auto transitionStage = getStage(TransitionStage::getName()); + auto transitionStage = getStage(); if (!transitionStage) { return; }