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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
/*
   Copyright (c) 2016 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _HARDWARE_VIDEO_GFX_DEVICE_H_
#define _HARDWARE_VIDEO_GFX_DEVICE_H_

#include "config.h"

#include "GFXState.h"
#include "GFXRTPool.h"
#include "ScopedStates.h"
#include "RenderPackage.h"
#include "GenericCommandPool.h"
#include "Core/Math/Headers/Line.h"
#include "Core/Math/Headers/MathMatrices.h"

#include "Platform/Video/Headers/RenderAPIWrapper.h"

#include "Rendering/RenderPass/Headers/RenderPass.h"
#include "Rendering/RenderPass/Headers/RenderPassCuller.h"

#include <stack>

namespace Divide {

enum class RenderStage : U32;
enum class RendererType : U32;
enum class SceneNodeType : U32;
enum class WindowEvent : U32;

class GUI;
class GUIText;

class GL_API;
class DX_API;

class Light;
class Camera;
class PostFX;
class Quad3D;
class Texture;
class Object3D;
class Renderer;
class IMPrimitive;
class PixelBuffer;
class VertexBuffer;
class SceneGraphNode;
class SceneRenderState;
FWD_DECLARE_MANAGED_CLASS(Texture);

namespace Time {
    class ProfileTimer;
};

namespace Attorney {
    class GFXDeviceAPI;
    class GFXDeviceGUI;
    class GFXDeviceKernel;
    class GFXDeviceRenderer;
    class GFXDeviceGraphicsResource;
};

/// Rough around the edges Adapter pattern abstracting the actual rendering API
/// and access to the GPU
DEFINE_SINGLETON(GFXDevice)
    friend class Attorney::GFXDeviceAPI;
    friend class Attorney::GFXDeviceGUI;
    friend class Attorney::GFXDeviceKernel;
    friend class Attorney::GFXDeviceRenderer;
    friend class Attorney::GFXDeviceGraphicsResource;

  protected:
    typedef std::stack<vec4<I32>> ViewportStack;

  public:
    struct NodeData {
        mat4<F32> _worldMatrix;
        mat4<F32> _normalMatrixWV;
        mat4<F32> _colourMatrix;
        vec4<F32> _properties;
        vec4<F32> _extraProperties;

        NodeData()
        {
            _worldMatrix.identity();
            _normalMatrixWV.identity();
            _colourMatrix.zero();
        }

        void set(const NodeData& other);
    };

  public:  // GPU specific data
   // Enough to hold a cubemap (e.g. environment stage has 6 passes)
   static const U32 MAX_PASSES_PER_STAGE = 6;

   struct GPUBlock {
       GPUBlock() : _updated(true),
                    _data(GPUData())
       {
       }

       struct GPUData {
           GPUData()
           {
               _ProjectionMatrix.identity();
               _InvProjectionMatrix.identity();
               _ViewMatrix.identity();
               _ViewProjectionMatrix.identity();
               _cameraPosition.set(0.0f);
               _ViewPort.set(1.0f);
               _ZPlanesCombined.set(1.0f, 1.1f, 1.0f, 1.1f);
               _invScreenDimension.set(1.0f);
               _renderProperties.set(0.0f);
               for (U8 i = 0; i < 6; ++i) {
                   _frustumPlanes[i].set(0.0f);
               }
               for (U8 i = 0; i < Config::MAX_CLIP_PLANES; ++i) {
                   _frustumPlanes[i].set(1.0f);
               }
           }

           mat4<F32> _ProjectionMatrix;
           mat4<F32> _InvProjectionMatrix;
           mat4<F32> _ViewMatrix;
           mat4<F32> _ViewProjectionMatrix;
           vec4<F32> _cameraPosition; // xyz - position, w - aspect ratio
           vec4<F32> _ViewPort;
           vec4<F32> _ZPlanesCombined;  // xy - current, zw - main scene
           vec4<F32> _invScreenDimension; //xy - dims, zw - reserved;
           vec4<F32> _renderProperties;
           vec4<F32> _frustumPlanes[6];
           vec4<F32> _clipPlanes[Config::MAX_CLIP_PLANES];

           inline F32 aspectRatio() const;
           inline vec2<F32> currentZPlanes() const;
           inline F32 FoV() const;
           inline F32 tanHFoV() const;

        } _data;

        inline void update(bool viewMatrixUpdate) {
            mat4<F32>::Multiply(_data._ViewMatrix, _data._ProjectionMatrix, _data._ViewProjectionMatrix);
            if (viewMatrixUpdate) {
                _data._ViewMatrix.getInverse(_viewMatrixInv);
            }
            if (!viewMatrixUpdate) {
                _data._ProjectionMatrix.getInverse(_data._InvProjectionMatrix);
            }
            _data._ViewProjectionMatrix.getInverse(_viewProjMatrixInv);
            GFXDevice::computeFrustumPlanes(_viewProjMatrixInv, _data._frustumPlanes);
            _updated = true;
        }

        inline mat4<F32>& viewMatrixInv() { return _viewMatrixInv; }
        inline mat4<F32>& viewProjectionMatrixInv() { return _viewProjMatrixInv; }

        inline const mat4<F32>& viewMatrixInv() const { return _viewMatrixInv; }
        inline const mat4<F32>& viewProjectionMatrixInv() const { return _viewProjMatrixInv; }

        bool _updated;
       private:
           mat4<F32> _viewMatrixInv;
           mat4<F32> _viewProjMatrixInv;
   };

  public:  // GPU interface
    static const U32 MaxFrameQueueSize = 2;
    static_assert(MaxFrameQueueSize > 0, "FrameQueueSize is invalid!");

    ErrorCode initRenderingAPI(I32 argc, char** argv, const vec2<U16>& renderResolution);
    void closeRenderingAPI();

    inline void setAPI(RenderAPI API) { _API_ID = API; }
    inline RenderAPI getAPI() const { return _API_ID; }

    void idle();
    void beginFrame();
    void endFrame(bool swapBuffers);

    /// Set all of the needed API specific settings for 2D (Ortho) / 3D
    /// (Perspective) rendering
    void toggle2D(bool state);

    void debugDraw(const SceneRenderState& sceneRenderState, RenderSubPassCmds& subPassesInOut);

    bool draw(const GenericDrawCommand& cmd);

    void addToRenderQueue(U32 queueIndex, const RenderPackage& package);
    void renderQueueToSubPasses(RenderPassCmd& commandsInOut);
    void flushCommandBuffer(const CommandBuffer& commandBuffer);

    I32  reserveRenderQueue();
    /// Sets the current render stage.
    ///@param stage Is used to inform the rendering pipeline what we are rendering.
    ///Shadows? reflections? etc
    inline bool isDepthStage() const;
    inline bool isPrePass() const;
    inline void setPrePass(const bool state);
    /// Clipping plane management. All the clipping planes are handled by shader
    /// programs only!
    void updateClipPlanes();
    /// disable or enable a clip plane by index
    inline void toggleClipPlane(ClipPlaneIndex index, const bool state);
    /// modify a single clip plane by index
    inline void setClipPlane(ClipPlaneIndex index, const Plane<F32>& p);
    /// set a new list of clipping planes. The old one is discarded
    inline void setClipPlanes(const PlaneList& clipPlanes);
    /// clear all clipping planes
    inline void resetClipPlanes();

    /// Generate a cubemap from the given position
    /// It renders the entire scene graph (with culling) as default
    /// use the callback param to override the draw function
    void generateCubeMap(RenderTarget& cubeMap,
                         const U32 arrayOffset,
                         const vec3<F32>& pos,
                         const vec2<F32>& zPlanes,
                         RenderStage renderStage,
                         U32 passIndex);

    void generateDualParaboloidMap(RenderTarget& targetBuffer,
                                   const U32 arrayOffset,
                                   const vec3<F32>& pos,
                                   const vec2<F32>& zPlanes,
                                   RenderStage renderStage,
                                   U32 passIndex);
                                     
    void getMatrix(const MATRIX& mode, mat4<F32>& mat) const;
    /// Alternative to the normal version of getMatrix
    inline mat4<F32> getMatrix(const MATRIX& mode) const;
    /// Access (Read Only) rendering data used by the GFX
    inline const GPUBlock::GPUData& renderingData() const;
    /// Register a function to be called in the 2D rendering fase of the GFX Flush
    /// routine. Use callOrder for sorting purposes
    inline void add2DRenderFunction(const GUID_DELEGATE_CBK& callback, U32 callOrder);
    inline void remove2DRenderFunction(const GUID_DELEGATE_CBK& callback);
    void restoreViewport();
    void setViewport(const vec4<I32>& viewport);
    inline void setViewport(I32 x, I32 y, I32 width, I32 height);
    /// Switch between fullscreen rendering
    void toggleFullScreen();
    void increaseResolution();
    void decreaseResolution();
    bool loadInContext(const CurrentContext& context,
                       const DELEGATE_CBK_PARAM<bool>& callback);

    /// Save a screenshot in TGA format
    void Screenshot(const stringImpl& filename);

  public:  // Accessors and Mutators
    inline const GPUState& gpuState() const { return _state; }

    inline GPUState& gpuState() { return _state; }

    inline void setInterpolation(const D64 interpolation) {
        _interpolationFactor = interpolation;
    }

    inline D64 getInterpolation() const { return _interpolationFactor; }

    inline void setGPUVendor(GPUVendor gpuvendor) { _GPUVendor = gpuvendor; }
    inline GPUVendor getGPUVendor() const { return _GPUVendor; }

    inline void setGPURenderer(GPURenderer gpurenderer) { _GPURenderer = gpurenderer; }
    inline GPURenderer getGPURenderer() const { return _GPURenderer; }

    inline void drawDebugAxis(const bool state) { _drawDebugAxis = state; }

    inline bool drawDebugAxis() const { return _drawDebugAxis; }

    inline RenderStage getRenderStage() const { return isPrePass() ? RenderStage::Z_PRE_PASS : _renderStage; }

    inline RenderStage getPrevRenderStage() const { return _prevRenderStage; }

    /// Return the last number of HIZ culled items
    U32 getLastCullCount() const;

    /// 2D rendering enabled
    inline bool is2DRendering() const { return _2DRendering; }

    /// returns the standard state block
    inline size_t getDefaultStateBlock(bool noDepth) const {
        return (noDepth ? _defaultStateNoDepthHash : _defaultStateBlockHash);
    }

    inline RenderTarget& renderTarget(RenderTargetID target) {
        return _rtPool.renderTarget(target);
    }

    inline RenderTarget& prevRenderTarget(RenderTargetID target) {
        return _rtPool.renderTarget(target);
    }

    inline void renderTarget(RenderTargetID target, RenderTarget* newTarget) {
        _rtPool.set(target, newTarget);
    }

    inline RenderTargetHandle allocateRT(RenderTargetUsage targetUsage) {
        return _rtPool.add(targetUsage, newRT());
    }

    inline RenderTargetHandle allocateRT() {
        return allocateRT(RenderTargetUsage::OTHER);
    }

    inline bool deallocateRT(RenderTargetHandle& handle) {
        return _rtPool.remove(handle);
    }

    RenderDetailLevel shadowDetailLevel() const { return _shadowDetailLevel; }

    void shadowDetailLevel(RenderDetailLevel detailLevel) {
        _shadowDetailLevel = detailLevel;
    }

    inline U32 getFrameCount() const { return FRAME_COUNT; }

    inline I32 getDrawCallCount() const { return FRAME_DRAW_CALLS_PREV; }

    inline void registerDrawCall() { registerDrawCalls(1); }

    inline void registerDrawCalls(U32 count) { FRAME_DRAW_CALLS += count; }

    inline const vec4<I32>& getCurrentViewport() const { return _viewport.top(); }

    inline RenderStage setRenderStage(RenderStage stage);

  public:
      IMPrimitive*       newIMP() const;
      VertexBuffer*      newVB() const;
      PixelBuffer*       newPB(PBType type = PBType::PB_TEXTURE_2D) const;
      GenericVertexData* newGVD(const U32 ringBufferLength) const;
      Texture*           newTexture(const stringImpl& name,
                                    const stringImpl& resourceLocation,
                                    TextureType type,
                                    bool asyncLoad) const;
      ShaderProgram*     newShaderProgram(const stringImpl& name,
                                          const stringImpl& resourceLocation,
                                          bool asyncLoad) const;
      ShaderBuffer*      newSB(const U32 ringBufferLength = 1,
                               const bool unbound = false,
                               const bool persistentMapped = true,
                               BufferUpdateFrequency frequency =
                                     BufferUpdateFrequency::ONCE) const;
  public:  // Direct API calls


    inline U64 getFrameDurationGPU() {
        return _api->getFrameDurationGPU();
    }

    inline void syncThreadToGPU(const std::thread::id& threadID, bool beginSync) {
        if (beginSync) {
            _api->syncToThread(threadID);
        }
    }

  protected:
    RenderTarget* newRT() const;

    void setBaseViewport(const vec4<I32>& viewport);

    inline void drawText(const TextLabel& text,
                         const vec2<F32>& position,
                         size_t stateHash) {
        uploadGPUBlock();
        _api->drawText(text, position, stateHash);
    }

    void onChangeResolution(U16 w, U16 h);

    static void computeFrustumPlanes(const mat4<F32>& invViewProj, vec4<F32>* planesOut);
  protected:
    friend class Camera;
    void renderFromCamera(Camera& camera);
    void onCameraUpdate(Camera& camera);
    void onCameraChange(Camera& camera);

    void flushDisplay();

   protected:
    friend class SceneManager;
    friend class RenderPass;
    friend class RenderPassManager;

    void occlusionCull(const RenderPass::BufferData& bufferData,
                       const Texture_ptr& depthBuffer);
    void buildDrawCommands(RenderPassCuller::VisibleNodeList& visibleNodes,
                           SceneRenderState& sceneRenderState,
                           RenderPass::BufferData& bufferData,
                           bool refreshNodeData);
    bool batchCommands(GenericDrawCommand& previousIDC,
                       GenericDrawCommand& currentIDC) const;
    void constructHIZ(RenderTarget& depthBuffer);

    RenderAPIWrapper& getAPIImpl() { return *_api; }
    const RenderAPIWrapper& getAPIImpl() const { return *_api; }

   private:
    GFXDevice();
    ~GFXDevice();

    void previewDepthBuffer();
    void updateViewportInternal(const vec4<I32>& viewport);
    void updateViewportInternal(I32 x, I32 y, I32 width, I32 height);
    /// Upload draw related data to the GPU (view & projection matrices, viewport settings, etc)
    void uploadGPUBlock();

    ErrorCode createAPIInstance();

    NodeData& processVisibleNode(const SceneGraphNode& node, U32 dataIndex);

    RenderTarget& activeRenderTarget();
    const RenderTarget& activeRenderTarget() const;

    mat4<F32>& getMatrixInternal(const MATRIX& mode);
    const mat4<F32>& getMatrixInternal(const MATRIX& mode) const;

  private:
    Camera* _cubeCamera;
    Camera* _2DCamera;
    Camera* _dualParaboloidCamera;

    RenderTarget* _activeRenderTarget;
    RenderAPIWrapper* _api;
    RenderStage _renderStage;
    RenderStage _prevRenderStage;
    bool _drawDebugAxis;
    bool _viewportUpdate;
    vectorImpl<Line> _axisLines;
    IMPrimitive     *_axisGizmo;
    vectorImpl<Line> _axisLinesTransformed;

    RenderTargetHandle _previousDepthBuffer;
  protected:
    RenderAPI _API_ID;
    GPUVendor _GPUVendor;
    GPURenderer _GPURenderer;
    GPUState _state;
    /* Rendering buffers.*/
    GFXRTPool _rtPool;
    /*State management */
    bool _stateBlockByDescription;
    size_t _defaultStateBlockHash;
    /// The default render state buth with depth testing disabled
    size_t _defaultStateNoDepthHash;
    /// Special render state for 2D rendering
    size_t _state2DRenderingHash;
    size_t _stateDepthOnlyRenderingHash;
    /// The interpolation factor between the current and the last frame
    D64 _interpolationFactor;
    PlaneList _clippingPlanes;
    bool _2DRendering;
    bool _isPrePassStage;
    // number of draw calls (rough estimate)
    I32 FRAME_DRAW_CALLS;
    U32 FRAME_DRAW_CALLS_PREV;
    U32 FRAME_COUNT;
    /// shader used to preview the depth buffer
    ShaderProgram_ptr _previewDepthMapShader;
    ShaderProgram_ptr _renderTargetDraw;
    ShaderProgram_ptr _HIZConstructProgram;
    ShaderProgram_ptr _HIZCullProgram;
    ShaderProgram_ptr _displayShader;

    /// Quality settings
    RenderDetailLevel _shadowDetailLevel;

    typedef std::pair<I64, DELEGATE_CBK<>> GUID2DCbk;
    mutable SharedLock _2DRenderQueueLock;
    vectorImpl<std::pair<U32, GUID2DCbk > > _2dRenderQueue;

    std::atomic_int _graphicResources;
    /// Current viewport stack
    ViewportStack _viewport;

    GPUBlock _gpuBlock;

    DrawCommandList _drawCommandsCache;
    std::array<NodeData, Config::MAX_VISIBLE_NODES> _matricesData;
    std::array<U32, to_const_uint(RenderStage::COUNT) - 1> _lastCommandCount;
    std::array<U32, to_const_uint(RenderStage::COUNT) - 1> _lastNodeCount;

    mutable SharedLock _renderQueueLock;
    vectorImpl<RenderPackageQueue> _renderQueues;

    mutable SharedLock _GFXLoadQueueLock;
    std::deque<DELEGATE_CBK_PARAM<bool>> _GFXLoadQueue;

    ShaderBuffer* _gfxDataBuffer;
    GenericDrawCommand _defaultDrawCmd;

    GenericCommandPool _commandPool;
    Time::ProfileTimer& _commandBuildTimer;

