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
#include "Headers/GLWrapper.h"
#include "Headers/glIMPrimitive.h"

#include "Hardware/Video/Headers/GFXDevice.h"
#include "Hardware/Video/OpenGL/glsw/Headers/glsw.h"
#include "Hardware/Video/OpenGL/Buffers/Framebuffer/Headers/glFramebuffer.h"
#include "Hardware/Video/OpenGL/Buffers/PixelBuffer/Headers/glPixelBuffer.h"
#include "Hardware/Video/OpenGL/Buffers/VertexBuffer/Headers/glVertexArray.h"
#include "Hardware/Video/OpenGL/Buffers/VertexBuffer/Headers/glGenericVertexData.h"
#include "Hardware/Video/OpenGL/Buffers/ShaderBuffer/Headers/glUniformBuffer.h"

#include "GUI/Headers/GUIText.h"
#include "Core/Headers/ParamHandler.h"
#include "Managers/Headers/LightManager.h"
#include "Geometry/Material/Headers/Material.h"

#ifndef GLFONTSTASH_IMPLEMENTATION
#define GLFONTSTASH_IMPLEMENTATION
#define FONTSTASH_IMPLEMENTATION
#include "Text/Headers/fontstash.h"
#include "Text/Headers/glfontstash.h"
#endif
#include <glsl/glsl_optimizer.h>
#include <CEGUI/CEGUI.h>

namespace Divide {

GL_API::GL_API() : RenderAPIWrapper(),
                   _prevWidthNode(0),
                   _prevWidthString(0),
                   _prevSizeNode(0),
                   _prevSizeString(0),
                   _lineWidthLimit(1),
                   _pointDummyVAO(0),
				   _GUIGLrenderer(nullptr),
                   _fonsContext(nullptr),
                   _GLSLOptContex(nullptr),
                   _enableCEGUIRendering(false)
{
    // Only updated in Debug builds
    FRAME_DURATION_GPU = 0;
    // Atomic boolean use to signal the loading thread to stop
    _closeLoadingThread = false;
    // Initial values for performance queries
    for (U8 i = 0; i < PERFORMANCE_COUNTER_BUFFERS; ++i) {
        for (U8 j = 0; j < PERFORMANCE_COUNTERS; ++j) {
            _queryID[i][j] = 0;
        }
    }
    // All clip planes are disabled at first (default OpenGL state)
    for (U8 index = 0; index < Config::MAX_CLIP_PLANES; ++index) {
        _activeClipPlanes[index] = false;
    }
}

GL_API::~GL_API()
{
}

/// FontStash library initialization
void GL_API::createFonsContext() {
    // 512x512 atlas with bottom-left origin
    _fonsContext = glfonsCreate(512, 512, FONS_ZERO_BOTTOMLEFT);
}

/// FontStash library deinitialization
void GL_API::deleteFonsContext() {
    glfonsDelete(_fonsContext);
    _fonsContext = nullptr;
}

/// Prepare the GPU for rendering a frame
void GL_API::beginFrame() {
    // Start a duration query in debug builds
#   ifdef _DEBUG
        glBeginQuery(GL_TIME_ELAPSED, _queryID[_queryBackBuffer][0]);
#   endif
    // Restore the clear color (in case it changed)
    GL_API::clearColor(DefaultColors::DIVIDE_BLUE());
    // Clear our buffers
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT/* | GL_STENCIL_BUFFER_BIT*/);
    // Clears are registered as draw calls by most software, so we do the same to stay in sync with third party software
    GFX_DEVICE.registerDrawCall();
    GL_API::setActiveBuffer(GL_DRAW_INDIRECT_BUFFER, _indirectDrawBuffer);
}

/// Finish rendering the current frame
void GL_API::endFrame() {
    // Revert back to the default OpenGL states
    clearStates(false, false, false);
    // CEGUI handles its own states, so render it after we clear our states but before we swap buffers
    if (_enableCEGUIRendering) {
        CEGUI::System::getSingleton().renderAllGUIContexts();
    }
    // Swap buffers
    glfwSwapBuffers(GLUtil::_mainWindow);
    // Poll for new events
    glfwPollEvents();
    // End the timing query started in beginFrame() in debug builds
#   ifdef _DEBUG
        glEndQuery(GL_TIME_ELAPSED);
        // Swap query objects. The current time will be available after 4 frames
        _queryBackBuffer   = GFX_DEVICE.getFrameCount() % 4;
        _queryFrontBuffer = 3 - _queryBackBuffer;
#   endif
}

