Fixed uniform leak at shutdown.

This commit is contained in:
Branimir Karadžić 2014-08-23 10:37:25 -07:00
parent ac653682b6
commit 612eb2f7ed
2 changed files with 7 additions and 0 deletions

View file

@ -963,6 +963,11 @@ namespace
bgfx::destroyUniform(gl->u_params); bgfx::destroyUniform(gl->u_params);
bgfx::destroyUniform(gl->s_tex); bgfx::destroyUniform(gl->s_tex);
if (bgfx::isValid(gl->u_halfTexel) )
{
bgfx::destroyUniform(gl->u_halfTexel);
}
for (uint32_t ii = 0, num = gl->ntextures; ii < num; ++ii) for (uint32_t ii = 0, num = gl->ntextures; ii < num; ++ii)
{ {
if (bgfx::isValid(gl->textures[ii].id) ) if (bgfx::isValid(gl->textures[ii].id) )

View file

@ -2520,6 +2520,8 @@ namespace bgfx
BX_WARN(isValid(handle), "Failed to allocate uniform handle."); BX_WARN(isValid(handle), "Failed to allocate uniform handle.");
if (isValid(handle) ) if (isValid(handle) )
{ {
BX_TRACE("Creating uniform (handle %3d) %s", handle.idx, _name);
UniformRef& uniform = m_uniformRef[handle.idx]; UniformRef& uniform = m_uniformRef[handle.idx];
uniform.m_refCount = 1; uniform.m_refCount = 1;
uniform.m_type = _type; uniform.m_type = _type;