Rewrite portability check for Amber tests
authorAri Suonpaa <ari.suonpaa@siru.fi>
Fri, 25 Feb 2022 05:22:59 +0000 (07:22 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 17 Mar 2022 17:46:09 +0000 (17:46 +0000)
Test name based checking has been moved from the Amber test
case class to a callback function defined by the test itself.
Some of the Amber tests were slightly modified to run with
stricter portability requirements to avoid unnecessary support
checking.

VK-GL-CTS Issue: 3514

Affects:

dEQP-VK.draw.renderpass.output_location.*
dEQP-VK.rasterization.line_continuity.*

Components: Vulkan, Framework
Change-Id: I3de6f4c5b1b9218a5294f28aca6e6eea295f9fc1

external/vulkancts/data/vulkan/amber/rasterization/line_continuity/line-strip.amber
external/vulkancts/data/vulkan/amber/rasterization/line_continuity/polygon-mode-lines.amber
external/vulkancts/modules/vulkan/amber/vktAmberTestCase.cpp
external/vulkancts/modules/vulkan/draw/vktDrawOutputLocationTests.cpp

index 4544a4b4224734791a7ae7c627b3af7571b4c09d..7de22c42801cb4d8b4bc070c7017f73bf1b5daf6 100644 (file)
@@ -132,16 +132,16 @@ void main ()
 }
 END
 
-BUFFER position DATA_TYPE R8G8_SNORM DATA
--120 -120
--119  120
- 120  119
-  10   20
- -80   20
- -80   95
- -83   95
- -83  -95
- -85   95
+BUFFER position DATA_TYPE R8G8B8A8_SNORM DATA
+-120 -120   0 127
+-119  120   0 127
+ 120  119   0 127
+  10   20   0 127
+ -80   20   0 127
+ -80   95   0 127
+ -83   95   0 127
+ -83  -95   0 127
+ -85   95   0 127
 END
 
 BUFFER texture FORMAT R8G8B8A8_UNORM
index 5ab2b66050f6b6f408dac1df74385bc5637c3ffa..18c483b34ca1d6805abe5f9f099969d29df3fa91 100644 (file)
@@ -134,18 +134,18 @@ void main ()
 }
 END
 
-BUFFER position DATA_TYPE R8G8_SNORM DATA
--120 -120
-   0  120
- 120 -120
-
-  0     0
-120     0
- 60   -60
-
--100  100
- 110  100
- 110  103
+BUFFER position DATA_TYPE R8G8B8A8_SNORM DATA
+-120 -120  0 127
+   0  120  0 127
+ 120 -120  0 127
+
+  0     0  0 127
+120     0  0 127
+ 60   -60  0 127
+
+-100  100  0 127
+ 110  100  0 127
+ 110  103  0 127
 END
 
 BUFFER texture FORMAT R8G8B8A8_UNORM
index 697b6f1730a83592c7afe2daf679a65279a5a0f0..0fd4a54900ee693996c6155f27c6d94c9594d442 100644 (file)
@@ -198,33 +198,6 @@ void AmberTestCase::checkSupport(Context& ctx) const
                }
        }
 
-       // when checkSupport is called script is not yet parsed so we need to determine
-       // unsupported tests by name ; in AmberTestCase we do not have access to actual
-       // m_recipe implementation - we can't scan it to see if test can be executed;
-       // alternatively portability extension and its features could be checked in amber.cc
-       if (ctx.isDeviceFunctionalitySupported("VK_KHR_portability_subset"))
-       {
-               if (m_name == "triangle_fan" && !ctx.getPortabilitySubsetFeatures().triangleFans)
-                       TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
-
-               if (ctx.getPortabilitySubsetProperties().minVertexInputBindingStrideAlignment == 4)
-               {
-                       const std::set<std::string> casesToSkip
-                       {
-                               "line-strip",
-                               "polygon-mode-lines",
-                               "r8g8-uint-highp",
-                               "r8g8-uint-highp-output-uint",
-                               "r8g8-uint-mediump",
-                               "r8g8-uint-mediump-output-uint",
-                               "inputs-outputs-mod",
-                       };
-
-                       if (casesToSkip.count(m_name))
-                               TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Stride is not multiply of minVertexInputBindingStrideAlignment");
-               }
-       }
-
        if (m_checkSupportCallback)
                (m_checkSupportCallback)(ctx, m_name);
 }
index 577193a186818b69568d31e65487493471eacec9..28d662ca6960d2927a513389c76c1226e8901bd6 100644 (file)
@@ -37,6 +37,16 @@ namespace Draw
 namespace
 {
 
+void checkSupport (Context& context, std::string testName)
+{
+       if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset")
+               && context.getPortabilitySubsetProperties().minVertexInputBindingStrideAlignment == 4
+               && (testName.find("r8g8") != std::string::npos || testName.find("inputs-outputs-mod") != std::string::npos))
+       {
+               TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Stride is not a multiple of minVertexInputBindingStrideAlignment");
+       }
+}
+
 void createTests (tcu::TestCaseGroup* testGroup)
 {
        tcu::TestContext& testCtx = testGroup->getTestContext();
@@ -85,6 +95,7 @@ void createTests (tcu::TestCaseGroup* testGroup)
                        const std::string                       fileName        = cases[i] + ".amber";
                        cts_amber::AmberTestCase*       testCase        = cts_amber::createAmberTestCase(testCtx, cases[i].c_str(), "", dataDir, fileName);
 
+                       testCase->setCheckSupportCallback(checkSupport);
                        array->addChild(testCase);
                }
        }