/// Prepare our shader loading system
bool GL_API::initShaders() {
    // Initialize GLSW
    GLint glswState = glswInit();
    // Add our engine specific defines and various code pieces to every GLSL shader
    // Add version as the first shader statement, followed by copyright notice
    glswAddDirectiveToken("","#version 430 core\n/*“Copyright 2009-2014 DIVIDE-Studio”*/");
    glswAddDirectiveToken("","#extension GL_ARB_shader_draw_parameters : require");
    // Add current build environment information to the shaders
#   if defined(_DEBUG)
        glswAddDirectiveToken("", "#define _DEBUG");
#   elif defined(_PROFILE)
        glswAddDirectiveToken("", "#define _PROFILE");
#   else
        glswAddDirectiveToken("", "#define _RELEASE");
#   endif

    // Shader stage level reflection system. A shader stage must know what stage it's used for
    glswAddDirectiveToken("Vertex",   "#define VERT_SHADER");
    glswAddDirectiveToken("Geometry", "#define GEOM_SHADER");
    glswAddDirectiveToken("Fragment", "#define FRAG_SHADER");
    glswAddDirectiveToken("TessellationE", "#define TESS_EVAL_SHADER");
    glswAddDirectiveToken("TessellationC", "#define TESS_CTRL_SHADER");
    glswAddDirectiveToken("Compute",  "#define COMPUTE_SHADER");
    // This line gets replaced in every shader at load with the custom list of defines specified by the material
    glswAddDirectiveToken("", "//__CUSTOM_DEFINES__");
    // Add some nVidia specific pragma directives
    if (GFX_DEVICE.getGPUVendor() == GPU_VENDOR_NVIDIA) {
        glswAddDirectiveToken("","//#pragma optionNV(fastmath on)");
        glswAddDirectiveToken("","//#pragma optionNV(fastprecision on)");
        glswAddDirectiveToken("","//#pragma optionNV(inline all)");
        glswAddDirectiveToken("","//#pragma optionNV(ifcvt none)");
        glswAddDirectiveToken("","//#pragma optionNV(strict on)");
        glswAddDirectiveToken("","//#pragma optionNV(unroll all)");
    }
    // Try to sync engine specific data and values with GLSL
    glswAddDirectiveToken("", ("#define MAX_CLIP_PLANES " + 
                                Util::toString(Config::MAX_CLIP_PLANES)).c_str());
    glswAddDirectiveToken("", ("#define MAX_SHADOW_CASTING_LIGHTS " + 
                                Util::toString(Config::Lighting::MAX_SHADOW_CASTING_LIGHTS_PER_NODE)).c_str());
    glswAddDirectiveToken("", ("const uint MAX_SPLITS_PER_LIGHT = " + 
                                Util::toString(Config::Lighting::MAX_SPLITS_PER_LIGHT) + ";").c_str());
    glswAddDirectiveToken("", ("const uint MAX_LIGHTS_PER_SCENE = " + 
                                Util::toString(Config::Lighting::MAX_LIGHTS_PER_SCENE) + ";").c_str());
    glswAddDirectiveToken("", ("#define SHADER_BUFFER_LIGHT_NORMAL " + 
                                Util::toString(SHADER_BUFFER_LIGHT_NORMAL)).c_str());
    glswAddDirectiveToken("", ("#define SHADER_BUFFER_GPU_BLOCK " + 
                                Util::toString(SHADER_BUFFER_GPU_BLOCK)).c_str());
    glswAddDirectiveToken("", ("#define SHADER_BUFFER_NODE_INFO " + 
                                Util::toString(SHADER_BUFFER_NODE_INFO)).c_str());
    glswAddDirectiveToken("", "const float Z_TEST_SIGMA = 0.0001;");
    glswAddDirectiveToken("", "const float ALPHA_DISCARD_THRESHOLD = 0.25;");
    
    glswAddDirectiveToken("Fragment", "#define VARYING in"); 
    glswAddDirectiveToken("Fragment", ("#define SHADER_BUFFER_LIGHT_SHADOW " + 
                                        Util::toString(SHADER_BUFFER_LIGHT_SHADOW)).c_str());
	glswAddDirectiveToken("Fragment", ("#define MAX_TEXTURE_SLOTS " + 
                          Util::toString(ParamHandler::getInstance().getParam<I32>("rendering.maxTextureSlots", 16))).c_str());
    glswAddDirectiveToken("Fragment", ("#define TEXTURE_UNIT0 " +
                                        Util::toString(ShaderProgram::TEXTURE_UNIT0)).c_str());
    glswAddDirectiveToken("Fragment", ("#define TEXTURE_UNIT1 " + 
                                        Util::toString(ShaderProgram::TEXTURE_UNIT1)).c_str());
    glswAddDirectiveToken("Fragment", ("#define TEXTURE_NORMALMAP " + 
                                        Util::toString(ShaderProgram::TEXTURE_NORMALMAP)).c_str());
    glswAddDirectiveToken("Fragment", ("#define TEXTURE_OPACITY " + 
                                        Util::toString(ShaderProgram::TEXTURE_OPACITY)).c_str());
    glswAddDirectiveToken("Fragment", ("#define TEXTURE_SPECULAR " + 
                                        Util::toString(ShaderProgram::TEXTURE_SPECULAR)).c_str());
    glswAddDirectiveToken("Fragment", ("#define TEXTURE_PROJECTION " + 
                                        Util::toString(ShaderProgram::TEXTURE_PROJECTION)).c_str());
    glswAddDirectiveToken("Fragment", ("#define SHADOW_CUBE_START " + 
        Util::toString((U32)LightManager::getInstance().getShadowBindSlotOffset(LightManager::SHADOW_SLOT_TYPE_CUBE))).c_str());
    glswAddDirectiveToken("Fragment", ("#define SHADOW_NORMAL_START " + 
        Util::toString((U32)LightManager::getInstance().getShadowBindSlotOffset(LightManager::SHADOW_SLOT_TYPE_NORMAL))).c_str());
    glswAddDirectiveToken("Fragment", ("#define SHADOW_ARRAY_START " + 
        Util::toString((U32)LightManager::getInstance().getShadowBindSlotOffset(LightManager::SHADOW_SLOT_TYPE_ARRAY))).c_str());
    glswAddDirectiveToken("Fragment", "const uint DEPTH_EXP_WARP = 32;");

    // GLSL <-> VBO intercommunication 
    glswAddDirectiveToken("Vertex", "#define VARYING out");
    glswAddDirectiveToken("Vertex", ("const uint MAX_BONE_COUNT_PER_NODE = " + 
                                      Util::toString(Config::MAX_BONE_COUNT_PER_NODE) + ";").c_str());
    glswAddDirectiveToken("Vertex", ("#define SHADER_BUFFER_BONE_TRANSFORMS " + 
                                      Util::toString(SHADER_BUFFER_BONE_TRANSFORMS)).c_str());
    // Vertex data has a fixed format
    glswAddDirectiveToken("Vertex", ("layout(location = " + 
                                      Util::toString(VERTEX_POSITION_LOCATION) + 
                                     ") in vec3  inVertexData;").c_str());
    glswAddDirectiveToken("Vertex", ("layout(location = " + 
                                      Util::toString(VERTEX_COLOR_LOCATION) + 
                                     ") in vec4  inColorData;").c_str());
    glswAddDirectiveToken("Vertex", ("layout(location = " + 
                                      Util::toString(VERTEX_NORMAL_LOCATION) + 
                                     ") in vec3  inNormalData;").c_str());
    glswAddDirectiveToken("Vertex", ("layout(location = " + 
                                      Util::toString(VERTEX_TEXCOORD_LOCATION) + 
                                     ") in vec2  inTexCoordData;").c_str());
    glswAddDirectiveToken("Vertex", ("layout(location = " + 
                                      Util::toString(VERTEX_TANGENT_LOCATION) + 
                                     ") in vec3  inTangentData;").c_str());
    glswAddDirectiveToken("Vertex", ("layout(location = " + 
                                      Util::toString(VERTEX_BITANGENT_LOCATION) + 
                                     ") in vec3  inBiTangentData;").c_str());
    glswAddDirectiveToken("Vertex", ("layout(location = " +
                                      Util::toString(VERTEX_BONE_WEIGHT_LOCATION) + 
                                     ") in vec4  inBoneWeightData;").c_str());
    glswAddDirectiveToken("Vertex", ("layout(location = " + 
                                      Util::toString(VERTEX_BONE_INDICE_LOCATION) + 
                                     ") in ivec4 inBoneIndiceData;").c_str());
    // GPU specific data, such as GFXDevice's main uniform block and clipping planes 
    // are defined in an external file included in every shader
    glswAddDirectiveToken("", "#include \"nodeDataInput.cmn\"");
    // After we finish with all of the defines, add all of the custom uniform variables defined by each material
    glswAddDirectiveToken("", "//__CUSTOM_UNIFORMS__");
    // Create an optimisation context used for post-processing shaders 
    // (using Aras Pranckevičius's glsl-optimizer: https://github.com/aras-p/glsl-optimizer )
    _GLSLOptContex = glslopt_initialize(GFX_DEVICE.getApi() == OpenGLES ? kGlslTargetOpenGLES30 : kGlslTargetOpenGL);
    // Check initialization status for GLSL and glsl-optimizer
    return (glswState == 1 && _GLSLOptContex != nullptr);
}

