1//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
2//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
3#include "BsGLGpuParamBlockBuffer.h"
4#include "Profiling/BsRenderStats.h"
5
6namespace bs { namespace ct
7{
8 GLGpuParamBlockBuffer::GLGpuParamBlockBuffer(UINT32 size, GpuBufferUsage usage, GpuDeviceFlags deviceMask)
9 :GpuParamBlockBuffer(size, usage, deviceMask)
10 {
11 assert((deviceMask == GDF_DEFAULT || deviceMask == GDF_PRIMARY) && "Multiple GPUs not supported natively on OpenGL.");
12 }
13
14 GLGpuParamBlockBuffer::~GLGpuParamBlockBuffer()
15 {
16 if(mBuffer)
17 bs_pool_delete(static_cast<GLHardwareBuffer*>(mBuffer));
18 }
19
20 void GLGpuParamBlockBuffer::initialize()
21 {
22 mBuffer = bs_pool_new<GLHardwareBuffer>(GL_UNIFORM_BUFFER, mSize, mUsage);
23 GpuParamBlockBuffer::initialize();
24 }
25}}