mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-20 07:03:46 +00:00
fixes for opengl uniform buffer loading
This fix allows uniform buffers to be used with glsl shaders. Small issue with uniform buffers not being initialized correctly.
This commit is contained in:
parent
85d4fa1bda
commit
ab36fe24ec
2 changed files with 7 additions and 2 deletions
|
|
@ -323,9 +323,13 @@ GLuint GFXGLDevice::getDeviceBuffer(const GFXShaderConstDesc desc)
|
|||
|
||||
GLuint uboHandle;
|
||||
glGenBuffers(1, &uboHandle);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, uboHandle);
|
||||
glBufferData(GL_UNIFORM_BUFFER, desc.size, NULL, GL_DYNAMIC_DRAW); // allocate once
|
||||
|
||||
mDeviceBufferMap[name] = uboHandle;
|
||||
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, 0);
|
||||
|
||||
return uboHandle;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue