From e9869fbeedb96d7a053fc965ec8dbccba529fb54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 24 May 2018 18:03:31 -0700 Subject: [PATCH] Cleanup. --- src/renderer_d3d11.cpp | 4 ++-- src/renderer_d3d12.cpp | 16 +++++++++------- src/renderer_d3d9.cpp | 20 +++++++++++--------- src/renderer_gl.cpp | 6 ++++-- src/renderer_mtl.mm | 8 ++++++-- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index aad2a3547..ee514d1de 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -4392,7 +4392,7 @@ namespace bgfx { namespace d3d11 { uint32_t srcpitch = mip.m_width*bpp/8; uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, mip.m_width*mip.m_height*bpp/8); - bimg::imageDecodeToBgra8(temp, mip.m_data, mip.m_width, mip.m_height, srcpitch, mip.m_format); + bimg::imageDecodeToBgra8(g_allocator, temp, mip.m_data, mip.m_width, mip.m_height, srcpitch, mip.m_format); srd[kk].pSysMem = temp; srd[kk].SysMemPitch = srcpitch; @@ -4713,7 +4713,7 @@ namespace bgfx { namespace d3d11 if (convert) { temp = (uint8_t*)BX_ALLOC(g_allocator, slicepitch); - bimg::imageDecodeToBgra8(temp, data, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) ); + bimg::imageDecodeToBgra8(g_allocator, temp, data, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) ); data = temp; } diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index a96c6ce4f..c8a3c5fc3 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -4495,13 +4495,15 @@ namespace bgfx { namespace d3d12 const uint32_t size = slice*depth; uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, size); - bimg::imageDecodeToBgra8(temp - , mip.m_data - , mip.m_width - , mip.m_height - , pitch - , mip.m_format - ); + bimg::imageDecodeToBgra8( + g_allocator + , temp + , mip.m_data + , mip.m_width + , mip.m_height + , pitch + , mip.m_format + ); srd[kk].pData = temp; srd[kk].RowPitch = pitch; diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 6ec431339..59b9409a4 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -2978,13 +2978,15 @@ namespace bgfx { namespace d3d9 uint32_t srcpitch = mipWidth*bpp/8; uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, srcpitch*mipHeight); - bimg::imageDecodeToBgra8(temp - , mip.m_data - , mip.m_width - , mip.m_height - , srcpitch - , mip.m_format - ); + bimg::imageDecodeToBgra8( + g_allocator + , temp + , mip.m_data + , mip.m_width + , mip.m_height + , srcpitch + , mip.m_format + ); bx::memCopy(bits, temp, pitch, height, srcpitch, pitch); @@ -2992,7 +2994,7 @@ namespace bgfx { namespace d3d9 } else { - bimg::imageDecodeToBgra8(bits, mip.m_data, mip.m_width, mip.m_height, pitch, mip.m_format); + bimg::imageDecodeToBgra8(g_allocator, bits, mip.m_data, mip.m_width, mip.m_height, pitch, mip.m_format); } } else @@ -3051,7 +3053,7 @@ namespace bgfx { namespace d3d9 if (convert) { temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height); - bimg::imageDecodeToBgra8(temp, data, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) ); + bimg::imageDecodeToBgra8(g_allocator, temp, data, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) ); data = temp; } diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 0e40330cd..1dfea44d7 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -5151,7 +5151,9 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) ); if (convert) { - imageDecodeToRgba8(temp + imageDecodeToRgba8( + g_allocator + , temp , mip.m_data , mip.m_width , mip.m_height @@ -5320,7 +5322,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) ); if (convert) { - bimg::imageDecodeToRgba8(temp, data, width, height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) ); + bimg::imageDecodeToRgba8(g_allocator, temp, data, width, height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) ); data = temp; srcpitch = rectpitch; } diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index 4b1ffb3aa..d4acba735 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -2707,7 +2707,9 @@ namespace bgfx { namespace mtl if (convert) { - bimg::imageDecodeToBgra8(temp + bimg::imageDecodeToBgra8( + g_allocator + , temp , mip.m_data , mip.m_width , mip.m_height @@ -2780,7 +2782,9 @@ namespace bgfx { namespace mtl if (convert) { temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height); - bimg::imageDecodeToBgra8(temp + bimg::imageDecodeToBgra8( + g_allocator + , temp , data , _rect.m_width , _rect.m_height