Change rowsPerImage units from texels to blocks

Spec change: https://github.com/gpuweb/gpuweb/pull/958

Bug: dawn:520
Change-Id: I05c4792a2832d12cd68877f2b1b99cdf9ef26925
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29981
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Kai Ninomiya
2020-10-12 23:13:53 +00:00
committed by Commit Bot service account
parent 51af1b428f
commit d1bca09f4a
17 changed files with 115 additions and 161 deletions

View File

@@ -534,7 +534,8 @@ namespace dawn_native { namespace opengl {
const TexelBlockInfo& blockInfo = formatInfo.GetTexelBlockInfo(dst.aspect);
gl.PixelStorei(GL_UNPACK_ROW_LENGTH, src.bytesPerRow / blockInfo.blockByteSize *
blockInfo.blockWidth);
gl.PixelStorei(GL_UNPACK_IMAGE_HEIGHT, src.rowsPerImage);
gl.PixelStorei(GL_UNPACK_IMAGE_HEIGHT,
src.rowsPerImage * blockInfo.blockHeight);
if (formatInfo.isCompressed) {
gl.PixelStorei(GL_UNPACK_COMPRESSED_BLOCK_SIZE, blockInfo.blockByteSize);
@@ -626,7 +627,7 @@ namespace dawn_native { namespace opengl {
const TexelBlockInfo& blockInfo = formatInfo.GetTexelBlockInfo(src.aspect);
gl.BindBuffer(GL_PIXEL_PACK_BUFFER, buffer->GetHandle());
gl.PixelStorei(GL_PACK_IMAGE_HEIGHT, dst.rowsPerImage);
gl.PixelStorei(GL_PACK_IMAGE_HEIGHT, dst.rowsPerImage * blockInfo.blockHeight);
gl.PixelStorei(GL_PACK_ROW_LENGTH, dst.bytesPerRow / blockInfo.blockByteSize);
GLenum glAttachment;