mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 00:47:13 +00:00
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:
committed by
Commit Bot service account
parent
041aca1620
commit
d3d3aa03e1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user