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
/*
   Copyright (c) 2017 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_STATE_H_
#define _HARDWARE_VIDEO_GFX_STATE_H_

#include "Core/Math/Headers/MathVectors.h"
#include "Core/Headers/NonCopyable.h"

#include <boost/lockfree/spsc_queue.hpp>
#include <thread>
#include <condition_variable>
#include "Platform/Threading/Headers/Task.h"

namespace Divide {
    
class GPUState : private NonCopyable {
   public:
    typedef boost::lockfree::spsc_queue<
        DELEGATE_CBK<void>, boost::lockfree::capacity<15> > LoadQueue;

    struct GPUVideoMode {
        // width x height
        vec2<U16> _resolution;
        // bits per pixel;
        U8 _bitDepth;
        // format name;
        stringImpl _formatName;
        // Max supported
        vectorImpl<U8> _refreshRate;

        bool operator==(const GPUVideoMode& other) const {
            return _resolution == other._resolution &&
                   _bitDepth == other._bitDepth &&
                   _refreshRate == other._refreshRate &&
                   _formatName.compare(other._formatName) == 0;
        }
    };

   public:
    GPUState();
    ~GPUState();

    /// register a new display mode (resolution, bitdepth, etc).
    void registerDisplayMode(U8 displayIndex, const GPUVideoMode& mode);

    inline vectorAlg::vecSize getDisplayCount() const {
        return _supportedDislpayModes.size();
    }

    inline const vectorImpl<GPUVideoMode>& getDisplayModes(vectorAlg::vecSize displayIndex) const {
        assert(displayIndex < _supportedDislpayModes.size());
        return _supportedDislpayModes[displayIndex];
    }

   protected:
    // Display system
    vectorImpl<vectorImpl<GPUVideoMode>> _supportedDislpayModes;
};

};  // namespace Divide

#endif

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

Diff revisions: vs.
Revision Author Commited Message
842 Diff Diff IonutCava picture IonutCava Wed 01 Feb, 2017 17:25:15 +0000

[IonutCava]
- Start to implement scripting support via ChaiScript: http://chaiscript.com/
- Cleanup DELEGATE_CBK alias

836 Diff Diff IonutCava picture IonutCava Fri 27 Jan, 2017 14:59:56 +0000

[IonutCava]
- Update copyright notice

714 Diff Diff IonutCava picture IonutCava Thu 26 May, 2016 16:26:23 +0000

[IonutCava]
- Initial code for multithreaded scene load:
— Tasks can have a “sync with gpu” flag that will cause them to use a shared context (so they can call GL functions)
- Added per scene GUI lists that get passed to the main GUI class (still need a base class to hold the map and accessors to avoid code duplication)
- Re-enabled threading unit tests

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;

664 Diff Diff IonutCava picture IonutCava Wed 30 Mar, 2016 16:23:51 +0000

[IonutCava]
- Split some render bin loops into multiple tasks
- Cleaned up the Task class
- Attempt to improve Console multithreaded performance (does not compile yet)

648 Diff Diff IonutCava picture IonutCava Sun 21 Feb, 2016 16:32:52 +0000

[IonutCava]
- Update copyright notice
- Move BoundingBox and BoundingSphere to a new BoundsComponent
— Add a temp hack in SceneGraphNode to update these

604 Diff Diff IonutCava picture IonutCava Sun 13 Dec, 2015 19:04:57 +0000

[IonutCava]
- New post processing system:
— Simplified operators
— PostFX is always enabled. Individual operators are toggles on or off
— Fixed Bloom and adaptive exposure
- Reworked texture creation and resizing
— Saved TextureDescriptor as part of the texture state

542 Diff Diff IonutCava picture IonutCava Thu 29 Oct, 2015 23:44:59 +0000

[IonutCava]
- Improved multi-threaded culling
- Increased nodeBuffer size to avoid different render stages to override each-other’s data and wait for locks
- Added a indirect command buffer per render stage

516 Diff Diff IonutCava picture IonutCava Tue 29 Sep, 2015 18:21:34 +0000

[IonutCava]
- Fixed VBO partitioning system
- Replaced some DELEGATE_BIND calls with lambda expressions
- Some multithreaded rendering work (still not functional)

449 IonutCava picture IonutCava Tue 26 May, 2015 22:42:37 +0000

[Ionut]
- More work on windowing system