Commit 6acfca3a by Cody Northrop Committed by Commit Bot

Vulkan: Handle texStorage when base level is set

In this scenario, we allow the texStorage call to fully populate the image, then let dirty bits change the vkImage to reflect the base level. Bug: angleproject:3948 Bug: angleproject:3949 Test: dEQP-GLES3.functional.shaders.texture_functions.texturesize.* Change-Id: I1f453653a23b9d1802a374def40c9372ada8822a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1841275 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent e94f4737
...@@ -1266,10 +1266,11 @@ angle::Result Texture::setStorage(Context *context, ...@@ -1266,10 +1266,11 @@ angle::Result Texture::setStorage(Context *context,
ANGLE_TRY(releaseTexImageInternal(context)); ANGLE_TRY(releaseTexImageInternal(context));
ANGLE_TRY(orphanImages(context)); ANGLE_TRY(orphanImages(context));
ANGLE_TRY(mTexture->setStorage(context, type, levels, internalFormat, size));
mState.mImmutableFormat = true; mState.mImmutableFormat = true;
mState.mImmutableLevels = static_cast<GLuint>(levels); mState.mImmutableLevels = static_cast<GLuint>(levels);
ANGLE_TRY(mTexture->setStorage(context, type, levels, internalFormat, size));
mState.clearImageDescs(); mState.clearImageDescs();
mState.setImageDescChain(0, static_cast<GLuint>(levels - 1), size, Format(internalFormat), mState.setImageDescChain(0, static_cast<GLuint>(levels - 1), size, Format(internalFormat),
InitState::MayNeedInit); InitState::MayNeedInit);
......
...@@ -1168,7 +1168,10 @@ angle::Result TextureVk::changeLevels(ContextVk *contextVk, GLuint baseLevel, GL ...@@ -1168,7 +1168,10 @@ angle::Result TextureVk::changeLevels(ContextVk *contextVk, GLuint baseLevel, GL
// Track the previous levels for use in update loop below // Track the previous levels for use in update loop below
uint32_t previousBaseLevel = mImage->getBaseLevel(); uint32_t previousBaseLevel = mImage->getBaseLevel();
if (baseLevel == previousBaseLevel && mImage->getLevelCount() == maxLevel + 1) bool baseLevelChanged = baseLevel != previousBaseLevel;
bool maxLevelChanged = (mImage->getLevelCount() + previousBaseLevel) != (maxLevel + 1);
if (!(baseLevelChanged || maxLevelChanged))
{ {
// This scenario is a noop, most likely maxLevel has been lowered to a level that already // This scenario is a noop, most likely maxLevel has been lowered to a level that already
// reflects the current state of the image // reflects the current state of the image
...@@ -1230,7 +1233,8 @@ angle::Result TextureVk::changeLevels(ContextVk *contextVk, GLuint baseLevel, GL ...@@ -1230,7 +1233,8 @@ angle::Result TextureVk::changeLevels(ContextVk *contextVk, GLuint baseLevel, GL
// We need to adjust the source Vulkan level to reflect the previous base level. // We need to adjust the source Vulkan level to reflect the previous base level.
// vk level 0 previously aligned with whatever the base level was. // vk level 0 previously aligned with whatever the base level was.
uint32_t srcLevelVK = level - previousBaseLevel; uint32_t srcLevelVK = baseLevelChanged ? level - previousBaseLevel : level;
ASSERT(srcLevelVK <= mImage->getLevelCount());
// Adjust offset and depth based on our knowledge of image type here // Adjust offset and depth based on our knowledge of image type here
gl::Box area(0, 0, 0, extents.width, extents.height, extents.depth); gl::Box area(0, 0, 0, extents.width, extents.height, extents.depth);
...@@ -1743,7 +1747,6 @@ angle::Result TextureVk::initImageViewImpl(ContextVk *contextVk, ...@@ -1743,7 +1747,6 @@ angle::Result TextureVk::initImageViewImpl(ContextVk *contextVk,
VkImageAspectFlags aspectFlags, VkImageAspectFlags aspectFlags,
gl::SwizzleState mappedSwizzle) gl::SwizzleState mappedSwizzle)
{ {
// TODO(cnorthrop): May be missing non-zero base level http://anglebug.com/3948
uint32_t baseLevel = getNativeImageLevel(0); uint32_t baseLevel = getNativeImageLevel(0);
uint32_t baseLayer = getNativeImageLayer(0); uint32_t baseLayer = getNativeImageLayer(0);
......
...@@ -568,8 +568,14 @@ ...@@ -568,8 +568,14 @@
2672 VULKAN : dEQP-GLES3.functional.draw.draw_elements_instanced.line_loop.* = SKIP 2672 VULKAN : dEQP-GLES3.functional.draw.draw_elements_instanced.line_loop.* = SKIP
2672 VULKAN : dEQP-GLES3.functional.draw.random.* = SKIP 2672 VULKAN : dEQP-GLES3.functional.draw.random.* = SKIP
// textureSize querying from LOD > 0 is failing // Texture staging buffer needs non-color support
3948 VULKAN : dEQP-GLES3.functional.shaders.texture_functions.texturesize.* = SKIP 3949 VULKAN : dEQP-GLES3.functional.shaders.texture_functions.texturesize.sampler2dshadow_vertex = SKIP
3949 VULKAN : dEQP-GLES3.functional.shaders.texture_functions.texturesize.sampler2dshadow_fragment = SKIP
3949 VULKAN : dEQP-GLES3.functional.shaders.texture_functions.texturesize.sampler2darrayshadow_vertex = SKIP
3949 VULKAN : dEQP-GLES3.functional.shaders.texture_functions.texturesize.sampler2darrayshadow_fragment = SKIP
3949 VULKAN : dEQP-GLES3.functional.shaders.texture_functions.texturesize.samplercubeshadow_vertex = SKIP
3949 VULKAN : dEQP-GLES3.functional.shaders.texture_functions.texturesize.samplercubeshadow_fragment = SKIP
// Misc unimplemented: // Misc unimplemented:
......
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