mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-02 12:03:51 +00:00
ogl device buffer creation
now ogl mirrors dx side with ubo creation and clearing pushed up to the device level.
This commit is contained in:
parent
1e8841e6b5
commit
11d8604d8e
5 changed files with 52 additions and 17 deletions
|
|
@ -292,6 +292,11 @@ GFXGLDevice::~GFXGLDevice()
|
|||
mTextureManager->kill();
|
||||
}
|
||||
|
||||
// Free device buffers
|
||||
DeviceBufferMap::Iterator bufferIter = mDeviceBufferMap.begin();
|
||||
for (; bufferIter != mDeviceBufferMap.end(); ++bufferIter)
|
||||
glDeleteBuffers(1, &bufferIter->value);
|
||||
|
||||
GFXResource* walk = mResourceListHead;
|
||||
while(walk)
|
||||
{
|
||||
|
|
@ -307,6 +312,23 @@ GFXGLDevice::~GFXGLDevice()
|
|||
SAFE_DELETE( mOpenglStateCache );
|
||||
}
|
||||
|
||||
GLuint GFXGLDevice::getDeviceBuffer(const GFXShaderConstDesc desc)
|
||||
{
|
||||
String name(desc.name + "_" + String::ToString(desc.size));
|
||||
DeviceBufferMap::Iterator buf = mDeviceBufferMap.find(name);
|
||||
if (buf != mDeviceBufferMap.end())
|
||||
{
|
||||
return mDeviceBufferMap[name];
|
||||
}
|
||||
|
||||
GLuint uboHandle;
|
||||
glGenBuffers(1, &uboHandle);
|
||||
|
||||
mDeviceBufferMap[name] = uboHandle;
|
||||
|
||||
return uboHandle;
|
||||
}
|
||||
|
||||
void GFXGLDevice::zombify()
|
||||
{
|
||||
mTextureManager->zombify();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue