MCPcopy Create free account
hub / github.com/carbonengine/trinity / MemcpySubresource

Function MemcpySubresource

trinityal/dx12/Utilities.cpp:1395–1413  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Row-by-row memcpy

Source from the content-addressed store, hash-verified

1393//------------------------------------------------------------------------------------------------
1394// Row-by-row memcpy
1395void MemcpySubresource(
1396 _In_ const D3D12_MEMCPY_DEST* pDest,
1397 _In_ const D3D12_SUBRESOURCE_DATA* pSrc,
1398 SIZE_T RowSizeInBytes,
1399 UINT NumRows,
1400 UINT NumSlices )
1401{
1402 for( UINT z = 0; z < NumSlices; ++z )
1403 {
1404 BYTE* pDestSlice = reinterpret_cast<BYTE*>( pDest->pData ) + pDest->SlicePitch * z;
1405 const BYTE* pSrcSlice = reinterpret_cast<const BYTE*>( pSrc->pData ) + pSrc->SlicePitch * z;
1406 for( UINT y = 0; y < NumRows; ++y )
1407 {
1408 memcpy( pDestSlice + pDest->RowPitch * y,
1409 pSrcSlice + pSrc->RowPitch * y,
1410 RowSizeInBytes );
1411 }
1412 }
1413}
1414
1415//------------------------------------------------------------------------------------------------
1416// All arrays must be populated (e.g. by calling GetCopyableFootprints)

Callers 1

UpdateSubresourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected