Implement Texture-to-Texture Copies

Implement texture-to-texture copies for D3D12, Vulkan, and Metal.
Includes end2end and unit tests.

Bug: dawn:18
Change-Id: Ib48453704599bee43a76af21e6164aa9b8db7075
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5620
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Brandon Jones
2019-03-26 11:06:23 +00:00
committed by Commit Bot service account
parent 041aca1620
commit d3d3aa03e1
13 changed files with 708 additions and 36 deletions

View File

@@ -443,6 +443,22 @@ namespace dawn_native { namespace opengl {
glDeleteFramebuffers(1, &readFBO);
} break;
case Command::CopyTextureToTexture: {
CopyTextureToTextureCmd* copy =
mCommands.NextCommand<CopyTextureToTextureCmd>();
auto& src = copy->source;
auto& dst = copy->destination;
auto& copySize = copy->copySize;
Texture* srcTexture = ToBackend(src.texture.Get());
Texture* dstTexture = ToBackend(dst.texture.Get());
glCopyImageSubData(srcTexture->GetHandle(), srcTexture->GetGLTarget(),
src.level, src.origin.x, src.origin.y, src.slice,
dstTexture->GetHandle(), dstTexture->GetGLTarget(),
dst.level, dst.origin.x, dst.origin.y, dst.slice,
copySize.width, copySize.height, 1);
} break;
default: { UNREACHABLE(); } break;
}
}