mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 15:46:28 +00:00
OpenGL: Use the correct size to lazy-clear mips
We would incorrectly use the size of the first mip level to clear non-zero mip levels. This was found while enabling debug output in the OpenGL backend. BUG=dawn:190 Change-Id: I29a87b87057d425d1c131d11afdc7ca4716607c8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9202 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
9dffe11696
commit
fefb3ab120
@@ -245,9 +245,10 @@ namespace dawn_native { namespace opengl {
|
||||
} else {
|
||||
auto formatInfo = GetGLFormatInfo(GetFormat().format);
|
||||
for (GLint level = baseMipLevel; level < baseMipLevel + levelCount; ++level) {
|
||||
gl.ClearTexSubImage(mHandle, level, 0, 0, baseArrayLayer, GetSize().width,
|
||||
GetSize().height, layerCount, formatInfo.format,
|
||||
formatInfo.type, nullptr);
|
||||
Extent3D mipSize = GetMipLevelPhysicalSize(level);
|
||||
gl.ClearTexSubImage(mHandle, level, 0, 0, baseArrayLayer, mipSize.width,
|
||||
mipSize.height, layerCount, formatInfo.format, formatInfo.type,
|
||||
nullptr);
|
||||
}
|
||||
}
|
||||
SetIsSubresourceContentInitialized(baseMipLevel, levelCount, baseArrayLayer, layerCount);
|
||||
|
||||
Reference in New Issue
Block a user