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
/*
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 _PUSH_CONSTANTS_H_
#define _PUSH_CONSTANTS_H_

#include "PushConstant.h"

namespace Divide {
class PushConstants {
    public:
    PushConstants();
    PushConstants(const GFX::PushConstant& constant);
    PushConstants(const vectorImpl<GFX::PushConstant>& data);
    ~PushConstants();

    PushConstants(const PushConstants& other);
    PushConstants& operator=(const PushConstants& other);

    void set(const GFX::PushConstant& constant);

    template<typename T>
    inline void set(const stringImplFast& binding,
                    GFX::PushConstantType type,
                    const T& value,
                    bool flag = false) {
        set(binding, type, vectorImpl<T>{value}, flag);
    }

    template<typename T>
    inline void set(const stringImplFast& binding,
                    GFX::PushConstantType type,
                    const vectorImpl<T>& values,
                    bool flag = false) {

        U64 bindingID = _ID_RT(binding.c_str());
        for (GFX::PushConstant& constant : _data) {
            if (constant._bindingHash == bindingID) {
                constant.assign({ binding, type, values, flag });
                return;
            }
        }

        _data.emplace_back(binding, type, values, flag );
    }

    template<typename T, size_t N>
    inline void set(const stringImplFast& binding,
                    GFX::PushConstantType type,
                    const std::array<T, N>& values,
                    bool flag = false) {

        U64 bindingID = _ID_RT(binding.c_str());
        for (GFX::PushConstant& constant : _data) {
            if (constant._bindingHash == bindingID) {
                constant.assign({ binding, type, values, flag });
                return;
            }
        }

        _data.emplace_back(binding, type, values, flag);
    }

    void clear();

    inline bool empty() const { return _data.empty(); }

    inline vectorImpl<GFX::PushConstant>& data() { return _data; }

    inline const vectorImpl<GFX::PushConstant>& data() const { return _data; }

  
  protected:
    vectorImpl<GFX::PushConstant> _data;
};

}; //namespace Divide

#endif //_PUSH_CONSTANTS_H_

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

Diff revisions: vs.
Revision Author Commited Message
1021 Diff Diff IonutCava picture IonutCava Sun 21 Jan, 2018 22:19:16 +0000

[Ionut]
- Performance optimizations

1020 Diff Diff IonutCava picture IonutCava Fri 19 Jan, 2018 17:51:19 +0000

[Ionut]
- Second attempt at improving PushConstant performance

1014 Diff Diff IonutCava picture IonutCava Tue 16 Jan, 2018 01:18:31 +0000

[Ionut]
- Attempt to pool PushConstants
— ToDo: Fix cleanup crash / heap corruption

1011 Diff Diff IonutCava picture IonutCava Fri 12 Jan, 2018 17:21:29 +0000

[Ionut]
- Performance improvements

1008 Diff Diff IonutCava picture IonutCava Fri 22 Dec, 2017 15:55:34 +0000

[Ionut]
- Cleanup GUIButton
- Small fixes with terrain rendering

1006 Diff Diff IonutCava picture IonutCava Thu 21 Dec, 2017 23:03:41 +0000

[Ionut]
- Fixed a bug with PushConstants of vector data

993 Diff Diff IonutCava picture IonutCava Sun 10 Dec, 2017 20:07:57 +0000

[Ionut]
- Finished initial port of the old scene graph system to the new ECS based system.
- Finished converting 2 components to the new ECS system: Transform and RigidBody
- Fixed the “Deploy” build error with the CEGUI OpenGL renderer.
- Compilation now needs C++14 support (it’s sufficiently wide-spread now)

963 Diff Diff IonutCava picture IonutCava Sun 05 Nov, 2017 18:31:51 +0000

[Ionut]
- More multi-window fixes
- Profile guided performance improvements

953 Diff Diff IonutCava picture IonutCava Sat 28 Oct, 2017 21:57:10 +0000

[Ionut]
- Fix blinking issue by caching and hashing pipelines to that we don’t overwrite pipelines used by other elements

930 IonutCava picture IonutCava Sun 13 Aug, 2017 20:33:31 +0000

[Ionut]
- Fix a bug with Push Constant to Uniform conversion
- Add more push constant types
- Fix RENDER_INDIRECT param for draw commands
- Cleanup Sky, Terrain and Vegetation a bit