Consistently use tcu::Samplers with seamlessCubeMap to match core Vulkan
authorGeorg Lehmann <dadschoorse@gmail.com>
Fri, 3 Sep 2021 15:25:00 +0000 (17:25 +0200)
committerGeorg Lehmann <dadschoorse@gmail.com>
Thu, 16 Jun 2022 16:53:46 +0000 (18:53 +0200)
12 files changed:
external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp
external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorCopyTests.cpp
external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp
external/vulkancts/modules/vulkan/descriptor_indexing/vktDescriptorSetsIndexingTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemShaderImageAccessTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemStackTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemWorkgroupStorageTests.cpp
external/vulkancts/modules/vulkan/shaderexecutor/vktOpaqueTypeIndexingTests.cpp
external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderDerivateTests.cpp
external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderDiscardTests.cpp
external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderTextureGatherTests.cpp
external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp

index 721ce2c..90361f1 100644 (file)
@@ -3850,7 +3850,8 @@ bool floatNearestBlitCompare (const tcu::ConstPixelBufferAccess&  source,
                                                          const tcu::PixelBufferAccess&                 errorMask,
                                                          const std::vector<CopyRegion>&                regions)
 {
-       const tcu::Sampler              sampler         (tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST);
+       const tcu::Sampler              sampler         (tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
+                                                                                0.0f, true, tcu::Sampler::COMPAREMODE_NONE, 0, tcu::Vec4(0.0f), true);
        const tcu::IVec4                dstBitDepth (tcu::getTextureFormatBitDepth(result.getFormat()));
        tcu::LookupPrecision    precision;
 
@@ -3895,7 +3896,8 @@ bool intNearestBlitCompare (const tcu::ConstPixelBufferAccess&    source,
                                                        const tcu::PixelBufferAccess&           errorMask,
                                                        const std::vector<CopyRegion>&          regions)
 {
-       const tcu::Sampler              sampler         (tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST);
+       const tcu::Sampler              sampler         (tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
+                                                                                0.0f, true, tcu::Sampler::COMPAREMODE_NONE, 0, tcu::Vec4(0.0f), true);
        tcu::IntLookupPrecision precision;
 
        {
@@ -4228,7 +4230,7 @@ void scaleFromWholeSrcBuffer (const tcu::PixelBufferAccess& dst, const tcu::Cons
        DE_ASSERT(filter == tcu::Sampler::LINEAR || filter == tcu::Sampler::CUBIC);
 
        tcu::Sampler sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE,
-                                       filter, filter, 0.0f, false);
+                                       filter, filter, 0.0f, false, tcu::Sampler::COMPAREMODE_NONE, 0, tcu::Vec4(0.0f), true);
 
        float sX = (float)regionExtent.x / (float)dst.getWidth();
        float sY = (float)regionExtent.y / (float)dst.getHeight();
@@ -4253,7 +4255,7 @@ void blit (const tcu::PixelBufferAccess& dst, const tcu::ConstPixelBufferAccess&
        DE_ASSERT(filter == tcu::Sampler::NEAREST || filter == tcu::Sampler::LINEAR || filter == tcu::Sampler::CUBIC);
 
        tcu::Sampler sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE,
-                       filter, filter, 0.0f, false);
+                       filter, filter, 0.0f, false, tcu::Sampler::COMPAREMODE_NONE, 0, tcu::Vec4(0.0f), true);
 
        const float sX = (float)src.getWidth() / (float)dst.getWidth();
        const float sY = (float)src.getHeight() / (float)dst.getHeight();
index e696267..d50257a 100644 (file)
@@ -986,7 +986,8 @@ void ImageDescriptor::init (Context&                context,
 
        // Create sampler
        {
-               const tcu::Sampler                      sampler                 = tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST);
+               const tcu::Sampler                      sampler                 = tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
+                                                                                                                                  0.0f, true, tcu::Sampler::COMPAREMODE_NONE, 0, tcu::Vec4(0.0f), true);
                const tcu::TextureFormat        texFormat               = mapVkFormat(format);
                const VkSamplerCreateInfo       samplerParams   = mapSampler(sampler, texFormat);
 
@@ -1318,7 +1319,7 @@ void SamplerDescriptor::init (Context&            context,
        for (deUint32 i = 0; i < m_arraySize; i++)
        {
                const float                                     borderValue             = (float)((m_id + i) % 2);
-               const tcu::Sampler                      sampler                 = tcu::Sampler(tcu::Sampler::CLAMP_TO_BORDER, tcu::Sampler::CLAMP_TO_BORDER, tcu::Sampler::CLAMP_TO_BORDER, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST, 0.0f, true, tcu::Sampler::COMPAREMODE_NONE, 0, Vec4(borderValue));
+               const tcu::Sampler                      sampler                 = tcu::Sampler(tcu::Sampler::CLAMP_TO_BORDER, tcu::Sampler::CLAMP_TO_BORDER, tcu::Sampler::CLAMP_TO_BORDER, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST, 0.0f, true, tcu::Sampler::COMPAREMODE_NONE, 0, Vec4(borderValue), true);
                const tcu::TextureFormat        texFormat               = mapVkFormat(format);
                const VkSamplerCreateInfo       samplerParams   = mapSampler(sampler, texFormat);
 
index 8f09d75..aa88f43 100644 (file)
@@ -5503,12 +5503,14 @@ tcu::Sampler ImageSampleInstanceImages::createRefSampler (int ndx)
        if (ndx % 2 == 0)
        {
                // linear, wrapping
-               return tcu::Sampler(tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::LINEAR, tcu::Sampler::LINEAR);
+               return tcu::Sampler(tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::REPEAT_GL, tcu::Sampler::LINEAR, tcu::Sampler::LINEAR,
+                                                       0.0f, true, tcu::Sampler::COMPAREMODE_NONE, 0, tcu::Vec4(0.0f), true);
        }
        else
        {
                // nearest, clamping
-               return tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST);
+               return tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
+                                                       0.0f, true, tcu::Sampler::COMPAREMODE_NONE, 0, tcu::Vec4(0.0f), true);
        }
 }
 