END_SINGLETON

namespace Attorney {
    class GFXDeviceGUI {
    private:
        static void drawText(const TextLabel& text,
                             size_t stateHash,
                             const vec2<F32>& position) {
            return GFXDevice::instance().drawText(text, position, stateHash);
        }

        friend class Divide::GUI;
        friend class Divide::GUIText;
    };

    class GFXDeviceKernel {
    private:
        static void onCameraUpdate(Camera& camera) {
            GFXDevice::instance().onCameraUpdate(camera);
        }

        static void onCameraChange(Camera& camera) {
            GFXDevice::instance().onCameraChange(camera);
        }

        static void flushDisplay() {
            GFXDevice::instance().flushDisplay();
        }

        static void onChangeWindowSize(U16 w, U16 h) {
            GFXDevice::instance().setBaseViewport(vec4<I32>(0, 0, w, h));
        }

        static void onChangeRenderResolution(U16 w, U16 h) {
            GFXDevice::instance().onChangeResolution(w, h);
        }

        static void syncThreadToGPU(const std::thread::id& threadID, bool beginSync) {
            if (beginSync) {
                GFXDevice::instance().syncThreadToGPU(threadID, beginSync);
            }
        }

        friend class Divide::Kernel;
    };

    class GFXDeviceRenderer {
        private:
        static void uploadGPUBlock() {
            GFXDevice::instance().uploadGPUBlock();
        }
        friend class Divide::Renderer;
    };

