Branimir Karadžić пре 9 година
родитељ
комит
9f2844e297
1 измењених фајлова са 9 додато и 1 уклоњено
  1. 9 1
      src/bgfx_p.h

+ 9 - 1
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;
 		}