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
/*
Copyright (c) 2018 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 _GL_BUFFER_IMPL_H_
#define _GL_BUFFER_IMPL_H_

#include "Platform/Video/OpenGL/Headers/glResources.h"
namespace Divide {

struct BufferImplParams {
    BufferImplParams()
        : _target(GL_NONE),
          _frequency(BufferUpdateFrequency::ONCE),
          _dataSizeInBytes(0),
          _initialData(NULL),
          _name("")
    {
    }

    GLenum _target;
    BufferUpdateFrequency _frequency;
    size_t _dataSizeInBytes;
    bufferPtr _initialData;
    const char* _name;
};

class glBufferLockManager;
class glBufferImpl : public glObject {
public:
    explicit glBufferImpl(GFXDevice& context, const BufferImplParams& params);
    virtual ~glBufferImpl();

    GLuint bufferID() const;

    bool bindRange(GLuint bindIndex, size_t offsetInBytes, size_t rangeInBytes);
    void lockRange(size_t offsetInBytes, size_t rangeInBytes);
    void waitRange(size_t offsetInBytes, size_t rangeInBytes, bool blockClient);

    void writeData(size_t offsetInBytes, size_t rangeInBytes, bufferPtr data);
    void readData(size_t offsetInBytes, size_t rangeInBytes, const bufferPtr data);

protected:
    GLenum _target;
    GLuint _handle;
    size_t _alignedSize;
    GLenum _usage;
    bufferPtr _mappedBuffer;
    BufferUpdateFrequency _updateFrequency;
    glBufferLockManager* _lockManager;
};
}; //namespace Divide

#endif //_GL_BUFFER_IMPL_H_

Commits for Divide-Framework/trunk/Source Code/Platform/Video/OpenGL/Buffers/Headers/glBufferImpl.h

Diff revisions: vs.
Revision Author Commited Message
1029 Diff Diff IonutCava picture IonutCava Tue 30 Jan, 2018 17:28:39 +0000

[Ionut]
- Update copyright notices

1000 Diff Diff IonutCava picture IonutCava Thu 14 Dec, 2017 16:13:18 +0000

[Ionut]
- GenericVertexData fixes and cleanup

909 Diff Diff IonutCava picture IonutCava Thu 29 Jun, 2017 23:57:18 +0000

[Ionut]
- Rework RenderTarget class
— RTAttachment now deal with textures directly
— RT size needs to be specified upfront
- Application class is no longer a Singleton but passed around in the PlatformContext

897 Diff Diff IonutCava picture IonutCava Thu 22 Jun, 2017 18:26:20 +0000

[IonutCava]
- Fix multi-context GL object creation
- Add missing file

895 Diff Diff IonutCava picture IonutCava Wed 21 Jun, 2017 21:10:26 +0000

[IonutCava]
- Reorder and cleanup OpenGL backend a bit.
- Small code cleanup
- Some small profile-guided optimizations

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

[IonutCava]
- Update copyright notice

827 Diff Diff IonutCava picture IonutCava Sun 22 Jan, 2017 21:59:36 +0000

[IonutCava]
- ShaderBuffers now decide heuristically if they get persistently mapped or not (depends on size. Current limit is 512Kb for subData calls.
- Separate visible node command generation into 2 steps: onRender and getDrawPackage. onRender allows the creation of parallel tasks that should finish by the time the second call, getDrawPackage reaches the same node
- Update ParticleEmitter to take into account multiple players and increase parallelism at the cost of memory consumption and complexity.
- Add a default bounding box for Players (add extents to SceneTransform nodes)
- All buffers (ShaderBuffer, d3dConstantBuffer, glUniformBuffer, glBufferImpl, glGenericBuffer, etc) use BufferParams for creation.
— Constructor and create calls have been merged together

826 Diff Diff IonutCava picture IonutCava Fri 20 Jan, 2017 17:11:41 +0000

[IonutCava]
- Persistent buffer optimisations

807 Diff Diff IonutCava picture IonutCava Mon 09 Jan, 2017 17:06:26 +0000

[IonutCava]
- Split PlatformDefines.h into 2. Move data type defines to PlatformDataTypes.h
- Continue to improve velocity map calculation
- Remove “destroy()” calls from most classes. Attempt to move as many classes to the RAII system.

780 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