Add the proper data offset in Image11::copy, for the slow pixel copy method.

TRAC #22586 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1921 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 2c53e478
...@@ -349,8 +349,12 @@ void Image11::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width ...@@ -349,8 +349,12 @@ void Image11::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width
D3D11_MAPPED_SUBRESOURCE mappedImage; D3D11_MAPPED_SUBRESOURCE mappedImage;
HRESULT result = map(&mappedImage); HRESULT result = map(&mappedImage);
// determine the offset coordinate into the destination buffer
GLsizei rowOffset = gl::ComputePixelSize(mActualFormat) * xoffset;
void *dataOffset = static_cast<unsigned char*>(mappedImage.pData) + mappedImage.RowPitch * yoffset + rowOffset;
mRenderer->readPixels(source, x, y, width, height, gl::ExtractFormat(mInternalFormat), mRenderer->readPixels(source, x, y, width, height, gl::ExtractFormat(mInternalFormat),
gl::ExtractType(mInternalFormat), mappedImage.RowPitch, false, 4, mappedImage.pData); gl::ExtractType(mInternalFormat), mappedImage.RowPitch, false, 4, dataOffset);
unmap(); unmap();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment