internal/graphicsdriver/directx: bug fix: getting pixels with non-zero position might not work

This commit is contained in:
Hajime Hoshi 2023-02-25 02:06:03 +09:00
parent 2664a2ac50
commit f58d7e1ab5

View File

@ -1438,12 +1438,12 @@ func (i *Image) ReadPixels(buf []byte, x, y, width, height int) error {
} }
i.graphics.needFlushCopyCommandList = true i.graphics.needFlushCopyCommandList = true
i.graphics.copyCommandList.CopyTextureRegion_PlacedFootPrint_SubresourceIndex( i.graphics.copyCommandList.CopyTextureRegion_PlacedFootPrint_SubresourceIndex(
&dst, uint32(x), uint32(y), 0, &src, &_D3D12_BOX{ &dst, 0, 0, 0, &src, &_D3D12_BOX{
left: 0, left: uint32(x),
top: 0, top: uint32(y),
front: 0, front: 0,
right: uint32(width), right: uint32(x + width),
bottom: uint32(height), bottom: uint32(y + height),
back: 1, back: 1,
}) })