/// Revert everything that was set up in "initShaders()"
bool GL_API::deInitShaders() {
    // Delete the glsl-optimizer context
    glslopt_cleanup(_GLSLOptContex);
    // Shutdown GLSW
    return (glswShutdown() == GL_TRUE);
}

/// Try to find the requested font in the font cache. Load on cache miss.
I32 GL_API::getFont(const stringImpl& fontName) {
    // Search for the requested font by name
    FontCache::const_iterator it = _fonts.find(fontName);
    // If we failed to find it, it wasn't loaded yet
    if (it == _fonts.end()) {
        // Fonts are stored in the general asset directory
		stringImpl fontPath(ParamHandler::getInstance().getParam<stringImpl>("assetsLocation", "assets") + "/");
        // In the GUI subfolder
        fontPath += "GUI/";
        // In the fonts subfolder
        fontPath += "fonts/";
        fontPath += fontName;
        // We use FontStash to load the font file
        I32 tempFont = fonsAddFont(_fonsContext, fontName.c_str(), fontPath.c_str());
        // If the font is invalid, inform the user, but map it anyway, to avoid loading an invalid font file on every request
        if (tempFont == FONS_INVALID) {
            ERROR_FN(Locale::get("ERROR_FONT_FILE"), fontName.c_str());
        }
        // Save the font in the font cache
        hashAlg::pair<FontCache::iterator, bool> result = hashAlg::emplace(_fonts, fontName, tempFont);
		assert(result.second);
        // Return the font
		return result.first->second;
    }
    // We found the font in cache, so return it
    return it->second;
}

