Showing the changes to libraries/render-utils/src/RenderDeferredTask.cpp (1 of 40 files). Show all
Unified · Split
| @@ -100,11 +100,14 @@ void RenderDeferredTask::configure(const Config& config) { · 99 unmodified lines | |||
| 100 | preparePrimaryBufferConfig->setResolutionScale(config.resolutionScale); | 100 | preparePrimaryBufferConfig->setResolutionScale(config.resolutionScale); |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | void RenderDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output) { | 103 | void RenderDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, size_t depth) { |
| 104 | auto fadeEffect = DependencyManager::get<FadeEffect>(); | 104 | static auto fadeEffect = DependencyManager::get<FadeEffect>(); |
| 105 | // Prepare the ShapePipelines | 105 | // Prepare the ShapePipelines |
| 106 | ShapePlumberPointer shapePlumber = std::make_shared<ShapePlumber>(); | 106 | static ShapePlumberPointer shapePlumber = std::make_shared<ShapePlumber>(); |
| 107 | initDeferredPipelines(*shapePlumber, fadeEffect->getBatchSetter(), fadeEffect->getItemUniformSetter()); | 107 | static std::once_flag once; |
| 108 | std::call_once(once, [] { | ||
| 109 | initDeferredPipelines(*shapePlumber, fadeEffect->getBatchSetter(), fadeEffect->getItemUniformSetter()); | ||
| 110 | }); | ||
| 108 | 111 | ||
| 109 | const auto& inputs = input.get<Input>(); | 112 | const auto& inputs = input.get<Input>(); |
| 110 | 113 | ||
| @@ -116,6 +119,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 5 unmodified lines | |||
| 116 | // Extract opaques / transparents / lights / metas / layered / background | 119 | // Extract opaques / transparents / lights / metas / layered / background |
| 117 | const auto& opaques = items[RenderFetchCullSortTask::OPAQUE_SHAPE]; | 120 | const auto& opaques = items[RenderFetchCullSortTask::OPAQUE_SHAPE]; |
| 118 | const auto& transparents = items[RenderFetchCullSortTask::TRANSPARENT_SHAPE]; | 121 | const auto& transparents = items[RenderFetchCullSortTask::TRANSPARENT_SHAPE]; |
| 122 | const auto& mirrors = items[RenderFetchCullSortTask::MIRROR]; | ||
| 119 | const auto& inFrontOpaque = items[RenderFetchCullSortTask::LAYER_FRONT_OPAQUE_SHAPE]; | 123 | const auto& inFrontOpaque = items[RenderFetchCullSortTask::LAYER_FRONT_OPAQUE_SHAPE]; |
| 120 | const auto& inFrontTransparent = items[RenderFetchCullSortTask::LAYER_FRONT_TRANSPARENT_SHAPE]; | 124 | const auto& inFrontTransparent = items[RenderFetchCullSortTask::LAYER_FRONT_TRANSPARENT_SHAPE]; |
| 121 | const auto& hudOpaque = items[RenderFetchCullSortTask::LAYER_HUD_OPAQUE_SHAPE]; | 125 | const auto& hudOpaque = items[RenderFetchCullSortTask::LAYER_HUD_OPAQUE_SHAPE]; |
| @@ -139,7 +143,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 17 unmodified lines | |||
| 139 | // Shadow Stage Frame | 143 | // Shadow Stage Frame |
| 140 | const auto shadowFrame = shadowTaskOutputs[1]; | 144 | const auto shadowFrame = shadowTaskOutputs[1]; |
| 141 | 145 | ||
| 142 | |||
| 143 | fadeEffect->build(task, opaques); | 146 | fadeEffect->build(task, opaques); |
| 144 | 147 | ||
| 145 | const auto jitter = task.addJob<JitterSample>("JitterCam"); | 148 | const auto jitter = task.addJob<JitterSample>("JitterCam"); |
| @@ -162,6 +165,13 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 16 unmodified lines | |||
| 162 | const auto opaqueInputs = DrawStateSortDeferred::Inputs(opaques, lightingModel, jitter).asVarying(); | 165 | const auto opaqueInputs = DrawStateSortDeferred::Inputs(opaques, lightingModel, jitter).asVarying(); |
| 163 | task.addJob<DrawStateSortDeferred>("DrawOpaqueDeferred", opaqueInputs, shapePlumber); | 166 | task.addJob<DrawStateSortDeferred>("DrawOpaqueDeferred", opaqueInputs, shapePlumber); |
| 164 | 167 | ||
| 168 | if (depth < RenderMirrorTask::MAX_MIRROR_DEPTH) { | ||
| 169 | const auto mirrorInputs = RenderMirrorTask::Inputs(mirrors, scaledPrimaryFramebuffer, jitter).asVarying(); | ||
| 170 | for (size_t i = 0; i < RenderMirrorTask::MAX_MIRRORS_PER_LEVEL; i++) { | ||
| 171 | task.addJob<RenderMirrorTask>("RenderMirrorTask" + std::to_string(i) + "Depth" + std::to_string(depth), mirrorInputs, i, cullFunctor, depth); | ||
| 172 | } | ||
| 173 | } | ||
| 174 | |||
| 165 | // Opaque all rendered | 175 | // Opaque all rendered |
| 166 | 176 | ||
| 167 | // Linear Depth Pass | 177 | // Linear Depth Pass |
| @@ -398,8 +408,12 @@ void RenderDeferredTaskDebug::build(JobModel& task, const render::Varying& input · 230 unmodified lines | |||
| 398 | // Status icon rendering job | 408 | // Status icon rendering job |
| 399 | { | 409 | { |
| 400 | // Grab a texture map representing the different status icons and assign that to the drawStatusJob | 410 | // Grab a texture map representing the different status icons and assign that to the drawStatusJob |
| 401 | auto iconMapPath = PathUtils::resourcesPath() + "icons/statusIconAtlas.svg"; | 411 | static gpu::TexturePointer statusIconMap; |
| 402 | auto statusIconMap = DependencyManager::get<TextureCache>()->getImageTexture(iconMapPath, image::TextureUsage::STRICT_TEXTURE); | 412 | static std::once_flag once; |
| 413 | std::call_once(once, [] { | ||
| 414 | auto iconMapPath = PathUtils::resourcesPath() + "icons/statusIconAtlas.svg"; | ||
| 415 | statusIconMap = DependencyManager::get<TextureCache>()->getImageTexture(iconMapPath, image::TextureUsage::STRICT_TEXTURE); | ||
| 416 | }); | ||
| 403 | const auto drawStatusInputs = DrawStatus::Input(opaques, jitter).asVarying(); | 417 | const auto drawStatusInputs = DrawStatus::Input(opaques, jitter).asVarying(); |
| 404 | task.addJob<DrawStatus>("DrawStatus", drawStatusInputs, DrawStatus(statusIconMap)); | 418 | task.addJob<DrawStatus>("DrawStatus", drawStatusInputs, DrawStatus(statusIconMap)); |
| 405 | } | 419 | } |
| @@ -407,8 +421,6 @@ void RenderDeferredTaskDebug::build(JobModel& task, const render::Varying& input · 1 unmodified line | |||
| 407 | const auto debugZoneInputs = DebugZoneLighting::Inputs(deferredFrameTransform, lightFrame, backgroundFrame).asVarying(); | 421 | const auto debugZoneInputs = DebugZoneLighting::Inputs(deferredFrameTransform, lightFrame, backgroundFrame).asVarying(); |
| 408 | task.addJob<DebugZoneLighting>("DrawZoneStack", debugZoneInputs); | 422 | task.addJob<DebugZoneLighting>("DrawZoneStack", debugZoneInputs); |
| 409 | } | 423 | } |
| 410 | |||
| 411 | |||
| 412 | } | 424 | } |
| 413 | 425 | ||
| 414 | gpu::FramebufferPointer PreparePrimaryFramebuffer::createFramebuffer(const char* name, const glm::uvec2& frameSize) { | 426 | gpu::FramebufferPointer PreparePrimaryFramebuffer::createFramebuffer(const char* name, const glm::uvec2& frameSize) { |