Commit d90b214f by Geoff Lang Committed by Commit Bot

D3D11: If an image is dirty, copy it to the storage before copying from a FB.

If a storage already existed, it may have old data in it. Check if the image is dirty and copy the initialized memory into the storage before copying data from the framebuffer. TEST=conformance/textures/misc/copy-tex-image-and-sub-image-2d BUG=angleproject:1815 Change-Id: Ic69c5519b2e09e4b62025b1bf413d2a71a4a2afb Reviewed-on: https://chromium-review.googlesource.com/568410Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent d7ceaa16
...@@ -917,7 +917,7 @@ gl::Error TextureD3D_2D::copyImage(const gl::Context *context, ...@@ -917,7 +917,7 @@ gl::Error TextureD3D_2D::copyImage(const gl::Context *context,
else else
{ {
ANGLE_TRY(ensureRenderTarget(context)); ANGLE_TRY(ensureRenderTarget(context));
mImageArray[level]->markClean(); ANGLE_TRY(updateStorageLevel(context, level));
if (sourceArea.width != 0 && sourceArea.height != 0 && isValidLevel(level)) if (sourceArea.width != 0 && sourceArea.height != 0 && isValidLevel(level))
{ {
...@@ -1647,7 +1647,7 @@ gl::Error TextureD3D_Cube::copyImage(const gl::Context *context, ...@@ -1647,7 +1647,7 @@ gl::Error TextureD3D_Cube::copyImage(const gl::Context *context,
else else
{ {
ANGLE_TRY(ensureRenderTarget(context)); ANGLE_TRY(ensureRenderTarget(context));
mImageArray[faceIndex][level]->markClean(); ANGLE_TRY(updateStorageFaceLevel(context, faceIndex, level));
ASSERT(size.width == size.height); ASSERT(size.width == size.height);
...@@ -2976,6 +2976,7 @@ gl::Error TextureD3D_2DArray::copySubImage(const gl::Context *context, ...@@ -2976,6 +2976,7 @@ gl::Error TextureD3D_2DArray::copySubImage(const gl::Context *context,
else else
{ {
ANGLE_TRY(ensureRenderTarget(context)); ANGLE_TRY(ensureRenderTarget(context));
ANGLE_TRY(updateStorageLevel(context, level));
if (isValidLevel(level)) if (isValidLevel(level))
{ {
......
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