Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "Headers/RenderPassManager.h"
#include "Rendering/RenderPass/Headers/RenderQueue.h"

namespace Divide {

RenderPassManager::RenderPassManager()
    : _renderQueue(MemoryManager_NEW RenderQueue())
{
}

RenderPassManager::~RenderPassManager()
{
    for (RenderPass* rp : _renderPasses) {
        MemoryManager::DELETE(rp);
    }

    MemoryManager::DELETE(_renderQueue);
}

void RenderPassManager::render(SceneRenderState& sceneRenderState) {
    for (RenderPass* rp : _renderPasses) {
        rp->render(sceneRenderState);
    }
}

RenderPass& RenderPassManager::addRenderPass(const stringImpl& renderPassName,
                                             U8 orderKey,
                                             std::initializer_list<RenderStage> renderStages) {
    assert(!renderPassName.empty());

    _renderPasses.emplace_back(MemoryManager_NEW RenderPass(renderPassName, orderKey, renderStages));
    RenderPass& item = *_renderPasses.back();

    std::sort(std::begin(_renderPasses), std::end(_renderPasses),
              [](RenderPass* a, RenderPass* b)
                  -> bool { return a->sortKey() < b->sortKey(); });

    assert(item.sortKey() == orderKey);

    return item;
}

void RenderPassManager::removeRenderPass(const stringImpl& name) {
    for (vectorImpl<RenderPass*>::iterator it = std::begin(_renderPasses);
         it != std::end(_renderPasses); ++it) {
        if ((*it)->getName().compare(name) == 0) {
            _renderPasses.erase(it);
            break;
        }
    }
}

U16 RenderPassManager::getLastTotalBinSize(RenderStage renderStage) const {
    return getPassForStage(renderStage)->getLastTotalBinSize();
}

RenderPass* RenderPassManager::getPassForStage(RenderStage renderStage) const {
    for (RenderPass* pass : _renderPasses) {
        if (pass->hasStageFlag(renderStage)) {
            return pass;
        }
    }

    DIVIDE_UNEXPECTED_CALL();
    return nullptr;
}

const RenderPass::BufferData& 
RenderPassManager::getBufferData(RenderStage renderStage, U32 pass, U32 stage) const {
    return getPassForStage(renderStage)->getBufferData(pass, stage);
}

RenderPass::BufferData&
RenderPassManager::getBufferData(RenderStage renderStage, U32 pass, U32 stage) {
    return getPassForStage(renderStage)->getBufferData(pass, stage);
}

};

Commits for Divide-Framework/trunk/Source Code/Managers/RenderPassManager.cpp

Diff revisions: vs.
Revision Author Commited Message
727 Diff Diff IonutCava picture IonutCava Tue 14 Jun, 2016 16:01:38 +0000

[IonutCava]
- Remove node and cmd buffers from GFXDevice and add them as a new BufferData struct to RenderPass class.
— Each render pass holds its own buffers
- Improvements / fixes to the CSM code
- Added a global toggle to enable/disable custom memory allocators

713 Diff Diff IonutCava picture IonutCava Wed 25 May, 2016 15:43:38 +0000

[IonutCava]
- Removed all unique_ptr’s from the code with classic new/delete pairs. They were seriously not needed.
- Added the concept of SceneComponent to scene specific classes: aiManager, lightPool, sceneGraph, physicsInterface etc
— This allowed the removal of the global GET_ACTIVE_SCENEGRAPH call;

698 Diff Diff IonutCava picture IonutCava Mon 09 May, 2016 20:21:34 +0000

[IonutCava]
- Remove all anaglyph rendering code. nVidia gained 1 sympathy point with me for VRWorks:
— Single Pass Stereo completely removes the need for double rendering the scene for each eye.
— LiquidVR also support similar technology
-— Once VR development starts for Divide, documentation for both SDKs should be pretty sorted.

560 Diff Diff IonutCava picture IonutCava Wed 11 Nov, 2015 16:11:13 +0000

[IonutCava]
- Implement a proper RenderPassManager that can hold and execute, in order, multiple rendering passes, with each pass able to handle multiple rendering stages:
— Added a RenderPass for shadowmapping that gets executed first
— Added a RenderPass for environment mapping that gets executed second
— Added a RenderPass for normal rendering that gets executed third and processes 2 stages: Z_PRE_PASS and DISPLAY
— All RenderPasses get executed twice if anaglyph rendering is enableDebugRender
- Added environment map auto-generation. The second render pass creates a reflection cube map used for reflections
- Cleaned up Kernel->GFXDevice->SceneManager relation for scene rendering
- Moved Renderer to SceneManager as it is not related to the GFXDevice in any way and it’s implementation can be very scene dependent.

523 Diff Diff IonutCava picture IonutCava Wed 07 Oct, 2015 16:11:44 +0000

[IonutCava]
- Performance optimizations:
— Change GFXDevice’s vector of RenderPackages to a standalone class that handles its own memory, thus avoiding the hit from clear()/push_back()
— Also minimizes memory allocation in each render pass
- Remove the extra WaitForLockedRange call in LockRange command. It was added to work around a bug that doesn’t happen any more due to better buffer usage.
- Add some vegetation generation notes for future updates

466 Diff Diff IonutCava picture IonutCava Fri 05 Jun, 2015 15:07:17 +0000

[Ionut]
- Moved EASTL, SimpleINI and Threadpool libraries from Dependencies repo to engine repo
- Disabled EASTL string and vector support as they are really out of date and missing required features.
— EASTL hash map is still usable

416 Diff Diff IonutCava picture IonutCava Wed 29 Apr, 2015 20:06:19 +0000

[Ionut]
- Updated CPPGoap to newest version available on GIT
- Improved WarScene AI
- Added a transform stacking system to PhysicsComponent with push/pop functionality

393 Diff Diff IonutCava picture IonutCava Tue 31 Mar, 2015 16:10:48 +0000

[Ionut]
- Experimental async command generation code. Functional, but improvements require performance profiling to ensure that the overhead cost is minimal.
- Simplified Singleton base class for improved performance (thanks to C++11 static initialization guarantee in a multi-threaded environment)
- Added separate alignment checking for UBOs and SSBOs
- Fixed a type on config.h affecting release builds

387 Diff Diff IonutCava picture IonutCava Wed 25 Mar, 2015 17:05:46 +0000

[Ionut]
- Massively reduced rendering pipeline complexity:
— RenderPassCuller is only responsible for culling the SceneGraph from the given node and holds a cache of visible nodes for each render stage
— The SceneManager asks the RenderPassCuller to the get a list of visible nodes -> passes the nodes to the RenderQueue -> asks the RenderQueue to sort itself -> sorts the visible nodes based on the order given by the RenderQueue -> asks the GFXDevice to build render data and the command buffer based on the resulting nodes -> clears the RenderPassCuller cache on “frame end” event
- Fixed draw commands that don’t use an indirect buffer

358 IonutCava picture IonutCava Sun 01 Mar, 2015 22:44:38 +0000

[Ionut]
- Fixed some OpenGL initialization issues and function calls (no proper support for DSA yet)
- Cleanup up the Sound and Physics Wrappers
- Some readability improvements here and there