    class GFXDeviceGraphicsResource {
       private:
       static void onResourceCreate(GFXDevice& device) {
           device._graphicResources++;
       }
       static void onResourceDestroy(GFXDevice& device) {
           device._graphicResources--;
       }
       friend class Divide::GraphicsResource;
    };

    class GFXDeviceAPI {
        private:
        static void onRenderSubPass(GFXDevice& device) {
            device.uploadGPUBlock();
        }

        /// Get the entire list of clipping planes
        static const PlaneList& getClippingPlanes(GFXDevice& device) {
            return device._clippingPlanes;
        }

        friend class Divide::GL_API;
        friend class Divide::DX_API;
    };
};  // namespace Attorney
};  // namespace Divide

#include "GFXDevice.inl"

#endif

Commits for Divide-Framework/trunk/Source Code/Platform/Video/Headers/GFXDevice.h

Diff revisions: vs.
Revision Author Commited Message
781 Diff Diff IonutCava picture IonutCava Wed 12 Oct, 2016 16:03:46 +0000

[IonutCava]
- ShaderComputeQueue <-> Material shader request bug fix (element stuck in QUEUED state)
- More Camera class cleanups
- Add a method of removing EnvironmentProbes from their Pool

780 Diff Diff IonutCava picture IonutCava Tue 11 Oct, 2016 16:15:24 +0000

