Fixed imageSwizzleBgra8.

This commit is contained in:
Branimir Karadžić 2017-09-19 20:18:25 -07:00
parent 3e1b9c52eb
commit c0819a5a64
4 changed files with 18 additions and 17 deletions

View File

@ -2075,10 +2075,11 @@ BX_PRAGMA_DIAGNOSTIC_POP();
DX_CHECK(m_deviceCtx->Map(texture, 0, D3D11_MAP_READ, 0, &mapped) );
bimg::imageSwizzleBgra8(
mapped.pData
, mapped.RowPitch
, backBufferDesc.Width
, backBufferDesc.Height
, mapped.RowPitch
, mapped.pData
, mapped.RowPitch
);
g_callback->screenShot(_filePath
, backBufferDesc.Width
@ -3398,10 +3399,11 @@ BX_PRAGMA_DIAGNOSTIC_POP();
bimg::imageSwizzleBgra8(
mapped.pData
, mapped.RowPitch
, getBufferWidth()
, getBufferHeight()
, mapped.RowPitch
, mapped.pData
, mapped.RowPitch
);
g_callback->captureFrame(mapped.pData, getBufferHeight()*mapped.RowPitch);
@ -4558,11 +4560,6 @@ BX_PRAGMA_DIAGNOSTIC_POP();
srd[kk].SysMemPitch = mip.m_width*mip.m_bpp/8;
}
if (swizzle)
{
// imageSwizzleBgra8(temp, width, height, mip.m_width*4, data);
}
srd[kk].SysMemSlicePitch = mip.m_height*srd[kk].SysMemPitch;
++kk;
}

View File

@ -1655,15 +1655,16 @@ namespace bgfx { namespace d3d12
readback->Map(0, NULL, (void**)&data);
bimg::imageSwizzleBgra8(
data
, layout.Footprint.RowPitch
, width
, height
, (uint32_t)pitch
, data
, layout.Footprint.RowPitch
);
g_callback->screenShot(_filePath
, width
, height
, (uint32_t)pitch
, layout.Footprint.RowPitch
, data
, (uint32_t)total
, false
@ -4190,11 +4191,6 @@ data.NumQualityLevels = 0;
totalSize += slice;
}
if (swizzle)
{
// imageSwizzleBgra8(temp, width, height, mip.m_width*4, data);
}
srd[kk].SlicePitch = mip.m_height*srd[kk].RowPitch;
++kk;
}

View File

@ -2945,7 +2945,7 @@ namespace bgfx { namespace gl
if (GL_RGBA == m_readPixelsFmt)
{
bimg::imageSwizzleBgra8(data, width, height, width*4, data);
bimg::imageSwizzleBgra8(data, width*4, width, height, data, width*4);
}
g_callback->screenShot(_filePath
@ -3531,7 +3531,14 @@ namespace bgfx { namespace gl
if (GL_RGBA == m_readPixelsFmt)
{
bimg::imageSwizzleBgra8(m_capture, m_resolution.m_width, m_resolution.m_height, m_resolution.m_width*4, m_capture);
bimg::imageSwizzleBgra8(
m_capture
, m_resolution.m_width*4
, m_resolution.m_width
, m_resolution.m_height
, m_capture
, m_resolution.m_width*4
);
}
g_callback->captureFrame(m_capture, m_captureSize);

View File

@ -1286,10 +1286,11 @@ namespace bgfx { namespace mtl
{
bimg::imageSwizzleBgra8(
m_capture
, m_resolution.m_width*4
, m_resolution.m_width
, m_resolution.m_height
, m_resolution.m_width*4
, m_capture
, m_resolution.m_width*4
);
}