/// Text rendering is handled exclusively by Mikko Mononen's FontStash library (https://github.com/memononen/fontstash)
/// with his OpenGL frontend adapted for core context profiles
void GL_API::drawText(const TextLabel& textLabel, const vec2<I32>& position) {
    // Retrieve the font from the font cache
    I32 font = getFont(textLabel._font);
    // The font may be invalid, so skip this text label
    if (font == FONS_INVALID) {
        return;
    }
    // See FontStash documentation for the following block
    {
        fonsClearState(_fonsContext);
        fonsSetSize(_fonsContext, textLabel._height);
        fonsSetFont(_fonsContext, font);
        F32 lh = 0;
        fonsVertMetrics(_fonsContext, nullptr, nullptr, &lh);
        fonsSetColor(_fonsContext, 
                     textLabel._color.r * 255, 
                     textLabel._color.g * 255, 
                     textLabel._color.b * 255, 
                     textLabel._color.a * 255);

        if (textLabel._blurAmount > 0.01f) {
            fonsSetBlur(_fonsContext, textLabel._blurAmount );
        }

        if (textLabel._spacing > 0.01f) {
            fonsSetBlur(_fonsContext, textLabel._spacing );
        }

        if (textLabel._alignFlag != 0) {
            fonsSetAlign(_fonsContext, textLabel._alignFlag);
        }

        fonsDrawText(_fonsContext, position.x, _cachedResolution.y - (position.y + lh), textLabel._text.c_str(), nullptr);
    }
    // Register each label rendered as a draw call
    GFX_DEVICE.registerDrawCall();
}

/// Rendering points is universally useful, so we have a function, and a VAO, dedicated to this process
void GL_API::drawPoints(GLuint numPoints) {
    GL_API::setActiveVAO(_pointDummyVAO);
    glDrawArrays(GL_POINTS, 0, numPoints);
    GFX_DEVICE.registerDrawCall();
}

void GL_API::uploadDrawCommands(const vectorImpl<IndirectDrawCommand>& drawCommands) const {
    glNamedBufferDataEXT(_indirectDrawBuffer, 
                         sizeof(IndirectDrawCommand) * drawCommands.size(), 
                         drawCommands.data(), 
                         GL_DYNAMIC_COPY);
}

