From 9f2844e297a334dbb92cc2c83ae3a8d72fd4286b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 25 Oct 2016 20:16:00 -0700 Subject: [PATCH] Cleanup. --- src/bgfx_p.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index fdbcee6c9..ea6e4331c 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -3436,6 +3436,11 @@ namespace bgfx { UniformHandle handle = { idx }; UniformRef& uniform = m_uniformRef[handle.idx]; + BX_CHECK(uniform.m_type == _type + , "Uniform type mismatch (type: %d, expected %d)." + , _type + , uniform.m_type + ); uint32_t oldsize = g_uniformTypeSize[uniform.m_type]; uint32_t newsize = g_uniformTypeSize[_type]; @@ -3461,7 +3466,6 @@ namespace bgfx UniformHandle handle = { m_uniformHandle.alloc() }; - BX_WARN(isValid(handle), "Failed to allocate uniform handle."); if (isValid(handle) ) { BX_TRACE("Creating uniform (handle %3d) %s", handle.idx, _name); @@ -3483,6 +3487,10 @@ namespace bgfx cmdbuf.write(len); cmdbuf.write(_name, len); } + else + { + BX_TRACE("Failed to allocate uniform handle."); + } return handle; }