index 6eda5bb..cb9415b 100644 (file)
@@ -3628,7 +3628,11 @@ void SamplerInstance::createAndPopulateDescriptors                                       (IterateCommonVariables&
                m_testParams.usesMipMaps ? tcu::Sampler::LINEAR_MIPMAP_NEAREST : tcu::Sampler::NEAREST, // minFilter
                m_testParams.usesMipMaps ? tcu::Sampler::LINEAR_MIPMAP_NEAREST : tcu::Sampler::NEAREST, // magFilter
                0.0f,                                                                                                                                                                   // lodTreshold
-               true);                                                                                                                                                                  // normalizeCoords
+               true,                                                                                                                                                                   // normalizeCoords
+               tcu::Sampler::COMPAREMODE_NONE,                                                                                                                 // compare
+               0,                                                                                                                                                                              // compareChannel
+               tcu::Vec4(0.0f, 0.0f, 0.0f, 0.0f),                                                                                                              // borderColor
+               true);                                                                                                                                                                  // seamlessCubeMap
        const VkSamplerCreateInfo createInfo = vk::mapSampler(sampler, vk::mapVkFormat(m_colorFormat));
        variables.descriptorSamplers.resize(variables.validDescriptorCount);
 
@@ -3715,7 +3719,11 @@ void SampledImageInstance::createAndPopulateDescriptors                          (IterateCommonVariabl
                        m_testParams.usesMipMaps ? tcu::Sampler::NEAREST_MIPMAP_NEAREST : tcu::Sampler::NEAREST,        // minFilter
                        m_testParams.usesMipMaps ? tcu::Sampler::NEAREST_MIPMAP_NEAREST : tcu::Sampler::NEAREST,        // magFilter
                        0.0f,                                                                                                                                                                           // lodTreshold
-                       true);                                                                                                                                                                          // normalizeCoords
+                       true,                                                                                                                                                                           // normalizeCoords
+                       tcu::Sampler::COMPAREMODE_NONE,                                                                                                                         // compare
+                       0,                                                                                                                                                                                      // compareChannel
+                       tcu::Vec4(0.0f, 0.0f, 0.0f, 0.0f),                                                                                                                      // borderColor
+                       true);                                                                                                                                                                          // seamlessCubeMap
                const VkSamplerCreateInfo createInfo = vk::mapSampler(sampler, vk::mapVkFormat(m_colorFormat));
                variables.descriptorSamplers.push_back(ut::SamplerSp(new Move<VkSampler>(vk::createSampler(m_vki, m_vkd, &createInfo))));
        }