[IonutCava]
- AtomicCounter in glUniformBuffer is now based on a glGenericBuffer implementation
- GFXDevice <-> Camera relation cleaned up a bit
- Added a readback system for glGenericBuffer
- Fixed a bug with Z_PRE_PASS stage culling

778 Diff Diff IonutCava picture IonutCava Mon 10 Oct, 2016 15:18:32 +0000

[IonutCava]
- Rendering abstraction cleanup

777 Diff Diff IonutCava picture IonutCava Fri 07 Oct, 2016 16:14:48 +0000

[IonutCava]
- Continue to implement CommandBuffer / RenderPass / RenderSubPass system.
— Rendering artefacts are still present.

776 Diff Diff IonutCava picture IonutCava Thu 06 Oct, 2016 15:57:56 +0000

[IonutCava]
- Improve the CommandBuffer system to include the notion of a RenderPass /RenderSubPass with output render target info stored in them (not used yet)

775 Diff Diff IonutCava picture IonutCava Wed 05 Oct, 2016 15:54:54 +0000

[IonutCava]
- Cleanup RenderTarget <-> RTAttachment relation
- Multisampled render target state is now deduced based on attachments used

773 Diff Diff IonutCava picture IonutCava Tue 04 Oct, 2016 15:53:18 +0000

