Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
SceneNodeRenderState.cpp
Go to the documentation of this file.
1
2
4
7
8namespace Divide {
9
12
13 if (!_drawState) {
14 return false;
15 }
16
17 const auto checkIndex = [&stagePass](const RenderStagePass exclusion) noexcept {
18 const bool mainIndexMatch = exclusion._index == g_AllIndicesID || //All Passes
19 exclusion._index == stagePass._index;//Same pass
20
21 const bool subIndexMatch = exclusion._pass == RenderStagePass::PassIndex::COUNT ||
22 exclusion._pass == stagePass._pass; //Sub pass index 2 match or all index 2 sub pass indices
23
24 return mainIndexMatch || subIndexMatch;
25 };
26
27 for (const RenderStagePass exclussionStagePass : _exclusionStagePasses) {
28 if (checkIndex(exclussionStagePass) &&
29 (exclussionStagePass._variant == RenderStagePass::VariantType::COUNT || exclussionStagePass._variant == stagePass._variant) &&
30 (exclussionStagePass._stage == RenderStage::COUNT || exclussionStagePass._stage == stagePass._stage) &&
31 (exclussionStagePass._passType == RenderPassType::COUNT || exclussionStagePass._passType == stagePass._passType))
32 {
33 return false;
34 }
35 }
36
37 return true;
38}
39
41 const RenderStagePass stagePass{
42 stage,
43 passType,
44 index,
45 variant,
46 pass
47 };
48
49 if (eastl::find(cbegin(_exclusionStagePasses), cend(_exclusionStagePasses), stagePass) == cend(_exclusionStagePasses)) {
50 _exclusionStagePasses.emplace_back(stagePass);
51 }
52}
53
54} //namespace Divide
#define PROFILE_SCOPE_AUTO(CATEGORY)
Definition: Profiler.h:87
constexpr Optick::Category::Type GameLogic
Definition: Profiler.h:63
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
static constexpr U16 g_AllIndicesID
uint16_t U16
RenderPassType _passType
bool drawState(RenderStagePass stagePass) const
void addToDrawExclusionMask(RenderStage stage, RenderPassType passType=RenderPassType::COUNT, RenderStagePass::VariantType variant=RenderStagePass::VariantType::COUNT, U16 index=g_AllIndicesID, RenderStagePass::PassIndex pass=RenderStagePass::PassIndex::PASS_0)
vector< RenderStagePass > _exclusionStagePasses