History

move switch logic around

SamGondelman committed 7 years ago

Commit 4a02ab41 parent 8c032ea5 files · +188 −95Browse files

Showing the changes to libraries/render-utils/src/RenderViewTask.cpp (1 of 5 files). Show all

Unified · Split

libraries/render-utils/src/RenderViewTask.cpp+22−12
@@ -10,16 +10,34 @@ · 9 unmodified lines
10//10//
11#include "RenderViewTask.h"11#include "RenderViewTask.h"
12 12
13#include "AssembleLightingStageTask.h"
14#include "RenderShadowTask.h"13#include "RenderShadowTask.h"
15#include "RenderDeferredTask.h"14#include "RenderDeferredTask.h"
16#include "RenderForwardTask.h"15#include "RenderForwardTask.h"
17 16
18#include <DisableDeferred.h>17#include <DisableDeferred.h>
19 18
19void RenderShadowsAndDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, uint8_t tagBits, uint8_t tagMask) {
20 const auto items = input.getN<DeferredForwardSwitchJob::Input>(0);
21 const auto lightingModel = input.getN<DeferredForwardSwitchJob::Input>(1);
22 const auto lightingStageFramesAndZones = input.getN<DeferredForwardSwitchJob::Input>(2);
23
24 // Warning : the cull functor passed to the shadow pass should only be testing for LOD culling. If frustum culling
25 // is performed, then casters not in the view frustum will be removed, which is not what we wish.
26 const auto shadowTaskIn = RenderShadowTask::Input(lightingStageFramesAndZones.get<AssembleLightingStageTask::Output>().get0()[0], lightingModel).asVarying();
27 const auto shadowTaskOut = task.addJob<RenderShadowTask>("RenderShadowTask", shadowTaskIn, cullFunctor, tagBits, tagMask);
28
29 const auto renderDeferredInput = RenderDeferredTask::Input(items, lightingModel, lightingStageFramesAndZones, shadowTaskOut).asVarying();
30 task.addJob<RenderDeferredTask>("RenderDeferredTask", renderDeferredInput);
31}
32
33void DeferredForwardSwitchJob::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, uint8_t tagBits, uint8_t tagMask) {
34 task.addBranch<RenderShadowsAndDeferredTask>("RenderShadowsAndDeferredTask", 0, input, cullFunctor, tagBits, tagMask);
35
36 task.addBranch<RenderForwardTask>("RenderForwardTask", 1, input);
37}
38
20void RenderViewTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, uint8_t tagBits, uint8_t tagMask) {39void RenderViewTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, uint8_t tagBits, uint8_t tagMask) {
21 const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, tagBits, tagMask);40 const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, tagBits, tagMask);
22 assert(items.canCast<RenderFetchCullSortTask::Output>());
23 41
24 // Issue the lighting model, aka the big global settings for the view 42 // Issue the lighting model, aka the big global settings for the view
25 const auto lightingModel = task.addJob<MakeLightingModel>("LightingModel");43 const auto lightingModel = task.addJob<MakeLightingModel>("LightingModel");
@@ -28,16 +46,8 @@ void RenderViewTask::build(JobModel& task, const render::Varying& input, render: · 2 unmodified lines
28 const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items);46 const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items);
29 47
30 if (!DISABLE_DEFERRED) {48 if (!DISABLE_DEFERRED) {
31 // Warning : the cull functor passed to the shadow pass should only be testing for LOD culling. If frustum culling49 const auto deferredForwardIn = DeferredForwardSwitchJob::Input(items, lightingModel, lightingStageFramesAndZones).asVarying();
32 // is performed, then casters not in the view frustum will be removed, which is not what we wish.50 task.addJob<DeferredForwardSwitchJob>("DeferredForwardSwitch", deferredForwardIn, cullFunctor, tagBits, tagMask);
33 const auto shadowTaskIn = RenderShadowTask::Input(lightingStageFramesAndZones.get<AssembleLightingStageTask::Output>().get0()[0], lightingModel).asVarying();
34 const auto shadowTaskOut = task.addSwitchJob<RenderShadowTask>("RenderShadowTask", 0, shadowTaskIn, cullFunctor, tagBits, tagMask);
35
36 const auto renderDeferredInput = RenderDeferredTask::Input(items, lightingModel, lightingStageFramesAndZones, shadowTaskOut).asVarying();
37 task.addSwitchJob<RenderDeferredTask>("RenderDeferredTask", 0, renderDeferredInput);
38
39 const auto renderForwardInput = RenderForwardTask::Input(items, lightingModel, lightingStageFramesAndZones).asVarying();
40 task.addSwitchJob<RenderForwardTask>("RenderForwardTask", 1, renderForwardInput);
41 } else {51 } else {
42 const auto renderInput = RenderForwardTask::Input(items, lightingModel, lightingStageFramesAndZones).asVarying();52 const auto renderInput = RenderForwardTask::Input(items, lightingModel, lightingStageFramesAndZones).asVarying();
43 task.addJob<RenderForwardTask>("RenderForwardTask", renderInput);53 task.addJob<RenderForwardTask>("RenderForwardTask", renderInput);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t