[IonutCava]
- Split GenericDrawCommand gathering system into Init/Update to facilitate future threading support
- Fix drawCount() == 0 case in submitRenderCommand
- Make _cameraPool (more) threadsafe

772 Diff Diff IonutCava picture IonutCava Thu 29 Sep, 2016 15:50:57 +0000

[IonutCava]
- Better GPU Vendor / Renderer detection

771 Diff Diff IonutCava picture IonutCava Tue 27 Sep, 2016 15:39:49 +0000

[IonutCava]
- Modify GFXDevice::flushRenderQueues so that it creates command buffers instead of directly calling rendering calls:
— Command buffers contain buffer, shader, texture and geometry info
— Command buffer state is now parsed and set at the API level instead of GFXDevice level
— This will allow easier porting to low level APIs later on
- Indirect draw is now a GenericDrawCommand render option instead of an explicit buffer draw parameter

770 IonutCava picture IonutCava Tue 20 Sep, 2016 16:12:27 +0000

[IonutCava]
- Prepare velocity map calculation (later used for temporal AA and motion blur):
— Add a previous depth buffer render target that blits the main depth buffer at the end of the frame
— Add a new render target to the screen FBO: velocity map
- Store normals as RG instead of RGB and pack/unpack in shaders. (compute >>>> bandwith)
- Rename Forward+ renderer to something more descriptive

(Requires deletion of all parsed & cached data)