Commit 2d5c8d31 by Cody Northrop Committed by Commit Bot

Vulkan: Fix off by one when flushing staged texture updates

When updating ImageHelper::flushStagedUpdates to handle base and max texture level, we got off by one when deciding if an update landed in in the range of the current vkImage. When there are 8 mipLevels and we see an update for level 8, that should not be applied, and should be preserved in updatesToKeep. Bug: angleproject:3950 Test: MipmapTest.DefineValidExtraLevelAndUseItLater/ES2_Vulkan Change-Id: I63e0c24f7885f8b0580ce212b531711aebcf0e01 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1848933Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent d0cf5579
......@@ -2635,7 +2635,7 @@ angle::Result ImageHelper::flushStagedUpdates(ContextVk *contextVk,
// If the update level is not within the requested range, skip the update.
const bool isUpdateLevelOutsideRange =
updateMipLevel < (levelStart + mBaseLevel) ||
(updateMipLevel > (levelEnd + mBaseLevel) || updateMipLevel > mMaxLevel);
(updateMipLevel >= (levelEnd + mBaseLevel) || updateMipLevel > mMaxLevel);
// If the update layers don't intersect the requested layers, skip the update.
const bool areUpdateLayersOutsideRange =
......
......@@ -666,10 +666,6 @@ TEST_P(MipmapTest, RenderOntoLevelZeroAfterGenerateMipmap)
// already uploaded before. The test expects that mip to be usable.
TEST_P(MipmapTest, DefineValidExtraLevelAndUseItLater)
{
// TODO(cnorthrop): Enabled the group to cover texture base level, but this test
// needs some triage: http://anglebug.com/3950
ANGLE_SKIP_TEST_IF(IsVulkan());
glBindTexture(GL_TEXTURE_2D, mTexture2D);
GLubyte *levels[] = {mLevelZeroBlueInitData.data(), mLevelOneGreenInitData.data(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment