From 20e9af580653f64d96bad1675edfd5eb1b5382df Mon Sep 17 00:00:00 2001 From: Pawel Ksiezopolski Date: Tue, 19 Nov 2019 15:36:15 +0100 Subject: [PATCH] Add coverage for stencil image sampling Add tests for sampling using nearest filter from following stencil image formats: VK_FORMAT_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_D32_SFLOAT_S8_UINT. New tests: dEQP-VK.texture.filtering.2d.formats.s8_uint.nearest dEQP-VK.texture.filtering.2d.formats.d24_unorm_s8_uint_stencil.nearest dEQP-VK.texture.filtering.2d.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.unnormal.formats.s8_uint.nearest dEQP-VK.texture.filtering.unnormal.formats.d24_unorm_s8_uint_stencil.nearest dEQP-VK.texture.filtering.unnormal.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.cube.formats.s8_uint.nearest dEQP-VK.texture.filtering.cube.formats.d24_unorm_s8_uint_stencil.nearest dEQP-VK.texture.filtering.cube.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.2d_array.formats.s8_uint.s8_uint_nearest dEQP-VK.texture.filtering.2d_array.formats.d24_unorm_s8_uint_stencil.d24_unorm_s8_uint_stencil_nearest dEQP-VK.texture.filtering.2d_array.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_uint_stencil_nearest dEQP-VK.texture.filtering.3d.formats.s8_uint.s8_uint_nearest dEQP-VK.texture.filtering.3d.formats.d24_unorm_s8_uint_stencil.d24_unorm_s8_uint_stencil_nearest dEQP-VK.texture.filtering.3d.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_uint_stencil_nearest Components: Vulkan VK-GL-CTS issue: 2048 Change-Id: I43f28e6ec4eee5c04e444c9cded1c0a15b3d5e4c --- android/cts/master/vk-master.txt | 15 ++ .../vulkan/pipeline/vktPipelineImageUtil.cpp | 2 +- .../texture/vktTextureCompressedFormatTests.cpp | 3 +- .../texture/vktTextureFilteringAnisotropyTests.cpp | 2 +- .../vulkan/texture/vktTextureFilteringTests.cpp | 241 +++++++++++++++------ .../vulkan/texture/vktTextureMipmapTests.cpp | 52 +++-- .../vulkan/texture/vktTextureShadowTests.cpp | 6 +- .../vulkan/texture/vktTextureSwizzleTests.cpp | 4 +- .../modules/vulkan/texture/vktTextureTestUtil.cpp | 30 ++- .../modules/vulkan/texture/vktTextureTestUtil.hpp | 11 +- .../mustpass/master/vk-default-no-waivers.txt | 15 ++ external/vulkancts/mustpass/master/vk-default.txt | 15 ++ 12 files changed, 293 insertions(+), 103 deletions(-) diff --git a/android/cts/master/vk-master.txt b/android/cts/master/vk-master.txt index 23516f6..8835756 100644 --- a/android/cts/master/vk-master.txt +++ b/android/cts/master/vk-master.txt @@ -478396,6 +478396,9 @@ dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.nearest_mipmap_nearest dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.linear_mipmap_nearest dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.nearest_mipmap_linear dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.linear_mipmap_linear +dEQP-VK.texture.filtering.2d.formats.s8_uint.nearest +dEQP-VK.texture.filtering.2d.formats.d24_unorm_s8_uint_stencil.nearest +dEQP-VK.texture.filtering.2d.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.2d.sizes.4x8.nearest dEQP-VK.texture.filtering.2d.sizes.4x8.linear dEQP-VK.texture.filtering.2d.sizes.4x8.nearest_mipmap_nearest @@ -478752,6 +478755,9 @@ dEQP-VK.texture.filtering.unnormal.formats.a8b8g8r8_srgb.nearest dEQP-VK.texture.filtering.unnormal.formats.a8b8g8r8_srgb.linear dEQP-VK.texture.filtering.unnormal.formats.a1r5g5b5_unorm.nearest dEQP-VK.texture.filtering.unnormal.formats.a1r5g5b5_unorm.linear +dEQP-VK.texture.filtering.unnormal.formats.s8_uint.nearest +dEQP-VK.texture.filtering.unnormal.formats.d24_unorm_s8_uint_stencil.nearest +dEQP-VK.texture.filtering.unnormal.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.unnormal.sizes.4x8.nearest dEQP-VK.texture.filtering.unnormal.sizes.4x8.linear dEQP-VK.texture.filtering.unnormal.sizes.32x64.nearest @@ -478824,6 +478830,9 @@ dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.nearest_mipmap_nearest dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.linear_mipmap_nearest dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.nearest_mipmap_linear dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.linear_mipmap_linear +dEQP-VK.texture.filtering.cube.formats.s8_uint.nearest +dEQP-VK.texture.filtering.cube.formats.d24_unorm_s8_uint_stencil.nearest +dEQP-VK.texture.filtering.cube.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.cube.sizes.8x8.nearest dEQP-VK.texture.filtering.cube.sizes.8x8.linear dEQP-VK.texture.filtering.cube.sizes.8x8.nearest_mipmap_nearest @@ -479216,6 +479225,9 @@ dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_nearest dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest_mipmap_linear dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_linear +dEQP-VK.texture.filtering.2d_array.formats.s8_uint.s8_uint_nearest +dEQP-VK.texture.filtering.2d_array.formats.d24_unorm_s8_uint_stencil.d24_unorm_s8_uint_stencil_nearest +dEQP-VK.texture.filtering.2d_array.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_uint_stencil_nearest dEQP-VK.texture.filtering.2d_array.sizes.4x8x8.nearest dEQP-VK.texture.filtering.2d_array.sizes.4x8x8.linear dEQP-VK.texture.filtering.2d_array.sizes.4x8x8.nearest_mipmap_nearest @@ -479606,6 +479618,9 @@ dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest_mipma dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_nearest dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest_mipmap_linear dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_linear +dEQP-VK.texture.filtering.3d.formats.s8_uint.s8_uint_nearest +dEQP-VK.texture.filtering.3d.formats.d24_unorm_s8_uint_stencil.d24_unorm_s8_uint_stencil_nearest +dEQP-VK.texture.filtering.3d.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_uint_stencil_nearest dEQP-VK.texture.filtering.3d.sizes.4x8x8.nearest dEQP-VK.texture.filtering.3d.sizes.4x8x8.linear dEQP-VK.texture.filtering.3d.sizes.4x8x8.nearest_mipmap_nearest diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp index 6652b4d..34c6eb4 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp @@ -1179,7 +1179,7 @@ de::MovePtr TestTexture2D::copy(const tcu::TextureFormat format) co { DE_ASSERT(!isCompressed()); - de::MovePtr texture (new TestTexture2D(format, m_texture.getWidth(), m_texture.getHeight())); + de::MovePtr texture (new TestTexture2D(format, m_texture.getWidth(), m_texture.getHeight(), m_texture.getNumLevels())); copyToTexture(*texture); diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureCompressedFormatTests.cpp b/external/vulkancts/modules/vulkan/texture/vktTextureCompressedFormatTests.cpp index d0724c8..28fb0cd 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureCompressedFormatTests.cpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureCompressedFormatTests.cpp @@ -91,7 +91,7 @@ Compressed2DTestInstance::Compressed2DTestInstance (Context& context, , m_texture (TestTexture2DSp(new pipeline::TestTexture2D(m_compressedFormat, testParameters.width, testParameters.height))) , m_renderer (context, testParameters.sampleCount, testParameters.width, testParameters.height) { - m_renderer.add2DTexture(m_texture, testParameters.backingMode); + m_renderer.add2DTexture(m_texture, testParameters.aspectMask, testParameters.backingMode); } tcu::TestStatus Compressed2DTestInstance::iterate (void) @@ -262,6 +262,7 @@ void populateTextureCompressedFormatTests (tcu::TestCaseGroup* compressedTexture testParameters.height = sizes[sizeNdx].height; testParameters.minFilter = tcu::Sampler::NEAREST; testParameters.magFilter = tcu::Sampler::NEAREST; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_FLOAT); compressedTextureTests->addChild(new TextureTestCase(testCtx, (nameBase + "_2d_" + sizes[sizeNdx].name + backingModes[backingNdx].name).c_str(), (formatStr + ", TEXTURETYPE_2D").c_str(), testParameters)); diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureFilteringAnisotropyTests.cpp b/external/vulkancts/modules/vulkan/texture/vktTextureFilteringAnisotropyTests.cpp index aa31693..c9582b0 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureFilteringAnisotropyTests.cpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureFilteringAnisotropyTests.cpp @@ -113,7 +113,7 @@ public: } renderer.setViewport(0.0f, 0.0f, static_cast(ANISOTROPY_TEST_RESOLUTION), static_cast(ANISOTROPY_TEST_RESOLUTION)); - renderer.add2DTexture(texture); + renderer.add2DTexture(texture, VK_IMAGE_ASPECT_COLOR_BIT); { Surface renderedFrame (ANISOTROPY_TEST_RESOLUTION, ANISOTROPY_TEST_RESOLUTION); diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureFilteringTests.cpp b/external/vulkancts/modules/vulkan/texture/vktTextureFilteringTests.cpp index 7c24146..e0d0c38 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureFilteringTests.cpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureFilteringTests.cpp @@ -115,14 +115,24 @@ Texture2DFilteringTestInstance::Texture2DFilteringTestInstance (Context& context { const bool mipmaps = m_testParameters.mipmaps; const int numLevels = mipmaps ? deLog2Floor32(de::max(m_testParameters.width, m_testParameters.height))+1 : 1; - const tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(vk::mapVkFormat(m_testParameters.format)); - const tcu::Vec4 cBias = fmtInfo.valueMin; - const tcu::Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin; + const tcu::TextureFormat texFormat = vk::mapVkFormat(m_testParameters.format); + const tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(texFormat); + tcu::Vec4 cBias, cScale; + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + { + const tcu::TextureFormat texFormatStencil = vk::mapVkFormat(VK_FORMAT_S8_UINT); + const tcu::TextureFormatInfo fmtInfoStencil = tcu::getTextureFormatInfo(texFormatStencil); + cBias = fmtInfoStencil.valueMin; + cScale = fmtInfoStencil.valueMax - fmtInfoStencil.valueMin; + } + else + { + cBias = fmtInfo.valueMin; + cScale = fmtInfo.valueMax - fmtInfo.valueMin; + } - if ((testParameters.wrapS == Sampler::MIRRORED_ONCE || - testParameters.wrapT == Sampler::MIRRORED_ONCE) && - !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_sampler_mirror_clamp_to_edge")) - TCU_THROW(NotSupportedError, "VK_KHR_sampler_mirror_clamp_to_edge not supported"); + if (testParameters.wrapS == Sampler::MIRRORED_ONCE || testParameters.wrapT == Sampler::MIRRORED_ONCE) + context.requireDeviceFunctionality("VK_KHR_sampler_mirror_clamp_to_edge"); // Create 2 textures. m_textures.reserve(2); @@ -138,7 +148,10 @@ Texture2DFilteringTestInstance::Texture2DFilteringTestInstance (Context& context const tcu::Vec4 gMin = tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f)*cScale + cBias; const tcu::Vec4 gMax = tcu::Vec4(1.0f, 1.0f, 1.0f, 0.0f)*cScale + cBias; - tcu::fillWithComponentGradients(m_textures[0]->getLevel(levelNdx, 0), gMin, gMax); + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + tcu::fillWithComponentGradients(getEffectiveDepthStencilAccess(m_textures[0]->getLevel(levelNdx, 0), tcu::Sampler::MODE_STENCIL), gMin, gMax); + else + tcu::fillWithComponentGradients(m_textures[0]->getLevel(levelNdx, 0), gMin, gMax); } // Fill second with grid texture. @@ -149,13 +162,16 @@ Texture2DFilteringTestInstance::Texture2DFilteringTestInstance (Context& context const deUint32 colorA = 0xff000000 | rgb; const deUint32 colorB = 0xff000000 | ~rgb; - tcu::fillWithGrid(m_textures[1]->getLevel(levelNdx, 0), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + tcu::fillWithGrid(getEffectiveDepthStencilAccess(m_textures[1]->getLevel(levelNdx, 0), tcu::Sampler::MODE_STENCIL), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); + else + tcu::fillWithGrid(m_textures[1]->getLevel(levelNdx, 0), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); } // Upload. for (vector::iterator i = m_textures.begin(); i != m_textures.end(); i++) { - m_renderer.add2DTexture(*i); + m_renderer.add2DTexture(*i, testParameters.aspectMask); } // Compute cases. @@ -209,8 +225,13 @@ tcu::TestStatus Texture2DFilteringTestInstance::iterate (void) // Setup params for reference. refParams.sampler = util::createSampler(m_testParameters.wrapS, m_testParameters.wrapT, m_testParameters.minFilter, m_testParameters.magFilter, !m_testParameters.unnormal); - refParams.samplerType = getSamplerType(texFmt); - refParams.lodMode = LODMODE_EXACT; + if (texFmt.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + { + refParams.sampler.depthStencilMode = tcu::Sampler::MODE_STENCIL; + refParams.samplerType = SAMPLERTYPE_UINT; + } + else + refParams.samplerType = getSamplerType(texFmt); refParams.colorBias = fmtInfo.lookupBias; refParams.colorScale = fmtInfo.lookupScale; refParams.unnormal = m_testParameters.unnormal; @@ -314,14 +335,24 @@ TextureCubeFilteringTestInstance::TextureCubeFilteringTestInstance (Context& con , m_caseNdx (0) { const int numLevels = deLog2Floor32(m_testParameters.size)+1; - const tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(vk::mapVkFormat(m_testParameters.format)); - const tcu::Vec4 cBias = fmtInfo.valueMin; - const tcu::Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin; + const tcu::TextureFormat texFormat = vk::mapVkFormat(m_testParameters.format); + const tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(texFormat); + tcu::Vec4 cBias, cScale; + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + { + const tcu::TextureFormat texFormatStencil = vk::mapVkFormat(VK_FORMAT_S8_UINT); + const tcu::TextureFormatInfo fmtInfoStencil = tcu::getTextureFormatInfo(texFormatStencil); + cBias = fmtInfoStencil.valueMin; + cScale = fmtInfoStencil.valueMax - fmtInfoStencil.valueMin; + } + else + { + cBias = fmtInfo.valueMin; + cScale = fmtInfo.valueMax - fmtInfo.valueMin; + } - if ((testParameters.wrapS == Sampler::MIRRORED_ONCE || - testParameters.wrapT == Sampler::MIRRORED_ONCE) && - !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_sampler_mirror_clamp_to_edge")) - TCU_THROW(NotSupportedError, "VK_KHR_sampler_mirror_clamp_to_edge not supported"); + if (testParameters.wrapS == Sampler::MIRRORED_ONCE || testParameters.wrapT == Sampler::MIRRORED_ONCE) + context.requireDeviceFunctionality("VK_KHR_sampler_mirror_clamp_to_edge"); m_textures.reserve(2); for (int ndx = 0; ndx < 2; ndx++) @@ -342,7 +373,10 @@ TextureCubeFilteringTestInstance::TextureCubeFilteringTestInstance (Context& con { for (int levelNdx = 0; levelNdx < numLevels; levelNdx++) { - tcu::fillWithComponentGradients(m_textures[0]->getLevel(levelNdx, face), gradients[face][0]*cScale + cBias, gradients[face][1]*cScale + cBias); + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + tcu::fillWithComponentGradients(getEffectiveDepthStencilAccess(m_textures[0]->getLevel(levelNdx, face), tcu::Sampler::MODE_STENCIL), gradients[face][0] * cScale + cBias, gradients[face][1] * cScale + cBias); + else + tcu::fillWithComponentGradients(m_textures[0]->getLevel(levelNdx, face), gradients[face][0] * cScale + cBias, gradients[face][1] * cScale + cBias); } } @@ -357,13 +391,18 @@ TextureCubeFilteringTestInstance::TextureCubeFilteringTestInstance (Context& con const deUint32 colorB = 0xff000000 | ~rgb; tcu::fillWithGrid(m_textures[1]->getLevel(levelNdx, face), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); + + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + tcu::fillWithGrid(getEffectiveDepthStencilAccess(m_textures[1]->getLevel(levelNdx, face), tcu::Sampler::MODE_STENCIL), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); + else + tcu::fillWithGrid(m_textures[1]->getLevel(levelNdx, face), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); } } // Upload. for (vector::iterator i = m_textures.begin(); i != m_textures.end(); i++) { - m_renderer.addCubeTexture(*i); + m_renderer.addCubeTexture(*i, testParameters.aspectMask); } // Compute cases @@ -421,8 +460,14 @@ tcu::TestStatus TextureCubeFilteringTestInstance::iterate (void) // Params for reference computation. refParams.sampler = util::createSampler(Sampler::CLAMP_TO_EDGE, Sampler::CLAMP_TO_EDGE, m_testParameters.minFilter, m_testParameters.magFilter); + if (texFmt.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + { + refParams.sampler.depthStencilMode = tcu::Sampler::MODE_STENCIL; + refParams.samplerType = SAMPLERTYPE_UINT; + } + else + refParams.samplerType = getSamplerType(texFmt); refParams.sampler.seamlessCubeMap = true; - refParams.samplerType = getSamplerType(texFmt); refParams.lodMode = LODMODE_EXACT; refParams.colorBias = fmtInfo.lookupBias; refParams.colorScale = fmtInfo.lookupScale; @@ -535,15 +580,25 @@ Texture2DArrayFilteringTestInstance::Texture2DArrayFilteringTestInstance (Contex , m_renderer (context, testParameters.sampleCount, TEX3D_VIEWPORT_WIDTH, TEX3D_VIEWPORT_HEIGHT) , m_caseNdx (0) { - const tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(vk::mapVkFormat(m_testParameters.format)); - const tcu::Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin; - const tcu::Vec4 cBias = fmtInfo.valueMin; const int numLevels = deLog2Floor32(de::max(m_testParameters.width, m_testParameters.height)) + 1; + const tcu::TextureFormat texFormat = vk::mapVkFormat(m_testParameters.format); + const tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(texFormat); + tcu::Vec4 cBias, cScale; + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + { + const tcu::TextureFormat texFormatStencil = vk::mapVkFormat(VK_FORMAT_S8_UINT); + const tcu::TextureFormatInfo fmtInfoStencil = tcu::getTextureFormatInfo(texFormatStencil); + cBias = fmtInfoStencil.valueMin; + cScale = fmtInfoStencil.valueMax - fmtInfoStencil.valueMin; + } + else + { + cBias = fmtInfo.valueMin; + cScale = fmtInfo.valueMax - fmtInfo.valueMin; + } - if ((testParameters.wrapS == Sampler::MIRRORED_ONCE || - testParameters.wrapT == Sampler::MIRRORED_ONCE) && - !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_sampler_mirror_clamp_to_edge")) - TCU_THROW(NotSupportedError, "VK_KHR_sampler_mirror_clamp_to_edge not supported"); + if (testParameters.wrapS == Sampler::MIRRORED_ONCE || testParameters.wrapT == Sampler::MIRRORED_ONCE) + context.requireDeviceFunctionality("VK_KHR_sampler_mirror_clamp_to_edge"); // Create textures. m_textures.reserve(2); @@ -563,13 +618,14 @@ Texture2DArrayFilteringTestInstance::Texture2DArrayFilteringTestInstance (Contex { for (int layerNdx = 0; layerNdx < m_testParameters.numLayers; layerNdx++) { - const tcu::PixelBufferAccess levelBuf = m_textures[0]->getLevel(levelNdx, layerNdx); - const tcu::IVec4 swz = levelSwz[layerNdx%DE_LENGTH_OF_ARRAY(levelSwz)]; const tcu::Vec4 gMin = tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f).swizzle(swz[0],swz[1],swz[2],swz[3])*cScale + cBias; const tcu::Vec4 gMax = tcu::Vec4(1.0f, 1.0f, 1.0f, 0.0f).swizzle(swz[0],swz[1],swz[2],swz[3])*cScale + cBias; - tcu::fillWithComponentGradients(levelBuf, gMin, gMax); + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + tcu::fillWithComponentGradients(getEffectiveDepthStencilAccess(m_textures[0]->getLevel(levelNdx, layerNdx), tcu::Sampler::MODE_STENCIL), gMin, gMax); + else + tcu::fillWithComponentGradients(m_textures[0]->getLevel(levelNdx, layerNdx), gMin, gMax); } } @@ -578,21 +634,22 @@ Texture2DArrayFilteringTestInstance::Texture2DArrayFilteringTestInstance (Contex { for (int layerNdx = 0; layerNdx < m_testParameters.numLayers; layerNdx++) { - const tcu::PixelBufferAccess levelBuf = m_textures[1]->getLevel(levelNdx, layerNdx); - const deUint32 step = 0x00ffffff / (numLevels*m_testParameters.numLayers - 1); const deUint32 rgb = step * (levelNdx + layerNdx*numLevels); const deUint32 colorA = 0xff000000 | rgb; const deUint32 colorB = 0xff000000 | ~rgb; - tcu::fillWithGrid(levelBuf, 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + tcu::fillWithGrid(getEffectiveDepthStencilAccess(m_textures[1]->getLevel(levelNdx, layerNdx), tcu::Sampler::MODE_STENCIL), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); + else + tcu::fillWithGrid(m_textures[1]->getLevel(levelNdx, layerNdx), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); } } // Upload. for (vector::const_iterator i = m_textures.begin(); i != m_textures.end(); i++) { - m_renderer.add2DArrayTexture(*i); + m_renderer.add2DArrayTexture(*i, testParameters.aspectMask); } // Test cases @@ -622,7 +679,13 @@ tcu::TestStatus Texture2DArrayFilteringTestInstance::iterate (void) // Params for reference computation. refParams.sampler = util::createSampler(m_testParameters.wrapS, m_testParameters.wrapT, m_testParameters.minFilter, m_testParameters.magFilter); - refParams.samplerType = getSamplerType(texFmt); + if (texFmt.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + { + refParams.sampler.depthStencilMode = tcu::Sampler::MODE_STENCIL; + refParams.samplerType = SAMPLERTYPE_UINT; + } + else + refParams.samplerType = getSamplerType(texFmt); refParams.lodMode = LODMODE_EXACT; refParams.colorBias = fmtInfo.lookupBias; refParams.colorScale = fmtInfo.lookupScale; @@ -738,16 +801,25 @@ Texture3DFilteringTestInstance::Texture3DFilteringTestInstance (Context& context , m_renderer (context, testParameters.sampleCount, TEX3D_VIEWPORT_WIDTH, TEX3D_VIEWPORT_HEIGHT) , m_caseNdx (0) { - const tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(vk::mapVkFormat(m_testParameters.format)); - const tcu::Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin; - const tcu::Vec4 cBias = fmtInfo.valueMin; const int numLevels = deLog2Floor32(de::max(de::max(m_testParameters.width, m_testParameters.height), m_testParameters.depth)) + 1; + const tcu::TextureFormat texFormat = vk::mapVkFormat(m_testParameters.format); + const tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(texFormat); + tcu::Vec4 cBias, cScale; + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + { + const tcu::TextureFormat texFormatStencil = vk::mapVkFormat(VK_FORMAT_S8_UINT); + const tcu::TextureFormatInfo fmtInfoStencil = tcu::getTextureFormatInfo(texFormatStencil); + cBias = fmtInfoStencil.valueMin; + cScale = fmtInfoStencil.valueMax - fmtInfoStencil.valueMin; + } + else + { + cBias = fmtInfo.valueMin; + cScale = fmtInfo.valueMax - fmtInfo.valueMin; + } - if ((testParameters.wrapS == Sampler::MIRRORED_ONCE || - testParameters.wrapT == Sampler::MIRRORED_ONCE || - testParameters.wrapR == Sampler::MIRRORED_ONCE) && - !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_sampler_mirror_clamp_to_edge")) - TCU_THROW(NotSupportedError, "VK_KHR_sampler_mirror_clamp_to_edge not supported"); + if (testParameters.wrapS == Sampler::MIRRORED_ONCE || testParameters.wrapT == Sampler::MIRRORED_ONCE || testParameters.wrapR == Sampler::MIRRORED_ONCE) + context.requireDeviceFunctionality("VK_KHR_sampler_mirror_clamp_to_edge"); // Create textures. m_textures.reserve(2); @@ -760,7 +832,11 @@ Texture3DFilteringTestInstance::Texture3DFilteringTestInstance (Context& context const tcu::Vec4 gMin = tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f)*cScale + cBias; const tcu::Vec4 gMax = tcu::Vec4(1.0f, 1.0f, 1.0f, 0.0f)*cScale + cBias; - tcu::fillWithComponentGradients(m_textures[0]->getLevel(levelNdx, 0), gMin, gMax); + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + tcu::fillWithComponentGradients(getEffectiveDepthStencilAccess(m_textures[0]->getLevel(levelNdx, 0), tcu::Sampler::MODE_STENCIL), gMin, gMax); + else + tcu::fillWithComponentGradients(m_textures[0]->getLevel(levelNdx, 0), gMin, gMax); + } // Fill second with grid texture. @@ -771,13 +847,17 @@ Texture3DFilteringTestInstance::Texture3DFilteringTestInstance (Context& context const deUint32 colorA = 0xff000000 | rgb; const deUint32 colorB = 0xff000000 | ~rgb; - tcu::fillWithGrid(m_textures[1]->getLevel(levelNdx, 0), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); + if (texFormat.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + tcu::fillWithGrid(getEffectiveDepthStencilAccess(m_textures[1]->getLevel(levelNdx, 0), tcu::Sampler::MODE_STENCIL), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); + else + tcu::fillWithGrid(m_textures[1]->getLevel(levelNdx, 0), 4, tcu::RGBA(colorA).toVec()*cScale + cBias, tcu::RGBA(colorB).toVec()*cScale + cBias); + } // Upload. for (vector::const_iterator i = m_textures.begin(); i != m_textures.end(); i++) { - m_renderer.add3DTexture(*i); + m_renderer.add3DTexture(*i, testParameters.aspectMask); } // Test cases @@ -806,7 +886,13 @@ tcu::TestStatus Texture3DFilteringTestInstance::iterate (void) // Params for reference computation. refParams.sampler = util::createSampler(m_testParameters.wrapS, m_testParameters.wrapT, m_testParameters.wrapR, m_testParameters.minFilter, m_testParameters.magFilter); - refParams.samplerType = getSamplerType(texFmt); + if (texFmt.order == tcu::TextureFormat::DS && m_testParameters.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT) + { + refParams.sampler.depthStencilMode = tcu::Sampler::MODE_STENCIL; + refParams.samplerType = SAMPLERTYPE_UINT; + } + else + refParams.samplerType = getSamplerType(texFmt); refParams.lodMode = LODMODE_EXACT; refParams.colorBias = fmtInfo.lookupBias; refParams.colorScale = fmtInfo.lookupScale; @@ -982,20 +1068,28 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) static const struct { - const char* const name; - const VkFormat format; + const char* const name; + const VkFormat format; + const VkImageAspectFlags aspectMask; + const Program program2D; + const Program programCube; + const Program program2DArray; + const Program program3D; } filterableFormatsByType[] = { - { "r16g16b16a16_sfloat", VK_FORMAT_R16G16B16A16_SFLOAT }, - { "b10g11r11_ufloat", VK_FORMAT_B10G11R11_UFLOAT_PACK32 }, - { "e5b9g9r9_ufloat", VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 }, - { "r8g8b8a8_unorm", VK_FORMAT_R8G8B8A8_UNORM }, - { "r8g8b8a8_snorm", VK_FORMAT_R8G8B8A8_SNORM }, - { "r5g6b5_unorm", VK_FORMAT_R5G6B5_UNORM_PACK16 }, - { "r4g4b4a4_unorm", VK_FORMAT_R4G4B4A4_UNORM_PACK16 }, - { "r5g5b5a1_unorm", VK_FORMAT_R5G5B5A1_UNORM_PACK16 }, - { "a8b8g8r8_srgb", VK_FORMAT_A8B8G8R8_SRGB_PACK32 }, - { "a1r5g5b5_unorm", VK_FORMAT_A1R5G5B5_UNORM_PACK16 } + { "r16g16b16a16_sfloat", VK_FORMAT_R16G16B16A16_SFLOAT, VK_IMAGE_ASPECT_COLOR_BIT, PROGRAM_2D_FLOAT, PROGRAM_CUBE_FLOAT, PROGRAM_2D_ARRAY_FLOAT, PROGRAM_3D_FLOAT }, + { "b10g11r11_ufloat", VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_IMAGE_ASPECT_COLOR_BIT, PROGRAM_2D_FLOAT, PROGRAM_CUBE_FLOAT, PROGRAM_2D_ARRAY_FLOAT, PROGRAM_3D_FLOAT }, + { "e5b9g9r9_ufloat", VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, VK_IMAGE_ASPECT_COLOR_BIT, PROGRAM_2D_FLOAT, PROGRAM_CUBE_FLOAT, PROGRAM_2D_ARRAY_FLOAT, PROGRAM_3D_FLOAT }, + { "r8g8b8a8_unorm", VK_FORMAT_R8G8B8A8_UNORM, VK_IMAGE_ASPECT_COLOR_BIT, PROGRAM_2D_FLOAT, PROGRAM_CUBE_FLOAT, PROGRAM_2D_ARRAY_FLOAT, PROGRAM_3D_FLOAT }, + { "r8g8b8a8_snorm", VK_FORMAT_R8G8B8A8_SNORM, VK_IMAGE_ASPECT_COLOR_BIT, PROGRAM_2D_FLOAT, PROGRAM_CUBE_FLOAT, PROGRAM_2D_ARRAY_FLOAT, PROGRAM_3D_FLOAT }, + { "r5g6b5_unorm", VK_FORMAT_R5G6B5_UNORM_PACK16, VK_IMAGE_ASPECT_COLOR_BIT, PROGRAM_2D_FLOAT, PROGRAM_CUBE_FLOAT, PROGRAM_2D_ARRAY_FLOAT, PROGRAM_3D_FLOAT }, + { "r4g4b4a4_unorm", VK_FORMAT_R4G4B4A4_UNORM_PACK16, VK_IMAGE_ASPECT_COLOR_BIT, PROGRAM_2D_FLOAT, PROGRAM_CUBE_FLOAT, PROGRAM_2D_ARRAY_FLOAT, PROGRAM_3D_FLOAT }, + { "r5g5b5a1_unorm", VK_FORMAT_R5G5B5A1_UNORM_PACK16, VK_IMAGE_ASPECT_COLOR_BIT, PROGRAM_2D_FLOAT, PROGRAM_CUBE_FLOAT, PROGRAM_2D_ARRAY_FLOAT, PROGRAM_3D_FLOAT }, + { "a8b8g8r8_srgb", VK_FORMAT_A8B8G8R8_SRGB_PACK32, VK_IMAGE_ASPECT_COLOR_BIT, PROGRAM_2D_FLOAT, PROGRAM_CUBE_FLOAT, PROGRAM_2D_ARRAY_FLOAT, PROGRAM_3D_FLOAT }, + { "a1r5g5b5_unorm", VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_IMAGE_ASPECT_COLOR_BIT, PROGRAM_2D_FLOAT, PROGRAM_CUBE_FLOAT, PROGRAM_2D_ARRAY_FLOAT, PROGRAM_3D_FLOAT }, + { "s8_uint", VK_FORMAT_S8_UINT, VK_IMAGE_ASPECT_STENCIL_BIT, PROGRAM_2D_UINT, PROGRAM_CUBE_UINT, PROGRAM_2D_ARRAY_UINT, PROGRAM_3D_UINT }, + { "d24_unorm_s8_uint_stencil", VK_FORMAT_D24_UNORM_S8_UINT, VK_IMAGE_ASPECT_STENCIL_BIT, PROGRAM_2D_UINT, PROGRAM_CUBE_UINT, PROGRAM_2D_ARRAY_UINT, PROGRAM_3D_UINT }, + { "d32_sfloat_s8_uint_stencil", VK_FORMAT_D32_SFLOAT_S8_UINT, VK_IMAGE_ASPECT_STENCIL_BIT, PROGRAM_2D_UINT, PROGRAM_CUBE_UINT, PROGRAM_2D_ARRAY_UINT, PROGRAM_3D_UINT } }; // 2D texture filtering. @@ -1029,7 +1123,8 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.width = 64; testParameters.height = 64; - testParameters.programs.push_back(PROGRAM_2D_FLOAT); + testParameters.aspectMask = filterableFormatsByType[fmtNdx].aspectMask; + testParameters.programs.push_back(filterableFormatsByType[fmtNdx].program2D); // Some combinations of the tests have to be skipped due to the restrictions of the verifiers. if (verifierCanBeUsed(testParameters.format, testParameters.minFilter, testParameters.magFilter)) @@ -1063,6 +1158,7 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.width = sizes2D[sizeNdx].width; testParameters.height = sizes2D[sizeNdx].height; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_FLOAT); filterGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); @@ -1098,6 +1194,7 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.width = 63; testParameters.height = 57; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_FLOAT); wrapSGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); @@ -1147,7 +1244,8 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.width = 64; testParameters.height = 64; - testParameters.programs.push_back(PROGRAM_2D_FLOAT); + testParameters.aspectMask = filterableFormatsByType[fmtNdx].aspectMask; + testParameters.programs.push_back(filterableFormatsByType[fmtNdx].program2D); // Some combinations of the tests have to be skipped due to the restrictions of the verifiers. if (verifierCanBeUsed(testParameters.format, testParameters.minFilter, testParameters.magFilter)) @@ -1181,6 +1279,7 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.width = sizes2D[sizeNdx].width; testParameters.height = sizes2D[sizeNdx].height; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_FLOAT); filterGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); @@ -1225,7 +1324,8 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.onlySampleFaceInterior = false; testParameters.size = 64; - testParameters.programs.push_back(PROGRAM_CUBE_FLOAT); + testParameters.aspectMask = filterableFormatsByType[fmtNdx].aspectMask; + testParameters.programs.push_back(filterableFormatsByType[fmtNdx].programCube); // Some tests have to be skipped due to the restrictions of the verifiers. if (verifierCanBeUsed(testParameters.format, testParameters.minFilter, testParameters.magFilter)) @@ -1257,6 +1357,7 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.onlySampleFaceInterior = false; testParameters.size = sizesCube[sizeNdx].size; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_CUBE_FLOAT); filterGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); @@ -1291,6 +1392,7 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.onlySampleFaceInterior = false; testParameters.size = 63; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_CUBE_FLOAT); wrapSGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); @@ -1317,6 +1419,7 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.onlySampleFaceInterior = true; testParameters.size = 63; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_CUBE_FLOAT); onlyFaceInteriorGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); @@ -1363,7 +1466,8 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.height = 128; testParameters.numLayers = 8; - testParameters.programs.push_back(PROGRAM_2D_ARRAY_FLOAT); + testParameters.aspectMask = filterableFormatsByType[fmtNdx].aspectMask; + testParameters.programs.push_back(filterableFormatsByType[fmtNdx].program2DArray); // Some tests have to be skipped due to the restrictions of the verifiers. if (verifierCanBeUsed(testParameters.format, testParameters.minFilter, testParameters.magFilter)) @@ -1397,6 +1501,7 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.height = sizes2DArray[sizeNdx].height; testParameters.numLayers = sizes2DArray[sizeNdx].numLayers; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_ARRAY_FLOAT); filterGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); @@ -1431,6 +1536,7 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.height = 107; testParameters.numLayers = 7; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_ARRAY_FLOAT); wrapSGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); @@ -1483,7 +1589,8 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.height = 64; testParameters.depth = 64; - testParameters.programs.push_back(PROGRAM_3D_FLOAT); + testParameters.aspectMask = filterableFormatsByType[fmtNdx].aspectMask; + testParameters.programs.push_back(filterableFormatsByType[fmtNdx].program3D); // Some tests have to be skipped due to the restrictions of the verifiers. if (verifierCanBeUsed(testParameters.format, testParameters.minFilter, testParameters.magFilter)) @@ -1518,6 +1625,7 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.height = sizes3D[sizeNdx].height; testParameters.depth = sizes3D[sizeNdx].depth; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_3D_FLOAT); filterGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); @@ -1557,6 +1665,7 @@ void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests) testParameters.height = 57; testParameters.depth = 67; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_3D_FLOAT); wrapTGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureMipmapTests.cpp b/external/vulkancts/modules/vulkan/texture/vktTextureMipmapTests.cpp index 511e730..bf637c8 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureMipmapTests.cpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureMipmapTests.cpp @@ -188,7 +188,7 @@ Texture2DMipmapTestInstance::Texture2DMipmapTestInstance (Context& context, cons } // Upload texture data. - m_renderer.add2DTexture(m_texture); + m_renderer.add2DTexture(m_texture, testParameters.aspectMask); } Texture2DMipmapTestInstance::~Texture2DMipmapTestInstance (void) @@ -461,7 +461,7 @@ TextureCubeMipmapTestInstance::TextureCubeMipmapTestInstance (Context& context, } } - m_renderer.addCubeTexture(m_texture); + m_renderer.addCubeTexture(m_texture, testParameters.aspectMask); } TextureCubeMipmapTestInstance::~TextureCubeMipmapTestInstance (void) @@ -691,7 +691,7 @@ Texture3DMipmapTestInstance::Texture3DMipmapTestInstance (Context& context, cons tcu::clear(m_texture->getLevel(levelNdx, 0), tcu::RGBA(color).toVec()*cScale + cBias); } - m_renderer.add3DTexture(m_texture); + m_renderer.add3DTexture(m_texture, testParameters.aspectMask); } Texture3DMipmapTestInstance::~Texture3DMipmapTestInstance (void) @@ -971,7 +971,7 @@ Texture2DLodControlTestInstance::Texture2DLodControlTestInstance (Context& conte tcu::clear(m_texture->getLevel(levelNdx, 0), tcu::RGBA(color).toVec()); } - m_renderer.add2DTexture(m_texture); + m_renderer.add2DTexture(m_texture, testParameters.aspectMask); } Texture2DLodControlTestInstance::~Texture2DLodControlTestInstance (void) @@ -1236,7 +1236,7 @@ TextureCubeLodControlTestInstance::TextureCubeLodControlTestInstance (Context& c } } - m_renderer.addCubeTexture(m_texture); + m_renderer.addCubeTexture(m_texture, testParameters.aspectMask); } TextureCubeLodControlTestInstance::~TextureCubeLodControlTestInstance (void) @@ -1489,7 +1489,7 @@ Texture3DLodControlTestInstance::Texture3DLodControlTestInstance (Context& conte tcu::clear(m_texture->getLevel(levelNdx, 0), tcu::RGBA(color).toVec()*cScale + cBias); } - m_renderer.add3DTexture(m_texture); + m_renderer.add3DTexture(m_texture, testParameters.aspectMask); } Texture3DLodControlTestInstance::~Texture3DLodControlTestInstance (void) @@ -1815,9 +1815,10 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) testParameters.minFilter = minFilterModes[minFilter].mode; testParameters.wrapS = wrapModes[wrapMode].mode; testParameters.wrapT = wrapModes[wrapMode].mode; - testParameters.format = VK_FORMAT_R8G8B8A8_UNORM; //not sure (GL_RGBA) + testParameters.format = VK_FORMAT_R8G8B8A8_UNORM; testParameters.width = tex2DSizes[size].width; testParameters.height = tex2DSizes[size].height; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_FLOAT); std::ostringstream name; @@ -1846,9 +1847,10 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) testParameters.magFilter = minFilterModes[minFilter].mode; testParameters.wrapS = Sampler::REPEAT_GL; testParameters.wrapT = Sampler::REPEAT_GL; - testParameters.format = VK_FORMAT_R8G8B8A8_UNORM; //not sure (GL_RGBA) + testParameters.format = VK_FORMAT_R8G8B8A8_UNORM; testParameters.width = tex2DSizes[0].width; testParameters.height = tex2DSizes[0].height; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_FLOAT_BIAS); std::ostringstream name; @@ -1865,6 +1867,7 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) { Texture2DMipmapTestCaseParameters testParameters; testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_FLOAT); minLodGroup2D->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -1874,7 +1877,8 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) for (int minFilter = 0; minFilter < DE_LENGTH_OF_ARRAY(minFilterModes); minFilter++) { Texture2DMipmapTestCaseParameters testParameters; - testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_FLOAT); maxLodGroup2D->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -1886,8 +1890,9 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) for (int minFilter = 0; minFilter < DE_LENGTH_OF_ARRAY(minFilterModes); minFilter++) { Texture2DMipmapTestCaseParameters testParameters; - testParameters.minFilter = minFilterModes[minFilter].mode; - testParameters.minFilterName = minFilterModes[minFilter].name; + testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.minFilterName = minFilterModes[minFilter].name; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_FLOAT); baseLevelGroup2D->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -1897,8 +1902,9 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) for (int minFilter = 0; minFilter < DE_LENGTH_OF_ARRAY(minFilterModes); minFilter++) { Texture2DMipmapTestCaseParameters testParameters; - testParameters.minFilter = minFilterModes[minFilter].mode; - testParameters.minFilterName = minFilterModes[minFilter].name; + testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.minFilterName = minFilterModes[minFilter].name; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_2D_FLOAT); maxLevelGroup2D->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -1943,6 +1949,7 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) testParameters.wrapT = wrapModes[wrapMode].mode; testParameters.format = VK_FORMAT_R8G8B8A8_UNORM; testParameters.size = cubeMapSize; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; if (testParameters.coordType == COORDTYPE_BASIC_BIAS) testParameters.programs.push_back(PROGRAM_CUBE_FLOAT_BIAS); @@ -1969,6 +1976,7 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) { TextureCubeMipmapTestCaseParameters testParameters; testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_CUBE_FLOAT); minLodGroupCube->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -1979,6 +1987,7 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) { TextureCubeMipmapTestCaseParameters testParameters; testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_CUBE_FLOAT); maxLodGroupCube->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -1990,8 +1999,9 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) for (int minFilter = 0; minFilter < DE_LENGTH_OF_ARRAY(minFilterModes); minFilter++) { TextureCubeMipmapTestCaseParameters testParameters; - testParameters.minFilter = minFilterModes[minFilter].mode; - testParameters.minFilterName = minFilterModes[minFilter].name; + testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.minFilterName = minFilterModes[minFilter].name; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_CUBE_FLOAT); baseLevelGroupCube->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -2001,8 +2011,9 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) for (int minFilter = 0; minFilter < DE_LENGTH_OF_ARRAY(minFilterModes); minFilter++) { TextureCubeMipmapTestCaseParameters testParameters; - testParameters.minFilter = minFilterModes[minFilter].mode; - testParameters.minFilterName = minFilterModes[minFilter].name; + testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.minFilterName = minFilterModes[minFilter].name; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_CUBE_FLOAT); maxLevelGroupCube->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -2047,6 +2058,7 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) testParameters.wrapS = wrapModes[wrapMode].mode; testParameters.wrapT = wrapModes[wrapMode].mode; testParameters.format = VK_FORMAT_R8G8B8A8_UNORM; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_3D_FLOAT); for (int size = 0; size < sizeEnd; size++) @@ -2084,7 +2096,7 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) testParameters.width = tex3DSizes[0].width; testParameters.height = tex3DSizes[0].height; testParameters.depth = tex3DSizes[0].depth; - + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_3D_FLOAT_BIAS); biasGroup3D->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -2098,6 +2110,7 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) { Texture3DMipmapTestCaseParameters testParameters; testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_3D_FLOAT); minLodGroup3D->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -2108,6 +2121,7 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) { Texture3DMipmapTestCaseParameters testParameters; testParameters.minFilter = minFilterModes[minFilter].mode; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_3D_FLOAT); maxLodGroup3D->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -2121,6 +2135,7 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) Texture3DMipmapTestCaseParameters testParameters; testParameters.minFilter = minFilterModes[minFilter].mode; testParameters.minFilterName = minFilterModes[minFilter].name; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_3D_FLOAT); baseLevelGroup3D->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); @@ -2132,6 +2147,7 @@ void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests) Texture3DMipmapTestCaseParameters testParameters; testParameters.minFilter = minFilterModes[minFilter].mode; testParameters.minFilterName = minFilterModes[minFilter].name; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(PROGRAM_3D_FLOAT); maxLevelGroup3D->addChild(new TextureTestCase(testCtx, minFilterModes[minFilter].name, "", testParameters)); diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp b/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp index 0a1fe4b..e1d9dbd 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp @@ -264,7 +264,7 @@ Texture2DShadowTestInstance::Texture2DShadowTestInstance (Context& context, cons // Upload. for (std::vector::iterator i = m_textures.begin(); i != m_textures.end(); ++i) { - m_renderer.add2DTexture(*i, m_testParameters.backingMode); + m_renderer.add2DTexture(*i, m_testParameters.aspectMask, m_testParameters.backingMode); } // Compute cases. @@ -898,7 +898,7 @@ void populateTextureShadowTests (tcu::TestCaseGroup* textureShadowTests) testParameters.wrapT = Sampler::REPEAT_GL; testParameters.width = 32; testParameters.height = 64; - + testParameters.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT; testParameters.programs.push_back(PROGRAM_2D_SHADOW); filterGroup->addChild(new TextureTestCase(testCtx, name.c_str(), "", testParameters)); @@ -937,6 +937,7 @@ void populateTextureShadowTests (tcu::TestCaseGroup* textureShadowTests) testParameters.wrapS = Sampler::REPEAT_GL; testParameters.wrapT = Sampler::REPEAT_GL; testParameters.size = 32; + testParameters.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT; testParameters.programs.push_back(PROGRAM_CUBE_SHADOW); @@ -978,6 +979,7 @@ void populateTextureShadowTests (tcu::TestCaseGroup* textureShadowTests) testParameters.width = 32; testParameters.height = 64; testParameters.numLayers = 8; + testParameters.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT; testParameters.programs.push_back(PROGRAM_2D_ARRAY_SHADOW); diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureSwizzleTests.cpp b/external/vulkancts/modules/vulkan/texture/vktTextureSwizzleTests.cpp index 488fdb8..e437873 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureSwizzleTests.cpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureSwizzleTests.cpp @@ -124,7 +124,7 @@ Swizzle2DTestInstance::Swizzle2DTestInstance (Context& context, : new pipeline::TestTexture2D(m_format, testParameters.width, testParameters.height))) , m_renderer (context, testParameters.sampleCount, testParameters.width, testParameters.height, testParameters.componentMapping) { - m_renderer.add2DTexture(m_texture, testParameters.backingMode); + m_renderer.add2DTexture(m_texture, testParameters.aspectMask, testParameters.backingMode); } tcu::TestStatus Swizzle2DTestInstance::iterate (void) @@ -479,6 +479,7 @@ void populateTextureSwizzleTests (tcu::TestCaseGroup* textureSwizzleTests) testParameters.height = sizes2D[sizeNdx].height; testParameters.minFilter = tcu::Sampler::NEAREST; testParameters.magFilter = tcu::Sampler::NEAREST; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(formats2D[formatNdx].program); groupCompMap->addChild(new SwizzleTestCase(testCtx, caseName.c_str(), caseDesc.c_str(), testParameters)); @@ -507,6 +508,7 @@ void populateTextureSwizzleTests (tcu::TestCaseGroup* textureSwizzleTests) testParameters.height = sizes2D[sizeNdx].height; testParameters.minFilter = tcu::Sampler::NEAREST; testParameters.magFilter = tcu::Sampler::NEAREST; + testParameters.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; testParameters.programs.push_back(formats2D[formatNdx].program); groupTexCoord->addChild(new SwizzleTestCase(testCtx, caseName.c_str(), caseDesc.c_str(), testParameters)); diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp b/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp index 27487df..edefe46 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp @@ -308,16 +308,25 @@ TextureBinding::TextureBinding (Context& context) { } -TextureBinding::TextureBinding (Context& context, const TestTextureSp& textureData, const TextureBinding::Type type, const TextureBinding::ImageBackingMode backingMode, const VkComponentMapping componentMapping) +TextureBinding::TextureBinding (Context& context, const TestTextureSp& textureData, const TextureBinding::Type type, const vk::VkImageAspectFlags aspectMask, const TextureBinding::ImageBackingMode backingMode, const VkComponentMapping componentMapping) : m_context (context) , m_type (type) , m_backingMode (backingMode) , m_textureData (textureData) + , m_aspectMask (aspectMask) , m_componentMapping (componentMapping) { updateTextureData(m_textureData, m_type); } +VkImageAspectFlags guessAspectMask(const vk::VkFormat format) +{ + tcu::TextureFormat textureFormat = mapVkFormat(format); + const bool isShadowTexture = tcu::hasDepthComponent(textureFormat.order); + const bool isStencilTexture = tcu::hasStencilComponent(textureFormat.order); + return isShadowTexture ? VK_IMAGE_ASPECT_DEPTH_BIT : isStencilTexture ? VK_IMAGE_ASPECT_STENCIL_BIT : VK_IMAGE_ASPECT_COLOR_BIT; +} + void TextureBinding::updateTextureData (const TestTextureSp& textureData, const TextureBinding::Type textureType) { const DeviceInterface& vkd = m_context.getDeviceInterface(); @@ -434,8 +443,7 @@ void TextureBinding::updateTextureViewMipLevels (deUint32 baseLevel, deUint32 ma const VkDevice vkDevice = m_context.getDevice(); const vk::VkImageViewType imageViewType = textureTypeToImageViewType(m_type); const vk::VkFormat format = m_textureData->isCompressed() ? mapCompressedTextureFormat(m_textureData->getCompressedLevel(0, 0).getFormat()) : mapTextureFormat(m_textureData->getTextureFormat()); - const bool isShadowTexture = tcu::hasDepthComponent(m_textureData->getTextureFormat().order); - const VkImageAspectFlags aspectMask = isShadowTexture ? VK_IMAGE_ASPECT_DEPTH_BIT : VK_IMAGE_ASPECT_COLOR_BIT; + const VkImageAspectFlags aspectMask = ( m_aspectMask != VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM ) ? m_aspectMask : guessAspectMask(format); const deUint32 layerCount = m_textureData->getArraySize(); const vk::VkImageViewCreateInfo viewParams = { @@ -842,24 +850,24 @@ void TextureRenderer::clearImage(VkImage image) submitCommandsAndWait(vkd, vkDevice, queue, commandBuffer.get()); } -void TextureRenderer::add2DTexture (const TestTexture2DSp& texture, TextureBinding::ImageBackingMode backingMode) +void TextureRenderer::add2DTexture (const TestTexture2DSp& texture, const vk::VkImageAspectFlags& aspectMask, TextureBinding::ImageBackingMode backingMode) { - m_textureBindings.push_back(TextureBindingSp(new TextureBinding(m_context, texture, TextureBinding::TYPE_2D, backingMode, m_componentMapping))); + m_textureBindings.push_back(TextureBindingSp(new TextureBinding(m_context, texture, TextureBinding::TYPE_2D, aspectMask, backingMode, m_componentMapping))); } -void TextureRenderer::addCubeTexture (const TestTextureCubeSp& texture, TextureBinding::ImageBackingMode backingMode) +void TextureRenderer::addCubeTexture (const TestTextureCubeSp& texture, const vk::VkImageAspectFlags& aspectMask, TextureBinding::ImageBackingMode backingMode) { - m_textureBindings.push_back(TextureBindingSp(new TextureBinding(m_context, texture, TextureBinding::TYPE_CUBE_MAP, backingMode, m_componentMapping))); + m_textureBindings.push_back(TextureBindingSp(new TextureBinding(m_context, texture, TextureBinding::TYPE_CUBE_MAP, aspectMask, backingMode, m_componentMapping))); } -void TextureRenderer::add2DArrayTexture (const TestTexture2DArraySp& texture, TextureBinding::ImageBackingMode backingMode) +void TextureRenderer::add2DArrayTexture (const TestTexture2DArraySp& texture, const vk::VkImageAspectFlags& aspectMask, TextureBinding::ImageBackingMode backingMode) { - m_textureBindings.push_back(TextureBindingSp(new TextureBinding(m_context, texture, TextureBinding::TYPE_2D_ARRAY, backingMode, m_componentMapping))); + m_textureBindings.push_back(TextureBindingSp(new TextureBinding(m_context, texture, TextureBinding::TYPE_2D_ARRAY, aspectMask, backingMode, m_componentMapping))); } -void TextureRenderer::add3DTexture (const TestTexture3DSp& texture, TextureBinding::ImageBackingMode backingMode) +void TextureRenderer::add3DTexture (const TestTexture3DSp& texture, const vk::VkImageAspectFlags& aspectMask, TextureBinding::ImageBackingMode backingMode) { - m_textureBindings.push_back(TextureBindingSp(new TextureBinding(m_context, texture, TextureBinding::TYPE_3D, backingMode, m_componentMapping))); + m_textureBindings.push_back(TextureBindingSp(new TextureBinding(m_context, texture, TextureBinding::TYPE_3D, aspectMask, backingMode, m_componentMapping))); } const pipeline::TestTexture2D& TextureRenderer::get2DTexture (int textureIndex) const diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.hpp b/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.hpp index 3fcfa79..840773c 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.hpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.hpp @@ -144,8 +144,9 @@ public: }; TextureBinding (Context& context); TextureBinding (Context& context, const TestTextureSp& textureData, const Type type, - const ImageBackingMode backingMode = IMAGE_BACKING_MODE_REGULAR, - const vk::VkComponentMapping componentMapping = vk::makeComponentMappingRGBA()); + const vk::VkImageAspectFlags aspectMask, + const ImageBackingMode backingMode = IMAGE_BACKING_MODE_REGULAR, + const vk::VkComponentMapping componentMapping = vk::makeComponentMappingRGBA()); vk::VkImage getImage (void) { return *m_textureImage; } vk::VkImageView getImageView (void) { return *m_textureImageView; } Type getType (void) { return m_type; } @@ -166,6 +167,7 @@ private: de::MovePtr m_textureImageMemory; vk::Move m_textureImageView; std::vector > m_allocations; + vk::VkImageAspectFlags m_aspectMask; vk::VkComponentMapping m_componentMapping; }; @@ -188,18 +190,22 @@ public: void clearImage (vk::VkImage image); void add2DTexture (const TestTexture2DSp& texture, + const vk::VkImageAspectFlags& aspectMask, TextureBinding::ImageBackingMode backingMode = TextureBinding::IMAGE_BACKING_MODE_REGULAR); const pipeline::TestTexture2D& get2DTexture (int textureIndex) const; void addCubeTexture (const TestTextureCubeSp& texture, + const vk::VkImageAspectFlags& aspectMask, TextureBinding::ImageBackingMode backingMode = TextureBinding::IMAGE_BACKING_MODE_REGULAR); const pipeline::TestTextureCube& getCubeTexture (int textureIndex) const; void add2DArrayTexture (const TestTexture2DArraySp& texture, + const vk::VkImageAspectFlags& aspectMask, TextureBinding::ImageBackingMode backingMode = TextureBinding::IMAGE_BACKING_MODE_REGULAR); const pipeline::TestTexture2DArray& get2DArrayTexture (int textureIndex) const; void add3DTexture (const TestTexture3DSp& texture, + const vk::VkImageAspectFlags& aspectMask, TextureBinding::ImageBackingMode backingMode = TextureBinding::IMAGE_BACKING_MODE_REGULAR); const pipeline::TestTexture3D& get3DTexture (int textureIndex) const; @@ -314,6 +320,7 @@ struct TextureCommonTestCaseParameters std::vector programs; deBool unnormal; + vk::VkImageAspectFlags aspectMask; }; struct Texture2DTestCaseParameters : public TextureCommonTestCaseParameters diff --git a/external/vulkancts/mustpass/master/vk-default-no-waivers.txt b/external/vulkancts/mustpass/master/vk-default-no-waivers.txt index 39aaa10..5d6568e 100644 --- a/external/vulkancts/mustpass/master/vk-default-no-waivers.txt +++ b/external/vulkancts/mustpass/master/vk-default-no-waivers.txt @@ -480435,6 +480435,9 @@ dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.nearest_mipmap_nearest dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.linear_mipmap_nearest dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.nearest_mipmap_linear dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.linear_mipmap_linear +dEQP-VK.texture.filtering.2d.formats.s8_uint.nearest +dEQP-VK.texture.filtering.2d.formats.d24_unorm_s8_uint_stencil.nearest +dEQP-VK.texture.filtering.2d.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.2d.sizes.4x8.nearest dEQP-VK.texture.filtering.2d.sizes.4x8.linear dEQP-VK.texture.filtering.2d.sizes.4x8.nearest_mipmap_nearest @@ -480791,6 +480794,9 @@ dEQP-VK.texture.filtering.unnormal.formats.a8b8g8r8_srgb.nearest dEQP-VK.texture.filtering.unnormal.formats.a8b8g8r8_srgb.linear dEQP-VK.texture.filtering.unnormal.formats.a1r5g5b5_unorm.nearest dEQP-VK.texture.filtering.unnormal.formats.a1r5g5b5_unorm.linear +dEQP-VK.texture.filtering.unnormal.formats.s8_uint.nearest +dEQP-VK.texture.filtering.unnormal.formats.d24_unorm_s8_uint_stencil.nearest +dEQP-VK.texture.filtering.unnormal.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.unnormal.sizes.4x8.nearest dEQP-VK.texture.filtering.unnormal.sizes.4x8.linear dEQP-VK.texture.filtering.unnormal.sizes.32x64.nearest @@ -480863,6 +480869,9 @@ dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.nearest_mipmap_nearest dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.linear_mipmap_nearest dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.nearest_mipmap_linear dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.linear_mipmap_linear +dEQP-VK.texture.filtering.cube.formats.s8_uint.nearest +dEQP-VK.texture.filtering.cube.formats.d24_unorm_s8_uint_stencil.nearest +dEQP-VK.texture.filtering.cube.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.cube.sizes.8x8.nearest dEQP-VK.texture.filtering.cube.sizes.8x8.linear dEQP-VK.texture.filtering.cube.sizes.8x8.nearest_mipmap_nearest @@ -481255,6 +481264,9 @@ dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_nearest dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest_mipmap_linear dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_linear +dEQP-VK.texture.filtering.2d_array.formats.s8_uint.s8_uint_nearest +dEQP-VK.texture.filtering.2d_array.formats.d24_unorm_s8_uint_stencil.d24_unorm_s8_uint_stencil_nearest +dEQP-VK.texture.filtering.2d_array.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_uint_stencil_nearest dEQP-VK.texture.filtering.2d_array.sizes.4x8x8.nearest dEQP-VK.texture.filtering.2d_array.sizes.4x8x8.linear dEQP-VK.texture.filtering.2d_array.sizes.4x8x8.nearest_mipmap_nearest @@ -481645,6 +481657,9 @@ dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest_mipma dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_nearest dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest_mipmap_linear dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_linear +dEQP-VK.texture.filtering.3d.formats.s8_uint.s8_uint_nearest +dEQP-VK.texture.filtering.3d.formats.d24_unorm_s8_uint_stencil.d24_unorm_s8_uint_stencil_nearest +dEQP-VK.texture.filtering.3d.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_uint_stencil_nearest dEQP-VK.texture.filtering.3d.sizes.4x8x8.nearest dEQP-VK.texture.filtering.3d.sizes.4x8x8.linear dEQP-VK.texture.filtering.3d.sizes.4x8x8.nearest_mipmap_nearest diff --git a/external/vulkancts/mustpass/master/vk-default.txt b/external/vulkancts/mustpass/master/vk-default.txt index 893755d..1add132 100644 --- a/external/vulkancts/mustpass/master/vk-default.txt +++ b/external/vulkancts/mustpass/master/vk-default.txt @@ -480396,6 +480396,9 @@ dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.nearest_mipmap_nearest dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.linear_mipmap_nearest dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.nearest_mipmap_linear dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.linear_mipmap_linear +dEQP-VK.texture.filtering.2d.formats.s8_uint.nearest +dEQP-VK.texture.filtering.2d.formats.d24_unorm_s8_uint_stencil.nearest +dEQP-VK.texture.filtering.2d.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.2d.sizes.4x8.nearest dEQP-VK.texture.filtering.2d.sizes.4x8.linear dEQP-VK.texture.filtering.2d.sizes.4x8.nearest_mipmap_nearest @@ -480752,6 +480755,9 @@ dEQP-VK.texture.filtering.unnormal.formats.a8b8g8r8_srgb.nearest dEQP-VK.texture.filtering.unnormal.formats.a8b8g8r8_srgb.linear dEQP-VK.texture.filtering.unnormal.formats.a1r5g5b5_unorm.nearest dEQP-VK.texture.filtering.unnormal.formats.a1r5g5b5_unorm.linear +dEQP-VK.texture.filtering.unnormal.formats.s8_uint.nearest +dEQP-VK.texture.filtering.unnormal.formats.d24_unorm_s8_uint_stencil.nearest +dEQP-VK.texture.filtering.unnormal.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.unnormal.sizes.4x8.nearest dEQP-VK.texture.filtering.unnormal.sizes.4x8.linear dEQP-VK.texture.filtering.unnormal.sizes.32x64.nearest @@ -480824,6 +480830,9 @@ dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.nearest_mipmap_nearest dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.linear_mipmap_nearest dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.nearest_mipmap_linear dEQP-VK.texture.filtering.cube.formats.a1r5g5b5_unorm.linear_mipmap_linear +dEQP-VK.texture.filtering.cube.formats.s8_uint.nearest +dEQP-VK.texture.filtering.cube.formats.d24_unorm_s8_uint_stencil.nearest +dEQP-VK.texture.filtering.cube.formats.d32_sfloat_s8_uint_stencil.nearest dEQP-VK.texture.filtering.cube.sizes.8x8.nearest dEQP-VK.texture.filtering.cube.sizes.8x8.linear dEQP-VK.texture.filtering.cube.sizes.8x8.nearest_mipmap_nearest @@ -481216,6 +481225,9 @@ dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_nearest dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest_mipmap_linear dEQP-VK.texture.filtering.2d_array.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_linear +dEQP-VK.texture.filtering.2d_array.formats.s8_uint.s8_uint_nearest +dEQP-VK.texture.filtering.2d_array.formats.d24_unorm_s8_uint_stencil.d24_unorm_s8_uint_stencil_nearest +dEQP-VK.texture.filtering.2d_array.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_uint_stencil_nearest dEQP-VK.texture.filtering.2d_array.sizes.4x8x8.nearest dEQP-VK.texture.filtering.2d_array.sizes.4x8x8.linear dEQP-VK.texture.filtering.2d_array.sizes.4x8x8.nearest_mipmap_nearest @@ -481606,6 +481618,9 @@ dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest_mipma dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_nearest dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_nearest_mipmap_linear dEQP-VK.texture.filtering.3d.formats.a1r5g5b5_unorm.a1r5g5b5_unorm_linear_mipmap_linear +dEQP-VK.texture.filtering.3d.formats.s8_uint.s8_uint_nearest +dEQP-VK.texture.filtering.3d.formats.d24_unorm_s8_uint_stencil.d24_unorm_s8_uint_stencil_nearest +dEQP-VK.texture.filtering.3d.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_uint_stencil_nearest dEQP-VK.texture.filtering.3d.sizes.4x8x8.nearest dEQP-VK.texture.filtering.3d.sizes.4x8x8.linear dEQP-VK.texture.filtering.3d.sizes.4x8x8.nearest_mipmap_nearest -- 2.7.4