Browse Source

Fixed UniformCacheFrame::Resize (#3496)

attilaz 1 month ago
parent
commit
c18119bc41
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/bgfx_p.h

+ 2 - 2
src/bgfx_p.h

@@ -2263,7 +2263,7 @@ namespace bgfx
 
 
 				if (newKeysCapacity != m_keysCapacity)
 				if (newKeysCapacity != m_keysCapacity)
 				{
 				{
-					bx::realloc(g_allocator, m_keys, newKeysCapacity*sizeof(uint64_t) );
+					m_keys = (UniformCacheKey::KeyT*)bx::realloc(g_allocator, m_keys, newKeysCapacity * sizeof(uint64_t));
 					m_keysCapacity = newKeysCapacity;
 					m_keysCapacity = newKeysCapacity;
 				}
 				}
 			}
 			}
@@ -2273,7 +2273,7 @@ namespace bgfx
 
 
 				if (newDataCapacity != m_dataCapacity)
 				if (newDataCapacity != m_dataCapacity)
 				{
 				{
-					bx::realloc(g_allocator, m_keys, newDataCapacity);
+					m_data = (uint8_t*)bx::realloc(g_allocator, m_data, newDataCapacity);
 					m_dataCapacity = newDataCapacity;
 					m_dataCapacity = newDataCapacity;
 				}
 				}
 			}
 			}