@@ -3829,7 +3837,11 @@ void CombinedImageInstance::createAndPopulateDescriptors                 (IterateCommonVariabl
                m_testParams.usesMipMaps ? tcu::Sampler::NEAREST_MIPMAP_NEAREST : tcu::Sampler::NEAREST,        // minFilter
                m_testParams.usesMipMaps ? tcu::Sampler::NEAREST_MIPMAP_NEAREST : tcu::Sampler::NEAREST,        // magFilter
                0.0f,                                                                                                                                                                           // lodTreshold
-               true);                                                                                                                                                                          // normalizeCoords
+               true,                                                                                                                                                                           // normalizeCoords
+               tcu::Sampler::COMPAREMODE_NONE,                                                                                                                         // compare
+               0,                                                                                                                                                                                      // compareChannel
+               tcu::Vec4(0.0f, 0.0f, 0.0f, 0.0f),                                                                                                                      // borderColor
+               true);                                                                                                                                                                          // seamlessCubeMap
        const VkSamplerCreateInfo       createInfo = vk::mapSampler(sampler, vk::mapVkFormat(m_colorFormat));
        variables.descriptorSamplers.push_back(ut::SamplerSp(new Move<VkSampler>(vk::createSampler(m_vki, m_vkd, &createInfo))));
 
index 3305ca7..8fc1b2d 100644 (file)
@@ -506,7 +506,9 @@ tcu::TestStatus ImageAccessTestInstance::executeComputeTest (void)
 
        de::MovePtr<tcu::Texture2D>                     texture2D                       = createTestTexture2D();
        const tcu::Sampler                                      refSampler                      = tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE,
-                                                                                                                                                  tcu::Sampler::NEAREST, tcu::Sampler::NEAREST);
+                                                                                                                                                  tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
+                                                                                                                                                  00.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
+                                                                                                                                                  0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
 
        vk::Unique<vk::VkShaderModule>          computeShader           (vk::createShaderModule(vk, device, ctx.getBinaryCollection().get("comp"), 0));
 
@@ -727,7 +729,9 @@ tcu::TestStatus ImageAccessTestInstance::executeFragmentTest (void)
 
        de::MovePtr<tcu::Texture2D>                     texture2D                       = createTestTexture2D();
        const tcu::Sampler                                      refSampler                      = tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE,
-                                                                                                                                                  tcu::Sampler::NEAREST, tcu::Sampler::NEAREST);
+                                                                                                                                                  tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
+                                                                                                                                                  00.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
+                                                                                                                                                  0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
 
        vk::Move<vk::VkShaderModule>            vertexShader            = createShaderModule(vk, device, ctx.getBinaryCollection().get("vert"), 0);
        vk::Move<vk::VkShaderModule>            fragmentShader          = createShaderModule(vk, device, ctx.getBinaryCollection().get("frag"), 0);
index a0f8aee..dce5f7b 100644 (file)
@@ -235,7 +235,9 @@ tcu::TestStatus StackTestInstance::iterate (void)
 
        de::MovePtr<tcu::Texture2D>                             texture2D                       = createTestTexture2D();
        const tcu::Sampler                                              refSampler                      = tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE,
-                                                                                                                                                          tcu::Sampler::NEAREST, tcu::Sampler::NEAREST);
+                                                                                                                                                          tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
+                                                                                                                                                          00.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
+                                                                                                                                                          0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
 
        vk::Unique<vk::VkShaderModule>                  computeShader           (vk::createShaderModule(vk, device, ctx.getBinaryCollection().get("comp"), 0));
 
index b54e5d8..fa6080f 100644 (file)
@@ -204,7 +204,9 @@ tcu::TestStatus WorkgroupStorageTestInstance::iterate (void)
 
        de::MovePtr<tcu::Texture2D>                             texture2D                       = createTestTexture2D();
        const tcu::Sampler                                              refSampler                      = tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE,
-                                                                                                                                                          tcu::Sampler::NEAREST, tcu::Sampler::NEAREST);
+                                                                                                                                                          tcu::Sampler::NEAREST, tcu::Sampler::NEAREST,
+                                                                                                                                                          00.0f /* LOD threshold */, true /* normalized coords */, tcu::Sampler::COMPAREMODE_NONE,
+                                                                                                                                                          0 /* cmp channel */, tcu::Vec4(0.0f) /* border color */, true /* seamless cube map */);
 
        vk::Unique<vk::VkShaderModule>                  computeShader           (vk::createShaderModule(vk, device, ctx.getBinaryCollection().get("comp"), 0));
 
index 4985620..49b95b2 100644 (file)
@@ -696,9 +696,10 @@ tcu::TestStatus SamplerIndexingCaseInstance::iterate (void)
        const tcu::Sampler                              refSampler                      = isShadowSampler(m_samplerType)
                                                                                                                                ? tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE,
                                                                                                                                                                filterMode, filterMode, 0.0f, false /* non-normalized */,
-                                                                                                                                                               tcu::Sampler::COMPAREMODE_LESS)
+                                                                                                                                                               tcu::Sampler::COMPAREMODE_LESS, 0, tcu::Vec4(0.0f), true)
                                                                                                                                : tcu::Sampler(tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE, tcu::Sampler::CLAMP_TO_EDGE,
-                                                                                                                                                               filterMode, filterMode);
+                                                                                                                                                               filterMode, filterMode, 0.0f, true,
+                                                                                                                                                               tcu::Sampler::COMPAREMODE_NONE, 0, tcu::Vec4(0.0f), true);
 
        const DeviceInterface&                  vkd                                     = m_context.getDeviceInterface();
        const VkDevice                                  device                          = m_context.getDevice();
index 0a8fb33..0d78541 100644 (file)
@@ -1275,7 +1275,13 @@ TextureDerivateCaseInstance::TextureDerivateCaseInstance (Context&                                                       context
                                                                                                                                                                         tcu::Sampler::CLAMP_TO_EDGE,
                                                                                                                                                                         tcu::Sampler::CLAMP_TO_EDGE,
                                                                                                                                                                         tcu::Sampler::NEAREST,
-                                                                                                                                                                        tcu::Sampler::NEAREST)));
+                                                                                                                                                                        tcu::Sampler::NEAREST,
+                                                                                                                                                                        0.0f,
+                                                                                                                                                                        true,
+                                                                                                                                                                        tcu::Sampler::COMPAREMODE_NONE,
+                                                                                                                                                                        0,
+                                                                                                                                                                        tcu::Vec4(0.0f, 0.0f, 0.0f, 0.0f),
+                                                                                                                                                                        true)));
        m_textures.push_back(testTexture);
 }
 
index adb38a7..eff3f04 100644 (file)
@@ -88,7 +88,13 @@ ShaderDiscardCaseInstance::ShaderDiscardCaseInstance (Context&                                       context,
                                                                                                                                                                        tcu::Sampler::CLAMP_TO_EDGE,
                                                                                                                                                                        tcu::Sampler::CLAMP_TO_EDGE,
                                                                                                                                                                        tcu::Sampler::LINEAR,
-                                                                                                                                                                       tcu::Sampler::LINEAR)));
+                                                                                                                                                                       tcu::Sampler::LINEAR,
+                                                                                                                                                                       0.0f,
+                                                                                                                                                                       true,
+                                                                                                                                                                       tcu::Sampler::COMPAREMODE_NONE,
+                                                                                                                                                                       0,
+                                                                                                                                                                       tcu::Vec4(0.0f, 0.0f, 0.0f, 0.0f),
+                                                                                                                                                                       true)));
                m_textures.push_back(brickTexture);
        }
 }
