Showing the changes to libraries/render-utils/src/RenderDeferredTask.cpp (1 of 19 files). Show all
Unified · Split
| @@ -60,7 +60,7 @@ using namespace render; · 59 unmodified lines | |||
| 60 | void initDeferredPipelines(render::ShapePlumber& plumber); | 60 | void initDeferredPipelines(render::ShapePlumber& plumber); |
| 61 | 61 | ||
| 62 | void PrepareDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { | 62 | void PrepareDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { |
| 63 | DependencyManager::get<DeferredLightingEffect>()->prepare(renderContext->getArgs()); | 63 | DependencyManager::get<DeferredLightingEffect>()->prepare(renderContext->args); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | void RenderDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { | 66 | void RenderDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { |
| @@ -78,7 +78,7 @@ void ToneMappingDeferred::configure(const Config& configuration) { · 11 unmodified lines | |||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | void ToneMappingDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { | 80 | void ToneMappingDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { |
| 81 | _toneMappingEffect.render(renderContext->getArgs()); | 81 | _toneMappingEffect.render(renderContext->args); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | RenderDeferredTask::RenderDeferredTask(CullFunctor cullFunctor) { | 84 | RenderDeferredTask::RenderDeferredTask(CullFunctor cullFunctor) { |
| @@ -167,17 +167,14 @@ void RenderDeferredTask::run(const SceneContextPointer& sceneContext, const Rend · 82 unmodified lines | |||
| 167 | 167 | ||
| 168 | 168 | ||
| 169 | // Is it possible that we render without a viewFrustum ? | 169 | // Is it possible that we render without a viewFrustum ? |
| 170 | if (!(renderContext->getArgs() && renderContext->getArgs()->_viewFrustum)) { | 170 | if (!(renderContext->args && renderContext->args->_viewFrustum)) { |
| 171 | return; | 171 | return; |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | setAntialiasingStatus(renderContext->getFxaaStatus()); | ||
| 175 | // TODO: Allow runtime manipulation of culling ShouldRenderFunctor | ||
| 176 | |||
| 177 | // TODO: For now, lighting is controlled through a singleton, so it is distinct | 174 | // TODO: For now, lighting is controlled through a singleton, so it is distinct |
| 178 | DependencyManager::get<DeferredLightingEffect>()->setShadowMapStatus(renderContext->getShadowMapStatus()); | 175 | DependencyManager::get<DeferredLightingEffect>()->setShadowMapStatus(renderContext->getShadowMapStatus()); |
| 179 | 176 | ||
| 180 | renderContext->getArgs()->_context->syncCache(); | 177 | renderContext->args->_context->syncCache(); |
| 181 | 178 | ||
| 182 | for (auto job : _jobs) { | 179 | for (auto job : _jobs) { |
| 183 | job.run(sceneContext, renderContext); | 180 | job.run(sceneContext, renderContext); |
| @@ -185,12 +182,12 @@ void RenderDeferredTask::run(const SceneContextPointer& sceneContext, const Rend · 1 unmodified line | |||
| 185 | }; | 182 | }; |
| 186 | 183 | ||
| 187 | void DrawDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemIDsBounds& inItems) { | 184 | void DrawDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemIDsBounds& inItems) { |
| 188 | assert(renderContext->getArgs()); | 185 | assert(renderContext->args); |
| 189 | assert(renderContext->getArgs()->_viewFrustum); | 186 | assert(renderContext->args->_viewFrustum); |
| 190 | 187 | ||
| 191 | auto& config = std::static_pointer_cast<Config>(renderContext->jobConfig); | 188 | auto& config = std::static_pointer_cast<Config>(renderContext->jobConfig); |
| 192 | 189 | ||
| 193 | RenderArgs* args = renderContext->getArgs(); | 190 | RenderArgs* args = renderContext->args; |
| 194 | gpu::doInBatch(args->_context, [&](gpu::Batch& batch) { | 191 | gpu::doInBatch(args->_context, [&](gpu::Batch& batch) { |
| 195 | batch.setViewportTransform(args->_viewport); | 192 | batch.setViewportTransform(args->_viewport); |
| 196 | batch.setStateScissorRect(args->_viewport); | 193 | batch.setStateScissorRect(args->_viewport); |
| @@ -230,8 +227,8 @@ const gpu::PipelinePointer& DrawOverlay3D::getOpaquePipeline() { · 33 unmodified lines | |||
| 230 | } | 227 | } |
| 231 | 228 | ||
| 232 | void DrawOverlay3D::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { | 229 | void DrawOverlay3D::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { |
| 233 | assert(renderContext->getArgs()); | 230 | assert(renderContext->args); |
| 234 | assert(renderContext->getArgs()->_viewFrustum); | 231 | assert(renderContext->args->_viewFrustum); |
| 235 | 232 | ||
| 236 | // render backgrounds | 233 | // render backgrounds |
| 237 | auto& scene = sceneContext->_scene; | 234 | auto& scene = sceneContext->_scene; |
| @@ -251,7 +248,7 @@ void DrawOverlay3D::run(const SceneContextPointer& sceneContext, const RenderCon · 13 unmodified lines | |||
| 251 | config->numDrawn = (int)inItems.size(); | 248 | config->numDrawn = (int)inItems.size(); |
| 252 | 249 | ||
| 253 | if (!inItems.empty()) { | 250 | if (!inItems.empty()) { |
| 254 | RenderArgs* args = renderContext->getArgs(); | 251 | RenderArgs* args = renderContext->args; |
| 255 | 252 | ||
| 256 | // Clear the framebuffer without stereo | 253 | // Clear the framebuffer without stereo |
| 257 | // Needs to be distinct from the other batch because using the clear call | 254 | // Needs to be distinct from the other batch because using the clear call |
| @@ -309,11 +306,11 @@ const gpu::PipelinePointer& DrawStencilDeferred::getOpaquePipeline() { · 51 unmodified lines | |||
| 309 | } | 306 | } |
| 310 | 307 | ||
| 311 | void DrawStencilDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { | 308 | void DrawStencilDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { |
| 312 | assert(renderContext->getArgs()); | 309 | assert(renderContext->args); |
| 313 | assert(renderContext->getArgs()->_viewFrustum); | 310 | assert(renderContext->args->_viewFrustum); |
| 314 | 311 | ||
| 315 | // from the touched pixel generate the stencil buffer | 312 | // from the touched pixel generate the stencil buffer |
| 316 | RenderArgs* args = renderContext->getArgs(); | 313 | RenderArgs* args = renderContext->args; |
| 317 | doInBatch(args->_context, [&](gpu::Batch& batch) { | 314 | doInBatch(args->_context, [&](gpu::Batch& batch) { |
| 318 | args->_batch = &batch; | 315 | args->_batch = &batch; |
| 319 | 316 | ||
| @@ -335,8 +332,8 @@ void DrawStencilDeferred::run(const SceneContextPointer& sceneContext, const Ren · 15 unmodified lines | |||
| 335 | } | 332 | } |
| 336 | 333 | ||
| 337 | void DrawBackgroundDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { | 334 | void DrawBackgroundDeferred::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { |
| 338 | assert(renderContext->getArgs()); | 335 | assert(renderContext->args); |
| 339 | assert(renderContext->getArgs()->_viewFrustum); | 336 | assert(renderContext->args->_viewFrustum); |
| 340 | 337 | ||
| 341 | // render backgrounds | 338 | // render backgrounds |
| 342 | auto& scene = sceneContext->_scene; | 339 | auto& scene = sceneContext->_scene; |
| @@ -348,7 +345,7 @@ void DrawBackgroundDeferred::run(const SceneContextPointer& sceneContext, const · 5 unmodified lines | |||
| 348 | for (auto id : items) { | 345 | for (auto id : items) { |
| 349 | inItems.emplace_back(id); | 346 | inItems.emplace_back(id); |
| 350 | } | 347 | } |
| 351 | RenderArgs* args = renderContext->getArgs(); | 348 | RenderArgs* args = renderContext->args; |
| 352 | doInBatch(args->_context, [&](gpu::Batch& batch) { | 349 | doInBatch(args->_context, [&](gpu::Batch& batch) { |
| 353 | args->_batch = &batch; | 350 | args->_batch = &batch; |
| 354 | 351 | ||
| @@ -375,10 +372,10 @@ void DrawBackgroundDeferred::run(const SceneContextPointer& sceneContext, const · 20 unmodified lines | |||
| 375 | } | 372 | } |
| 376 | 373 | ||
| 377 | void Blit::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { | 374 | void Blit::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { |
| 378 | assert(renderContext->getArgs()); | 375 | assert(renderContext->args); |
| 379 | assert(renderContext->getArgs()->_context); | 376 | assert(renderContext->args->_context); |
| 380 | 377 | ||
| 381 | RenderArgs* renderArgs = renderContext->getArgs(); | 378 | RenderArgs* renderArgs = renderContext->args; |
| 382 | auto blitFbo = renderArgs->_blitFramebuffer; | 379 | auto blitFbo = renderArgs->_blitFramebuffer; |
| 383 | 380 | ||
| 384 | if (!blitFbo) { | 381 | if (!blitFbo) { |