Branimir Karadžić 9 years ago
parent
commit
0494d0362c
2 changed files with 8 additions and 6 deletions
  1. 6 6
      src/bgfx_p.h
  2. 2 0
      src/renderer_mtl.h

+ 6 - 6
src/bgfx_p.h

@@ -2627,9 +2627,9 @@ namespace bgfx
 				uint16_t flags = BGFX_BUFFER_NONE;
 				cmdbuf.write(flags);
 
-                size_t size = BX_ALIGN_16(sizeof(TransientIndexBuffer)) + BX_ALIGN_16(_size);
+				const uint32_t size = BX_ALIGN_16(sizeof(TransientIndexBuffer) ) + BX_ALIGN_16(_size);
 				tib = (TransientIndexBuffer*)BX_ALIGNED_ALLOC(g_allocator, size, 16);
-				tib->data   = (uint8_t *)((size_t)tib + BX_ALIGN_16(sizeof(TransientIndexBuffer)));
+				tib->data   = (uint8_t *)tib + BX_ALIGN_16(sizeof(TransientIndexBuffer) );
 				tib->size   = _size;
 				tib->handle = handle;
 			}
@@ -2643,7 +2643,7 @@ namespace bgfx
 			cmdbuf.write(_tib->handle);
 
 			m_submit->free(_tib->handle);
-			BX_FREE(g_allocator, _tib);
+			BX_ALIGNED_FREE(g_allocator, _tib, 16);
 		}
 
 		BGFX_API_FUNC(void allocTransientIndexBuffer(TransientIndexBuffer* _tib, uint32_t _num) )
@@ -2684,9 +2684,9 @@ namespace bgfx
 				uint16_t flags = BGFX_BUFFER_NONE;
 				cmdbuf.write(flags);
 
-                size_t size = BX_ALIGN_16(sizeof(TransientVertexBuffer)) + BX_ALIGN_16(_size);
+				const uint32_t size = BX_ALIGN_16(sizeof(TransientVertexBuffer) ) + BX_ALIGN_16(_size);
 				tvb = (TransientVertexBuffer*)BX_ALIGNED_ALLOC(g_allocator, size, 16);
-				tvb->data = (uint8_t *)((size_t)tvb + BX_ALIGN_16(sizeof(TransientVertexBuffer)));
+				tvb->data = (uint8_t *)tvb + BX_ALIGN_16(sizeof(TransientVertexBuffer) );
 				tvb->size = _size;
 				tvb->startVertex = 0;
 				tvb->stride = stride;
@@ -2703,7 +2703,7 @@ namespace bgfx
 			cmdbuf.write(_tvb->handle);
 
 			m_submit->free(_tvb->handle);
-			BX_FREE(g_allocator, _tvb);
+			BX_ALIGNED_FREE(g_allocator, _tvb, 16);
 		}
 
 		BGFX_API_FUNC(void allocTransientVertexBuffer(TransientVertexBuffer* _tvb, uint32_t _num, const VertexDecl& _decl) )

+ 2 - 0
src/renderer_mtl.h

@@ -508,6 +508,7 @@ namespace bgfx { namespace mtl
 #if BX_PLATFORM_IOS
 		return ([[[UIDevice currentDevice] systemVersion] compare:@(_version) options:NSNumericSearch] != NSOrderedAscending);
 #else
+		BX_UNUSED(_version);
 		return false;
 #endif
 	}
@@ -521,6 +522,7 @@ namespace bgfx { namespace mtl
 		return (v.majorVersion<<16) + (v.minorVersion<<8) + v.patchVersion >=
 				(_majorVersion<<16) + (_minorVersion<<8) + _patchVersion;
 #else
+		BX_UNUSED(_majorVersion, _minorVersion, _patchVersion);
 		return false;
 #endif
 	}