Hi all,
I want to copy just 1 mipmap level of a texture and I am doing like this:
void CopyTextureRegion(
&CD3DX12_TEXTURE_COPY_LOCATION(pDstData, mipmapIndex),
0, 0, 0,
&CD3DX12_TEXTURE_COPY_LOCATION(pSrcData, pLayout),
nullptr
);
- pDstData : is DEFAULT_HEAP, pSrcData is UPLOAD_HEAP(buffer size was get by GetCopyableFootprints from pDstData with highest miplevel), pLayout is D3D12_PLACED_SUBRESOURCE_FOOTPRINT
- I think the mipmapIndex will point the exact location data of Dest texture, but does it know where to get data location from Src texture because pLayout just contain info of this mipmap(Offset and Footprint). (???)
- pLayout has a member name Offset, and I try to modify it but it(Offset) need 512 Alignment but real offset in Src texture does not.
So what I need to do to match the location of mip texture in Src Texture ?