/// Verify if we have a sampler object created and available for the given descriptor
size_t GL_API::getOrCreateSamplerObject(const SamplerDescriptor& descriptor) {
    // Get the descriptor's hash value
    size_t hashValue = descriptor.getHash();
    // Try to find the hash value in the sampler object map
    samplerObjectMap::const_iterator it = _samplerMap.find(hashValue);
    // If we fail to find it, we need to create a new sampler object
    if (it == _samplerMap.end()) {
        // Create and store the newly created sample object. GL_API is responsible for deleting these!
        hashAlg::emplace(_samplerMap, hashValue, MemoryManager_NEW glSamplerObject(descriptor));
    }
    // Return the sampler object's hash value
    return hashValue;
}

/// Return the OpenGL sampler object's handle for the given hash value
GLuint GL_API::getSamplerHandle(size_t samplerHash) {
    // If the hash value is 0, we assume the code is trying to unbind a sampler object
    if (samplerHash == 0) {
        return 0;
    }
    // If we fail to find the sampler object for the given hash, we print an error and return the default OpenGL handle
    samplerObjectMap::const_iterator it = _samplerMap.find(samplerHash);
    if (it == _samplerMap.end()) {
        ERROR_FN(Locale::get("ERROR_NO_SAMPLER_OBJECT_FOUND"), samplerHash);
        return 0;
    }
    // Return the OpenGL handle for the sampler object matching the specified hash value
    return it->second->getObjectHandle();
}

/// Create and return a new IM emulation primitive. The callee is responsible for it's deletion!
IMPrimitive* GL_API::newIMP() const {
    return MemoryManager_NEW glIMPrimitive();
}

/// Create and return a new framebuffer. The callee is responsible for it's deletion!
Framebuffer* GL_API::newFB(bool multisampled) const {
    // If MSAA is disabled, this will be a simple color / depth buffer
    // If we requested a MultiSampledFramebuffer and MSAA is enabled, we also allocate a resolve framebuffer
    // We set the resolve framebuffer as the requested framebuffer's child. 
    // The framebuffer is responsible for deleting it's own resolve child!
    return MemoryManager_NEW glFramebuffer((multisampled && GFX_DEVICE.MSAAEnabled()) ? MemoryManager_NEW glFramebuffer() : 
                                                                                        nullptr);
}

/// Create and return a new vertex array (VAO + VB + IB). The callee is responsible for it's deletion!
VertexBuffer* GL_API::newVB() const {
    return MemoryManager_NEW glVertexArray();
}

/// Create and return a new pixel buffer using the requested format. The callee is responsible for it's deletion!
PixelBuffer* GL_API::newPB(const PBType& type) const {
    return MemoryManager_NEW glPixelBuffer(type);
}

/// Create and return a new generic vertex data object and, optionally set it as persistently mapped. 
/// The callee is responsible for it's deletion!
GenericVertexData* GL_API::newGVD(const bool persistentMapped) const {
    return MemoryManager_NEW glGenericVertexData(persistentMapped);
}

/// Create and return a new shader buffer. The callee is responsible for it's deletion!
/// The OpenGL implementation creates either an 'Uniform Buffer Object' if unbound is false
/// or a 'Shader Storage Block Object' otherwise
ShaderBuffer* GL_API::newSB(const bool unbound, const bool persistentMapped) const {
    // The shader buffer can also be persistently mapped, if requested
    return MemoryManager_NEW glUniformBuffer(unbound, persistentMapped);
}

/// Create and return a new texture array (optionally, flipped vertically). The callee is responsible for it's deletion!
Texture* GL_API::newTextureArray(const bool flipped) const {
    return MemoryManager_NEW glTexture(TEXTURE_2D_ARRAY, flipped);
}

/// Create and return a new 2D texture (optionally, flipped vertically). The callee is responsible for it's deletion!
Texture* GL_API::newTexture2D(const bool flipped) const {
    return MemoryManager_NEW glTexture(TEXTURE_2D, flipped);
}

/// Create and return a new cube texture (optionally, flipped vertically). The callee is responsible for it's deletion!
Texture* GL_API::newTextureCubemap(const bool flipped) const {
    return MemoryManager_NEW glTexture(TEXTURE_CUBE_MAP, flipped);
}

/// Create and return a new shader program (optionally, post load optimised). The callee is responsible for it's deletion!
ShaderProgram* GL_API::newShaderProgram(const bool optimise) const {
    return MemoryManager_NEW glShaderProgram(optimise);
}

/// Create and return a new shader of the specified type by loading the specified name (optionally, post load optimised). 
/// The callee is responsible for it's deletion!
Shader* GL_API::newShader(const stringImpl& name, const ShaderType& type, const bool optimise) const {
    return MemoryManager_NEW glShader(name, type, optimise);
}

};

Commits for Divide-Framework/trunk/Source Code/Hardware/Video/OpenGL/GLWrapper.cpp

Diff revisions: vs.
Revision Author Commited Message
331 Diff Diff IonutCava picture IonutCava Sat 06 Dec, 2014 20:53:45 +0000

[Ionut]
- Limited line length to 132 characters to improve readability and diff-comparisons
- Refactored memory allocation/deallocation functions
- Fixed a few compatibility issues with HashMap.h
- Fixed a bug in GPU Skinning shaders (cast a float to int)

330 Diff Diff IonutCava picture IonutCava Fri 10 Oct, 2014 17:19:11 +0000

[Ionut]
- New rendering algorithm :
— Perform second pass for visible nodes gathering all render commands and uploading them to an indirect draw buffer
— Render geometry with indirect draw commands
— Removed per-node range binding of the node buffer. Instead, bind the entire buffer once and index data in shaders
— Use “baseInstance” parameter from IndirectDrawCommand as a node buffer index
— Prefer DSA extensions for updating buffer data where applicable
- Moved all rendering specific code from SceneGraphNode to a new RenderingComponent
- Optimized “toString” utility function

326 Diff Diff IonutCava picture IonutCava Tue 30 Sep, 2014 21:11:32 +0000

[Ionut]
- Fixed more memory leaks
- Simplified Task interface and timing System
- Improved compatibility between Boost, STL and EASTL with random combinations of vectors, strings and maps
- Simplified Light class by removing the “slot” member
- Random optimizations

323 Diff Diff IonutCava picture IonutCava Thu 11 Sep, 2014 20:58:50 +0000

[Ionut]
- Reworked GFXDevice API initialization system
- Added a separate map for boolean values in ParamHandler
- More cleanups in GFXDevice class
- Fixed an infinite loop issue in Task class

321 Diff Diff IonutCava picture IonutCava Wed 03 Sep, 2014 22:05:15 +0000

[Ionut]
- Added support (and enabled by default) for the EASTL library (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html / https://github.com/paulhodge/EASTL)
— Strings, vectors and hash_maps can be combined from EASTL, STL and Boost (not all combinations work. e.g. EASTL strings with STL/Boost containers due to the lack of a proper hash function)

319 Diff Diff IonutCava picture IonutCava Sat 30 Aug, 2014 21:37:57 +0000

[Ionut]
- Performance tweaks based on profiling data

318 Diff Diff IonutCava picture IonutCava Sat 30 Aug, 2014 17:35:53 +0000

[Ionut]
- Wrapped the entire code in a “Divide” namespace
- VertexBuffers now call “shrink_to_fit” on all internal data storage
- Improved some vector performance by preferring “emplace_back” instead of “push_back” + proepr usage of reserve / resize
- Wrapped OIS specific types and classes in Divide::Input namespace
- Added the messageBox.layout file (forgot it in the previous few commits)

298 Diff Diff k1ngp1n picture k1ngp1n Sun 03 Aug, 2014 17:46:29 +0000

[Ionut]
- Final nVidia compatibility commit

296 Diff Diff k1ngp1n picture k1ngp1n Sun 03 Aug, 2014 14:54:21 +0000

[Ionut]
- nVidia compatibility fixes (GUI, shadows, post-processing)
- Texture bind slots are now part of ShaderProgram class
- Renamed ForwardRenderer class to ForwardPlusRenderer and moved ligh grid creation to it
- More code cleanups and comments

295 k1ngp1n picture k1ngp1n Fri 01 Aug, 2014 20:10:44 +0000

[Ionut]
- If a shader fails to bind, skip draw call. A shader will fail to bind if it wasn’t linked properly, as well
- Moved ShaderManager to the Hardware project due to its tight coupling
- More code cleanup and comments:
— OpenGL wrapper code : GLWrapper.h, GLWrapper.cpp, GLStates.cpp, glShaderProgram.cpp
- Cleaned up Shader.cpp
- Binary shader dump also saves binary format in .fmt file for each binary shader
- Renamed immediate mode primitive files