Implement buffer lazy initialization before CopyBufferToTexture()

This patch adds the check and implementations of buffer lazy
initialization before CopyBufferToTexture().

The support of buffer lazy initialization before CopyTextureToBuffer()
is much more complicated than what we do for CopyBufferToTexture(), so
we decide to put it in another CL instead of writing them together with
CopyBufferToTexture().

BUG=dawn:414
TEST=dawn_end2end_tests

Change-Id: I45fdcdde2c9a0dafff23623815fc35c877990ef1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25140
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Jiawei Shao
2020-07-20 02:08:59 +00:00
committed by Commit Bot service account
parent 1233b66c90
commit d0dd661f18
5 changed files with 89 additions and 0 deletions

View File

@@ -518,6 +518,8 @@ namespace dawn_native { namespace opengl {
GLenum target = texture->GetGLTarget();
const GLFormat& format = texture->GetGLFormat();
buffer->EnsureDataInitialized();
ASSERT(texture->GetDimension() == wgpu::TextureDimension::e2D);
SubresourceRange subresources = {dst.mipLevel, 1, dst.origin.z,
copy->copySize.depth};