Commit 988f7170 by Cody Northrop Committed by Commit Bot

Vulkan: Base/max level fixes and cleanup

This CL cleans up references to base/max level bug and fixes one lingering issue regarding special handling of depth/z for arrayed surfaces. Bug: angleproject:3148 Bug: angleproject:3184 Bug: angleproject:3948 Bug: angleproject:3949 Bug: angleproject:3950 Test: dEQP-GLES3.functional.texture.mipmap.*base_level* Test: dEQP-GLES3.functional.texture.mipmap.*max_level* Test: Texture2DArrayTestES3.DrawWithLevelsOutsideRangeWithInconsistentDimensions Change-Id: Iad72005a111507c50b8be9726adc32285bbae52b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1832757Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent 755417dd
......@@ -1235,13 +1235,19 @@ angle::Result TextureVk::changeLevels(ContextVk *contextVk, GLuint baseLevel, GL
// vk level 0 previously aligned with whatever the base level was.
uint32_t srcLevelVK = level - previousBaseLevel;
// Adjust offset and depth based on our knowledge of image type here
gl::Box area(0, 0, 0, extents.width, extents.height, extents.depth);
if (gl::IsArrayTextureType(mState.getType()))
{
area.z = 0;
area.depth = 1;
}
// Now copy from the image to the staging buffer
VkBuffer stagingBufferHandle = VK_NULL_HANDLE;
VkDeviceSize stagingBufferOffset = 0;
ANGLE_TRY(copyImageDataToBuffer(
contextVk, srcLevelVK, 1, layer,
gl::Box(0, 0, 0, extents.width, extents.height, extents.depth),
&stagingBufferHandle, &stagingBufferOffset, nullptr));
ANGLE_TRY(copyImageDataToBuffer(contextVk, srcLevelVK, 1, layer, area,
&stagingBufferHandle, &stagingBufferOffset, nullptr));
// Stage an update to the new image that we will populate with existing mip levels
// We're providing the buffer handle and offset to use, since we *just* populated it
......@@ -1741,8 +1747,7 @@ angle::Result TextureVk::initImageViewImpl(ContextVk *contextVk,
VkImageAspectFlags aspectFlags,
gl::SwizzleState mappedSwizzle)
{
// TODO: Support non-zero base level for ES 3.0 by passing it to getNativeImageLevel.
// http://anglebug.com/3148
// TODO(cnorthrop): May be missing non-zero base level http://anglebug.com/3948
uint32_t baseLevel = getNativeImageLevel(0);
uint32_t baseLayer = getNativeImageLayer(0);
......
......@@ -650,15 +650,14 @@
// Stencil textures (some missing support for base level):
3683 VULKAN PIXEL2 : dEQP-GLES31.functional.stencil_texturing.format.* = FAIL
3683 VULKAN PIXEL2 : dEQP-GLES31.functional.stencil_texturing.misc.compare_mode_effect = FAIL
3148 VULKAN : dEQP-GLES31.functional.stencil_texturing.misc.base_level = SKIP
// Need to support non-color when staging image updates
3949 VULKAN : dEQP-GLES31.functional.stencil_texturing.misc.base_level = SKIP
// Multisampled textures:
3565 VULKAN : dEQP-GLES31.functional.texture.multisample.* = SKIP
3565 VULKAN : dEQP-GLES31.functional.state_query.texture*multisample.* = SKIP
// Base texture level:
3148 VULKAN : dEQP-GLES31.functional.texture.gather.*base_level* = SKIP
// Vulkan creates the image view with the same format as the texture.
3885 VULKAN : dEQP-GLES31.functional.image_load_store.*.format_reinterpret.* = FAIL
......
......@@ -570,8 +570,8 @@
2672 VULKAN : dEQP-GLES3.functional.draw.draw_elements_instanced.line_loop.* = SKIP
2672 VULKAN : dEQP-GLES3.functional.draw.random.* = SKIP
// Base/Max levels:
3148 VULKAN : dEQP-GLES3.functional.shaders.texture_functions.texturesize.* = SKIP
// textureSize querying from LOD > 0 is failing
3948 VULKAN : dEQP-GLES3.functional.shaders.texture_functions.texturesize.* = SKIP
// Misc unimplemented:
......
......@@ -3012,7 +3012,7 @@ TEST_P(ComputeShaderTest, ImageStoreMipmapSlice)
// TODO(xinghua.cao@intel.com): http://anglebug.com/3101
ANGLE_SKIP_TEST_IF(IsIntel() && IsLinux() && IsOpenGL());
// Non-zero-level render target attachments are not yet supported. http://anglebug.com/3148
// Non-zero-level render target attachments are not yet supported. http://anglebug.com/3184
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[2];
......
......@@ -667,7 +667,7 @@ TEST_P(MipmapTest, RenderOntoLevelZeroAfterGenerateMipmap)
TEST_P(MipmapTest, DefineValidExtraLevelAndUseItLater)
{
// TODO(cnorthrop): Enabled the group to cover texture base level, but this test
// needs some triage: http://anglebug.com/3148
// needs some triage: http://anglebug.com/3950
ANGLE_SKIP_TEST_IF(IsVulkan());
glBindTexture(GL_TEXTURE_2D, mTexture2D);
......@@ -945,7 +945,7 @@ TEST_P(MipmapTestES3, MipmapForDeepTextureArray)
TEST_P(MipmapTestES3, MipmapsForTexture3D)
{
// TODO(cnorthrop): Enabled the group to cover texture base level, but this test
// needs some triage: http://anglebug.com/3148
// needs some triage: http://anglebug.com/3950
ANGLE_SKIP_TEST_IF(IsVulkan());
int px = getWindowWidth() / 2;
......@@ -1192,7 +1192,7 @@ TEST_P(MipmapTestES3, GenerateMipmapBaseLevelOutOfRange)
// be clamped, so the call doesn't generate an error.
TEST_P(MipmapTestES3, GenerateMipmapBaseLevelOutOfRangeImmutableTexture)
{
// TODO(cnorthrop): Interacts with immutable texture supprt: http://anglebug.com/3148
// TODO(cnorthrop): Interacts with immutable texture supprt: http://anglebug.com/3950
ANGLE_SKIP_TEST_IF(IsVulkan());
glBindTexture(GL_TEXTURE_2D, mTexture);
......@@ -1226,7 +1226,7 @@ TEST_P(MipmapTestES3, BaseLevelTextureBug)
// Probably not Intel.
ANGLE_SKIP_TEST_IF(IsOSX() && (IsNVIDIA() || IsIntel()));
// TODO(cnorthrop): Figure out what's going on here: http://anglebug.com/3148
// TODO(cnorthrop): Figure out what's going on here: http://anglebug.com/3950
ANGLE_SKIP_TEST_IF(IsVulkan());
std::vector<GLColor> texDataRed(2u * 2u, GLColor::red);
......
......@@ -1970,7 +1970,7 @@ TEST_P(Texture2DTestES3, TextureImplPropogatesDirtyBits)
ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsOpenGL());
// D3D Debug device reports an error. http://anglebug.com/3501
ANGLE_SKIP_TEST_IF(IsWindows() && IsD3D11());
// TODO(cnorthrop): Needs triage on Vulkan backend. http://anglebug.com/3148
// TODO(cnorthrop): Needs triage on Vulkan backend. http://anglebug.com/3950
ANGLE_SKIP_TEST_IF(IsVulkan());
// The workaround in the GL backend required to trigger this bug generates driver warning
......@@ -2017,7 +2017,7 @@ TEST_P(Texture2DTestES3, FramebufferTextureChangingBaselevel)
// TODO(geofflang): Investigate on D3D11. http://anglebug.com/2291
ANGLE_SKIP_TEST_IF(IsD3D11());
// TODO(cnorthrop): Framebuffer level support. http://anglebug.com/3148
// TODO(cnorthrop): Framebuffer level support. http://anglebug.com/3184
ANGLE_SKIP_TEST_IF(IsVulkan());
setUpProgram();
......@@ -2306,9 +2306,6 @@ TEST_P(Texture2DArrayTestES3, DrawWithLevelsOutsideRangeWithInconsistentDimensio
// TODO(crbug.com/998505): Test failing on Android FYI Release (NVIDIA Shield TV)
ANGLE_SKIP_TEST_IF(IsNVIDIAShield());
// TODO(cnorthrop): Depth vs. array issue in VK backend. http://anglebug.com/3148
ANGLE_SKIP_TEST_IF(IsVulkan());
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_3D, m2DArrayTexture);
std::vector<GLColor> texDataRed(8u * 8u * 8u, GLColor::red);
......@@ -2680,7 +2677,7 @@ TEST_P(ShadowSamplerPlusSampler3DTestES3, ShadowSamplerPlusSampler3DDraw)
// samplerCubeShadow: TextureCube + SamplerComparisonState
TEST_P(SamplerTypeMixTestES3, SamplerTypeMixDraw)
{
// TODO(cnorthrop): Requires non-color staging buffer support. http://anglebug.com/3148
// TODO(cnorthrop): Requires non-color staging buffer support. http://anglebug.com/3949
ANGLE_SKIP_TEST_IF(IsVulkan());
glActiveTexture(GL_TEXTURE0);
......@@ -4782,7 +4779,7 @@ TEST_P(Texture2DTestES3, DepthTexturesWithMipmaps)
// Seems to fail on AMD D3D11. Possibly driver bug. http://anglebug.com/3342
ANGLE_SKIP_TEST_IF(IsAMD() && IsWindows() && IsD3D11());
// TODO(cnorthrop): Also failing on Vulkan/Windows/AMD. http://anglebug.com/3148
// TODO(cnorthrop): Also failing on Vulkan/Windows/AMD. http://anglebug.com/3950
ANGLE_SKIP_TEST_IF(IsAMD() && IsWindows() && IsVulkan());
const int size = getWindowWidth();
......@@ -5406,7 +5403,7 @@ TEST_P(Texture2DTestES3, GenerateMipmapAndBaseLevelLUMA)
// this led to not sampling your texture data when minification occurred.
TEST_P(Texture2DTestES3, MinificationWithSamplerNoMipmapping)
{
// TODO: Triage this failure on Vulkan: http://anglebug.com/3148
// TODO: Triage this failure on Vulkan: http://anglebug.com/3950
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kVS[] =
......
......@@ -1201,7 +1201,7 @@ TEST_P(VertexAttributeTest, DrawArraysWithBufferOffset)
// TODO(geofflang): Figure out why this is broken on AMD OpenGL
ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL());
// TODO(cnorthrop): Test this again on more recent drivers. http://anglebug.com/3148
// TODO(cnorthrop): Test this again on more recent drivers. http://anglebug.com/3951
ANGLE_SKIP_TEST_IF(IsLinux() && IsNVIDIA() && IsVulkan());
initBasicProgram();
......
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