index 08ad7a8..6e6f458 100644 (file)
@@ -1475,9 +1475,10 @@ bool TextureGatherInstance::verify (const ConstPixelBufferAccess&        rendered,
                                                                                                                : m_baseParams.textureType == TEXTURETYPE_2D_ARRAY              ? IVec3(7,7,7)
                                                                                                                : IVec3(-1);
                tcu::Sampler                                    sampler;
-               sampler.wrapS           = m_baseParams.wrapS;
-               sampler.wrapT           = m_baseParams.wrapT;
-               sampler.compare         = m_baseParams.shadowCompareMode;
+               sampler.wrapS               = m_baseParams.wrapS;
+               sampler.wrapT               = m_baseParams.wrapT;
+               sampler.compare             = m_baseParams.shadowCompareMode;
+               sampler.seamlessCubeMap = true;
 
                if (isDepthFormat(m_baseParams.textureFormat))
                {
@@ -1929,7 +1930,8 @@ TextureBindingSp TextureGather2DInstance::createTexture (void)
        MovePtr<tcu::Texture2D>                 texture         = MovePtr<tcu::Texture2D>(new tcu::Texture2D(m_baseParams.textureFormat, m_textureSize.x(), m_textureSize.y()));
        const tcu::Sampler                              sampler         (m_baseParams.wrapS, m_baseParams.wrapT, tcu::Sampler::REPEAT_GL,
                                                                                                 m_baseParams.minFilter, m_baseParams.magFilter,
-                                                                                                0.0f /* LOD threshold */, true /* normalized coords */, m_baseParams.shadowCompareMode);
+                                                                                                0.0f /* LOD threshold */, true /* normalized coords */, m_baseParams.shadowCompareMode,
+                                                                                                0 /* compare channel */, tcu::Vec4(0.0f, 0.0f, 0.0f, 0.0f) /* border color */, true /* seamless cube*/);
 
        {
                const int       levelBegin      = ((m_baseParams.levelMode == LevelMode::NORMAL) ? m_baseParams.baseLevel : 0);
@@ -2150,7 +2152,8 @@ TextureBindingSp TextureGather2DArrayInstance::createTexture (void)
        MovePtr<tcu::Texture2DArray>    texture         = MovePtr<tcu::Texture2DArray>(new tcu::Texture2DArray(m_baseParams.textureFormat, m_textureSize.x(), m_textureSize.y(), m_textureSize.z()));
        const tcu::Sampler                              sampler         (m_baseParams.wrapS, m_baseParams.wrapT, tcu::Sampler::REPEAT_GL,
                                                                                                 m_baseParams.minFilter, m_baseParams.magFilter,
-                                                                                                0.0f /* LOD threshold */, true /* normalized coords */, m_baseParams.shadowCompareMode);
+                                                                                                0.0f /* LOD threshold */, true /* normalized coords */, m_baseParams.shadowCompareMode,
+                                                                                                0 /* compare channel */, tcu::Vec4(0.0f, 0.0f, 0.0f, 0.0f) /* border color */, true /* seamless cube*/);
 
        {
                const int       levelBegin      = ((m_baseParams.levelMode == LevelMode::NORMAL) ? m_baseParams.baseLevel : 0);
index b9966ea..ac3ea57 100644 (file)
@@ -1648,7 +1648,8 @@ tcu::Sampler createSampler (tcu::Sampler::WrapMode wrapU, tcu::Sampler::WrapMode
                                                normalizedCoords /* normalized coords */,
                                                tcu::Sampler::COMPAREMODE_NONE /* no compare */,
                                                0 /* compare channel */,
-                                               tcu::Vec4(0.0f) /* border color, not used */);
+                                               tcu::Vec4(0.0f) /* border color, not used */,
+                                               true /* seamless cube map */);
 }
 
 /*--------------------------------------------------------------------*//*!