TCU_THROW(NotSupportedError, "Buffer format doesn't support required feature flags");
}
}
+
+ if (m_name == "triangle_fan" &&
+ ctx.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !ctx.getPortabilitySubsetFeatures().triangleFans)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
}
class Delegate : public amber::Delegate
programCollection.glslSources.add("compute_increment") << glu::ComputeSource(bufIncrement.str());
}
-void genComputeIncrementSourceBadInheritance (SourceCollections& programCollection, BadInheritanceInfoCase testCase)
+void genComputeIncrementSourceBadInheritance(SourceCollections& programCollection, BadInheritanceInfoCase testCase)
{
DE_UNREF(testCase);
return genComputeIncrementSource(programCollection);
}
+void checkEventSupport (Context& context)
+{
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") && !context.getPortabilitySubsetFeatures().events)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Events are not supported by this implementation");
+}
+
+void checkEventSupport (Context& context, const VkCommandBufferLevel)
+{
+ checkEventSupport(context);
+}
+
} // anonymous
tcu::TestCaseGroup* createCommandBuffersTests (tcu::TestContext& testCtx)
addFunctionCase (commandBuffersTests.get(), "pool_create_reset_bit", "", createPoolResetBitTest);
addFunctionCase (commandBuffersTests.get(), "pool_reset_release_res", "", resetPoolReleaseResourcesBitTest);
addFunctionCase (commandBuffersTests.get(), "pool_reset_no_flags_res", "", resetPoolNoFlagsTest);
- addFunctionCase (commandBuffersTests.get(), "pool_reset_reuse", "", resetPoolReuseTest);
+ addFunctionCase (commandBuffersTests.get(), "pool_reset_reuse", "", checkEventSupport, resetPoolReuseTest);
/* 19.2. Command Buffer Lifetime (5.2 in VK 1.0 Spec) */
addFunctionCase (commandBuffersTests.get(), "allocate_single_primary", "", allocatePrimaryBufferTest);
addFunctionCase (commandBuffersTests.get(), "allocate_many_primary", "", allocateManyPrimaryBuffersTest);
addFunctionCase (commandBuffersTests.get(), "allocate_single_secondary", "", allocateSecondaryBufferTest);
addFunctionCase (commandBuffersTests.get(), "allocate_many_secondary", "", allocateManySecondaryBuffersTest);
- addFunctionCase (commandBuffersTests.get(), "execute_small_primary", "", executePrimaryBufferTest);
- addFunctionCase (commandBuffersTests.get(), "execute_large_primary", "", executeLargePrimaryBufferTest);
- addFunctionCase (commandBuffersTests.get(), "reset_implicit", "", resetBufferImplicitlyTest);
- addFunctionCase (commandBuffersTests.get(), "trim_command_pool", "", trimCommandPoolTest, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
- addFunctionCase (commandBuffersTests.get(), "trim_command_pool_secondary", "", trimCommandPoolTest, VK_COMMAND_BUFFER_LEVEL_SECONDARY);
+ addFunctionCase (commandBuffersTests.get(), "execute_small_primary", "", checkEventSupport, executePrimaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "execute_large_primary", "", checkEventSupport, executeLargePrimaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "reset_implicit", "", checkEventSupport, resetBufferImplicitlyTest);
+ addFunctionCase (commandBuffersTests.get(), "trim_command_pool", "", checkEventSupport, trimCommandPoolTest, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
+ addFunctionCase (commandBuffersTests.get(), "trim_command_pool_secondary", "", checkEventSupport, trimCommandPoolTest, VK_COMMAND_BUFFER_LEVEL_SECONDARY);
/* 19.3. Command Buffer Recording (5.3 in VK 1.0 Spec) */
- addFunctionCase (commandBuffersTests.get(), "record_single_primary", "", recordSinglePrimaryBufferTest);
- addFunctionCase (commandBuffersTests.get(), "record_many_primary", "", recordLargePrimaryBufferTest);
- addFunctionCase (commandBuffersTests.get(), "record_single_secondary", "", recordSingleSecondaryBufferTest);
- addFunctionCase (commandBuffersTests.get(), "record_many_secondary", "", recordLargeSecondaryBufferTest);
- addFunctionCase (commandBuffersTests.get(), "submit_twice_primary", "", submitPrimaryBufferTwiceTest);
- addFunctionCase (commandBuffersTests.get(), "submit_twice_secondary", "", submitSecondaryBufferTwiceTest);
- addFunctionCase (commandBuffersTests.get(), "record_one_time_submit_primary", "", oneTimeSubmitFlagPrimaryBufferTest);
- addFunctionCase (commandBuffersTests.get(), "record_one_time_submit_secondary", "", oneTimeSubmitFlagSecondaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "record_single_primary", "", checkEventSupport, recordSinglePrimaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "record_many_primary", "", checkEventSupport, recordLargePrimaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "record_single_secondary", "", checkEventSupport, recordSingleSecondaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "record_many_secondary", "", checkEventSupport, recordLargeSecondaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "submit_twice_primary", "", checkEventSupport, submitPrimaryBufferTwiceTest);
+ addFunctionCase (commandBuffersTests.get(), "submit_twice_secondary", "", checkEventSupport, submitSecondaryBufferTwiceTest);
+ addFunctionCase (commandBuffersTests.get(), "record_one_time_submit_primary", "", checkEventSupport, oneTimeSubmitFlagPrimaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "record_one_time_submit_secondary", "", checkEventSupport, oneTimeSubmitFlagSecondaryBufferTest);
addFunctionCase (commandBuffersTests.get(), "render_pass_continue", "", renderPassContinueTest, true);
addFunctionCase (commandBuffersTests.get(), "render_pass_continue_no_fb", "", renderPassContinueTest, false);
- addFunctionCase (commandBuffersTests.get(), "record_simul_use_primary", "", simultaneousUsePrimaryBufferTest);
- addFunctionCase (commandBuffersTests.get(), "record_simul_use_secondary", "", simultaneousUseSecondaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "record_simul_use_primary", "", checkEventSupport, simultaneousUsePrimaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "record_simul_use_secondary", "", checkEventSupport, simultaneousUseSecondaryBufferTest);
addFunctionCaseWithPrograms (commandBuffersTests.get(), "record_simul_use_secondary_one_primary", "", genComputeIncrementSource, simultaneousUseSecondaryBufferOnePrimaryBufferTest);
addFunctionCaseWithPrograms (commandBuffersTests.get(), "record_simul_use_secondary_two_primary", "", genComputeIncrementSource, simultaneousUseSecondaryBufferTwoPrimaryBuffersTest);
addFunctionCase (commandBuffersTests.get(), "record_query_precise_w_flag", "", recordBufferQueryPreciseWithFlagTest);
addFunctionCaseWithPrograms (commandBuffersTests.get(), "bad_inheritance_info_invalid_type", "", genComputeIncrementSourceBadInheritance, badInheritanceInfoTest, BadInheritanceInfoCase::INVALID_STRUCTURE_TYPE);
addFunctionCaseWithPrograms (commandBuffersTests.get(), "bad_inheritance_info_valid_nonsense_type", "", genComputeIncrementSourceBadInheritance, badInheritanceInfoTest, BadInheritanceInfoCase::VALID_NONSENSE_TYPE);
/* 19.4. Command Buffer Submission (5.4 in VK 1.0 Spec) */
- addFunctionCase (commandBuffersTests.get(), "submit_count_non_zero", "", submitBufferCountNonZero);
- addFunctionCase (commandBuffersTests.get(), "submit_count_equal_zero", "", submitBufferCountEqualZero);
- addFunctionCase (commandBuffersTests.get(), "submit_wait_single_semaphore", "", submitBufferWaitSingleSemaphore);
- addFunctionCase (commandBuffersTests.get(), "submit_wait_many_semaphores", "", submitBufferWaitManySemaphores);
- addFunctionCase (commandBuffersTests.get(), "submit_null_fence", "", submitBufferNullFence);
- addFunctionCase (commandBuffersTests.get(), "submit_two_buffers_one_buffer_null_with_fence", "", submitTwoBuffersOneBufferNullWithFence);
+ addFunctionCase (commandBuffersTests.get(), "submit_count_non_zero", "", checkEventSupport, submitBufferCountNonZero);
+ addFunctionCase (commandBuffersTests.get(), "submit_count_equal_zero", "", checkEventSupport, submitBufferCountEqualZero);
+ addFunctionCase (commandBuffersTests.get(), "submit_wait_single_semaphore", "", checkEventSupport, submitBufferWaitSingleSemaphore);
+ addFunctionCase (commandBuffersTests.get(), "submit_wait_many_semaphores", "", checkEventSupport, submitBufferWaitManySemaphores);
+ addFunctionCase (commandBuffersTests.get(), "submit_null_fence", "", checkEventSupport, submitBufferNullFence);
+ addFunctionCase (commandBuffersTests.get(), "submit_two_buffers_one_buffer_null_with_fence", "", checkEventSupport, submitTwoBuffersOneBufferNullWithFence);
/* 19.5. Secondary Command Buffer Execution (5.6 in VK 1.0 Spec) */
- addFunctionCase (commandBuffersTests.get(), "secondary_execute", "", executeSecondaryBufferTest);
- addFunctionCase (commandBuffersTests.get(), "secondary_execute_twice", "", executeSecondaryBufferTwiceTest);
+ addFunctionCase (commandBuffersTests.get(), "secondary_execute", "", checkEventSupport, executeSecondaryBufferTest);
+ addFunctionCase (commandBuffersTests.get(), "secondary_execute_twice", "", checkEventSupport, executeSecondaryBufferTwiceTest);
/* 19.6. Commands Allowed Inside Command Buffers (? in VK 1.0 Spec) */
addFunctionCaseWithPrograms (commandBuffersTests.get(), "order_bind_pipeline", "", genComputeSource, orderBindPipelineTest);
/* Verify untested transitions between command buffer states */
return tcu::TestStatus::pass("Pass");
}
+
+template<class TestConfig> void checkEvent (Context& context, const TestConfig)
+{
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") && !context.getPortabilitySubsetFeatures().events)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Events are not supported by this implementation");
+}
+
+template<class TestConfig> void checkSupport (Context& context, const TestConfig config)
+{
+ const Transference transference (getHandelTypeTransferences(config.externalType));
+ if (transference == TRANSFERENCE_COPY)
+ checkEvent(context, config);
+}
+
de::MovePtr<tcu::TestCaseGroup> createFenceTests (tcu::TestContext& testCtx, vk::VkExternalFenceHandleTypeFlagBits externalType)
{
const struct
addFunctionCase(fenceGroup.get(), std::string("create_win32_") + permanenceName, "Test creating fence with win32 properties.", testFenceWin32Create, config);
}
- addFunctionCase(fenceGroup.get(), std::string("import_twice_") + permanenceName, "Test importing fence twice.", testFenceImportTwice, config);
- addFunctionCase(fenceGroup.get(), std::string("reimport_") + permanenceName, "Test importing again over previously imported fence.", testFenceImportReimport, config);
- addFunctionCase(fenceGroup.get(), std::string("import_multiple_times_") + permanenceName, "Test importing fence multiple times.", testFenceMultipleImports, config);
- addFunctionCase(fenceGroup.get(), std::string("signal_export_import_wait_") + permanenceName, "Test signaling, exporting, importing and waiting for the sempahore.", testFenceSignalExportImportWait, config);
- addFunctionCase(fenceGroup.get(), std::string("signal_import_") + permanenceName, "Test signaling and importing the fence.", testFenceSignalImport, config);
- addFunctionCase(fenceGroup.get(), std::string("reset_") + permanenceName, "Test resetting the fence.", testFenceReset, config);
- addFunctionCase(fenceGroup.get(), std::string("transference_") + permanenceName, "Test fences transference.", testFenceTransference, config);
+ addFunctionCase(fenceGroup.get(), std::string("import_twice_") + permanenceName, "Test importing fence twice.", checkSupport, testFenceImportTwice, config);
+ addFunctionCase(fenceGroup.get(), std::string("reimport_") + permanenceName, "Test importing again over previously imported fence.", checkSupport, testFenceImportReimport, config);
+ addFunctionCase(fenceGroup.get(), std::string("import_multiple_times_") + permanenceName, "Test importing fence multiple times.", checkSupport, testFenceMultipleImports, config);
+ addFunctionCase(fenceGroup.get(), std::string("signal_export_import_wait_") + permanenceName, "Test signaling, exporting, importing and waiting for the sempahore.", checkEvent, testFenceSignalExportImportWait, config);
+ addFunctionCase(fenceGroup.get(), std::string("signal_import_") + permanenceName, "Test signaling and importing the fence.", checkSupport, testFenceSignalImport, config);
+ addFunctionCase(fenceGroup.get(), std::string("reset_") + permanenceName, "Test resetting the fence.", checkEvent, testFenceReset, config);
+ addFunctionCase(fenceGroup.get(), std::string("transference_") + permanenceName, "Test fences transference.", checkEvent, testFenceTransference, config);
if (externalType == vk::VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT)
{
|| externalType == vk::VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT)
{
// \note Not supported on WIN32 handles
- addFunctionCase(fenceGroup.get(), std::string("export_multiple_times_") + permanenceName, "Test exporting fence multiple times.", testFenceMultipleExports, config);
+ addFunctionCase(fenceGroup.get(), std::string("export_multiple_times_") + permanenceName, "Test exporting fence multiple times.", checkSupport, testFenceMultipleExports, config);
- addFunctionCase(fenceGroup.get(), std::string("dup_") + permanenceName, "Test calling dup() on exported fence.", testFenceFdDup, config);
- addFunctionCase(fenceGroup.get(), std::string("dup2_") + permanenceName, "Test calling dup2() on exported fence.", testFenceFdDup2, config);
- addFunctionCase(fenceGroup.get(), std::string("dup3_") + permanenceName, "Test calling dup3() on exported fence.", testFenceFdDup3, config);
- addFunctionCase(fenceGroup.get(), std::string("send_over_socket_") + permanenceName, "Test sending fence fd over socket.", testFenceFdSendOverSocket, config);
+ addFunctionCase(fenceGroup.get(), std::string("dup_") + permanenceName, "Test calling dup() on exported fence.", checkSupport, testFenceFdDup, config);
+ addFunctionCase(fenceGroup.get(), std::string("dup2_") + permanenceName, "Test calling dup2() on exported fence.", checkSupport, testFenceFdDup2, config);
+ addFunctionCase(fenceGroup.get(), std::string("dup3_") + permanenceName, "Test calling dup3() on exported fence.", checkSupport, testFenceFdDup3, config);
+ addFunctionCase(fenceGroup.get(), std::string("send_over_socket_") + permanenceName, "Test sending fence fd over socket.", checkSupport, testFenceFdSendOverSocket, config);
}
if (getHandelTypeTransferences(externalType) == TRANSFERENCE_REFERENCE)
addFunctionCase(semaphoreGroup.get(), std::string("create_win32_") + permanenceName, "Test creating semaphore with win32 properties.", testSemaphoreWin32Create, config);
}
- addFunctionCase(semaphoreGroup.get(), std::string("import_twice_") + permanenceName, "Test importing semaphore twice.", testSemaphoreImportTwice, config);
- addFunctionCase(semaphoreGroup.get(), std::string("reimport_") + permanenceName, "Test importing again over previously imported semaphore.", testSemaphoreImportReimport, config);
- addFunctionCase(semaphoreGroup.get(), std::string("import_multiple_times_") + permanenceName, "Test importing semaphore multiple times.", testSemaphoreMultipleImports, config);
- addFunctionCase(semaphoreGroup.get(), std::string("signal_export_import_wait_") + permanenceName, "Test signaling, exporting, importing and waiting for the sempahore.", testSemaphoreSignalExportImportWait, config);
- addFunctionCase(semaphoreGroup.get(), std::string("signal_import_") + permanenceName, "Test signaling and importing the semaphore.", testSemaphoreSignalImport, config);
- addFunctionCase(semaphoreGroup.get(), std::string("transference_") + permanenceName, "Test semaphores transference.", testSemaphoreTransference, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("import_twice_") + permanenceName, "Test importing semaphore twice.", checkSupport, testSemaphoreImportTwice, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("reimport_") + permanenceName, "Test importing again over previously imported semaphore.", checkSupport, testSemaphoreImportReimport, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("import_multiple_times_") + permanenceName, "Test importing semaphore multiple times.", checkSupport, testSemaphoreMultipleImports, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("signal_export_import_wait_") + permanenceName, "Test signaling, exporting, importing and waiting for the sempahore.", checkEvent, testSemaphoreSignalExportImportWait, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("signal_import_") + permanenceName, "Test signaling and importing the semaphore.", checkSupport, testSemaphoreSignalImport, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("transference_") + permanenceName, "Test semaphores transference.", checkEvent, testSemaphoreTransference, config);
if (externalType == vk::VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT)
{
|| externalType == vk::VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT)
{
// \note Not supported on WIN32 handles
- addFunctionCase(semaphoreGroup.get(), std::string("export_multiple_times_") + permanenceName, "Test exporting semaphore multiple times.", testSemaphoreMultipleExports, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("export_multiple_times_") + permanenceName, "Test exporting semaphore multiple times.", checkSupport, testSemaphoreMultipleExports, config);
- addFunctionCase(semaphoreGroup.get(), std::string("dup_") + permanenceName, "Test calling dup() on exported semaphore.", testSemaphoreFdDup, config);
- addFunctionCase(semaphoreGroup.get(), std::string("dup2_") + permanenceName, "Test calling dup2() on exported semaphore.", testSemaphoreFdDup2, config);
- addFunctionCase(semaphoreGroup.get(), std::string("dup3_") + permanenceName, "Test calling dup3() on exported semaphore.", testSemaphoreFdDup3, config);
- addFunctionCase(semaphoreGroup.get(), std::string("send_over_socket_") + permanenceName, "Test sending semaphore fd over socket.", testSemaphoreFdSendOverSocket, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("dup_") + permanenceName, "Test calling dup() on exported semaphore.", checkSupport, testSemaphoreFdDup, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("dup2_") + permanenceName, "Test calling dup2() on exported semaphore.", checkSupport, testSemaphoreFdDup2, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("dup3_") + permanenceName, "Test calling dup3() on exported semaphore.", checkSupport, testSemaphoreFdDup3, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("send_over_socket_") + permanenceName, "Test sending semaphore fd over socket.", checkSupport, testSemaphoreFdSendOverSocket, config);
}
if (getHandelTypeTransferences(externalType) == TRANSFERENCE_REFERENCE)
{
addFunctionCase(semaphoreGroup.get(), std::string("signal_wait_import_") + permanenceName, "Test signaling and then waiting for the the sepmahore.", testSemaphoreSignalWaitImport, config);
addFunctionCase(semaphoreGroup.get(), std::string("export_signal_import_wait_") + permanenceName, "Test exporting, signaling, importing and waiting for the semaphore.", testSemaphoreExportSignalImportWait, config);
- addFunctionCase(semaphoreGroup.get(), std::string("export_import_signal_wait_") + permanenceName, "Test exporting, importing, signaling and waiting for the semaphore.", testSemaphoreExportImportSignalWait, config);
+ addFunctionCase(semaphoreGroup.get(), std::string("export_import_signal_wait_") + permanenceName, "Test exporting, importing, signaling and waiting for the semaphore.", checkEvent, testSemaphoreExportImportSignalWait, config);
}
}
}
}
+void checkEventSupport (Context& context)
+{
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") && !context.getPortabilitySubsetFeatures().events)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Events are not supported by this implementation");
+}
+
void addTestsToGroup (tcu::TestCaseGroup* group)
{
addFunctionCase(group, "destroy_buffer", "", test<VkBuffer>);
addFunctionCase(group, "destroy_descriptor_pool", "", test<VkDescriptorPool>);
addFunctionCase(group, "destroy_descriptor_set_layout", "", test<VkDescriptorSetLayout>);
addFunctionCase(group, "destroy_device", "", test<VkDevice>);
- addFunctionCase(group, "destroy_event", "", test<VkEvent>);
+ addFunctionCase(group, "destroy_event", "", checkEventSupport, test<VkEvent>);
addFunctionCase(group, "destroy_fence", "", test<VkFence>);
addFunctionCase(group, "destroy_framebuffer", "", test<VkFramebuffer>);
addFunctionCase(group, "destroy_image", "", test<VkImage>);
addFunctionCase(group, cur->name, "", cases.function, cur->parameters);
}
+void checkEventSupport (Context& context, const Event::Parameters)
+{
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") && !context.getPortabilitySubsetFeatures().events)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Events are not supported by this implementation");
+}
+
+// specialization for Event
+template<>
+void addCases (tcu::TestCaseGroup* group, const CaseDescription<Event>& cases)
+{
+ for (const NamedParameters<Event>* cur = cases.paramsBegin; cur != cases.paramsEnd; ++cur)
+ addFunctionCase(group, cur->name, "", checkEventSupport, cases.function, cur->parameters);
+}
+
template<typename Object>
void addCasesWithProgs (tcu::TestCaseGroup *group, const CaseDescription<Object>& cases)
{
} // ClipDistanceComplementarity ns
+void checkTopologySupport(Context& context, const VkPrimitiveTopology topology)
+{
+ if (topology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().triangleFans)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
+}
+
void addClippingTests (tcu::TestCaseGroup* clippingTestsGroup)
{
tcu::TestContext& testCtx = clippingTestsGroup->getTestContext();
for (int caseNdx = 0; caseNdx < DE_LENGTH_OF_ARRAY(cases); ++caseNdx)
addFunctionCaseWithPrograms<VkPrimitiveTopology>(
- group.get(), getPrimitiveTopologyShortName(cases[caseNdx]), "", initPrograms, testPrimitivesInside, cases[caseNdx]);
+ group.get(), getPrimitiveTopologyShortName(cases[caseNdx]), "", checkTopologySupport, initPrograms, testPrimitivesInside, cases[caseNdx]);
clipVolumeGroup->addChild(group.release());
}
for (int caseNdx = 0; caseNdx < DE_LENGTH_OF_ARRAY(cases); ++caseNdx)
addFunctionCaseWithPrograms<VkPrimitiveTopology>(
- group.get(), getPrimitiveTopologyShortName(cases[caseNdx]), "", initPrograms, testPrimitivesOutside, cases[caseNdx]);
+ group.get(), getPrimitiveTopologyShortName(cases[caseNdx]), "", checkTopologySupport, initPrograms, testPrimitivesOutside, cases[caseNdx]);
clipVolumeGroup->addChild(group.release());
}
for (int caseNdx = 0; caseNdx < DE_LENGTH_OF_ARRAY(cases); ++caseNdx)
addFunctionCaseWithPrograms<VkPrimitiveTopology>(
- group.get(), getPrimitiveTopologyShortName(cases[caseNdx]), "", initPrograms, testPrimitivesDepthClamp, cases[caseNdx]);
+ group.get(), getPrimitiveTopologyShortName(cases[caseNdx]), "", checkTopologySupport, initPrograms, testPrimitivesDepthClamp, cases[caseNdx]);
clipVolumeGroup->addChild(group.release());
}
for (int caseNdx = 0; caseNdx < DE_LENGTH_OF_ARRAY(cases); ++caseNdx)
addFunctionCaseWithPrograms<VkPrimitiveTopology>(
- group.get(), getPrimitiveTopologyShortName(cases[caseNdx]), "", initPrograms, testPrimitivesDepthClip, cases[caseNdx]);
+ group.get(), getPrimitiveTopologyShortName(cases[caseNdx]), "", checkTopologySupport, initPrograms, testPrimitivesDepthClip, cases[caseNdx]);
clipVolumeGroup->addChild(group.release());
}
context.requireDeviceFunctionality("VK_EXT_conditional_rendering");
}
+void checkFan (Context& context)
+{
+ checkSupport(context);
+
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().triangleFans)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
+}
+
} // unnamed namespace
ConditionalRenderingDrawAndClearTests::ConditionalRenderingDrawAndClearTests (tcu::TestContext &testCtx)
depth->addChild(new InstanceFactory1WithSupport<ConditionalRenderingClearAttachmentsTestInstance, ClearTestParams, FunctionSupport0>(m_testCtx, tcu::NODETYPE_SELF_VALIDATE, "clear_attachment_twice_" + generateClearTestName(clearDepthTwiceGrid[testNdx]), "Depth clear test.", clearDepthTwiceGrid[testNdx], checkSupport));
for (int testNdx = 0; testNdx < DE_LENGTH_OF_ARRAY(drawTestGrid); testNdx++)
- draw->addChild(new InstanceFactory1WithSupport<ConditionalRenderingDrawTestInstance, DrawTestParams, FunctionSupport0, AddProgramsDraw>(m_testCtx, tcu::NODETYPE_SELF_VALIDATE, "case_" + de::toString(testNdx), "Draw test.", AddProgramsDraw(), drawTestGrid[testNdx], checkSupport));
+ draw->addChild(new InstanceFactory1WithSupport<ConditionalRenderingDrawTestInstance, DrawTestParams, FunctionSupport0, AddProgramsDraw>(m_testCtx, tcu::NODETYPE_SELF_VALIDATE, "case_" + de::toString(testNdx), "Draw test.", AddProgramsDraw(), drawTestGrid[testNdx], checkFan));
- draw->addChild(new InstanceFactory1WithSupport<ConditionalRenderingUpdateBufferWithDrawTestInstance, bool, FunctionSupport0, AddProgramsUpdateBufferUsingRendering>(m_testCtx, tcu::NODETYPE_SELF_VALIDATE, "update_with_rendering_no_discard", "Draw test.", AddProgramsUpdateBufferUsingRendering(), true, checkSupport));
- draw->addChild(new InstanceFactory1WithSupport<ConditionalRenderingUpdateBufferWithDrawTestInstance, bool, FunctionSupport0, AddProgramsUpdateBufferUsingRendering>(m_testCtx, tcu::NODETYPE_SELF_VALIDATE, "update_with_rendering_discard", "Draw test.", AddProgramsUpdateBufferUsingRendering(), false, checkSupport));
+ draw->addChild(new InstanceFactory1WithSupport<ConditionalRenderingUpdateBufferWithDrawTestInstance, bool, FunctionSupport0, AddProgramsUpdateBufferUsingRendering>(m_testCtx, tcu::NODETYPE_SELF_VALIDATE, "update_with_rendering_no_discard", "Draw test.", AddProgramsUpdateBufferUsingRendering(), true, checkFan));
+ draw->addChild(new InstanceFactory1WithSupport<ConditionalRenderingUpdateBufferWithDrawTestInstance, bool, FunctionSupport0, AddProgramsUpdateBufferUsingRendering>(m_testCtx, tcu::NODETYPE_SELF_VALIDATE, "update_with_rendering_discard", "Draw test.", AddProgramsUpdateBufferUsingRendering(), false, checkFan));
clear->addChild(color);
clear->addChild(depth);
{
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER);
}
+
+ if (m_data.topology == vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().triangleFans)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
}
template<typename T>
TCU_THROW(NotSupportedError, "Implementation does not support multiview feature");
}
}
+
+ if (m_params.topology == vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().triangleFans)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
}
TestInstance* createInstance (Context& context) const
void GeometryExpanderRenderTest::checkSupport (Context& context) const
{
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER);
+
+ if (m_primitiveType == vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().triangleFans)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
}
void GeometryExpanderRenderTest::initPrograms (SourceCollections& sourceCollections) const
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER);
if (params.image.viewType == VK_IMAGE_VIEW_TYPE_3D)
+ {
context.requireDeviceFunctionality("VK_KHR_maintenance1");
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().imageView2DOn3DImage)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Implementation does not support 2D or 2D array image view to be created on a 3D VkImage");
+ }
+ }
+
if (params.testType == TEST_TYPE_SECONDARY_CMD_BUFFER)
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_FRAGMENT_STORES_AND_ATOMICS);
}
if (differenceFound)
{
+ const auto portabilitySubsetFeatures = context.getPortabilitySubsetFeatures();
+ if (!portabilitySubsetFeatures.imageViewFormatReinterpretation)
+ {
+ tcu::TextureFormat textureImageFormat = vk::mapVkFormat(m_parameters.featuredFormat);
+ tcu::TextureFormat textureViewFormat = vk::mapVkFormat(featurelessFormat);
+
+ if (tcu::getTextureFormatBitDepth(textureImageFormat) != tcu::getTextureFormatBitDepth(textureViewFormat))
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Format must not contain a different number of bits in each component, than the format of the VkImage");
+ }
+
TestParameters calculatedParameters =
{
m_parameters.operation, // Operation operation
context.requireDeviceFunctionality("VK_EXT_external_memory_host");
}
+void checkEvent (Context& context)
+{
+ checkSupport(context);
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") && !context.getPortabilitySubsetFeatures().events)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Events are not supported by this implementation");
+}
+
} // unnamed namespace
tcu::TestCaseGroup* createMemoryExternalMemoryHostTests (tcu::TestContext& testCtx)
synchronization->addChild(new InstanceFactory1WithSupport<ExternalMemoryHostSynchronizationTestInstance, TestParams, FunctionSupport0, AddPrograms> (testCtx, tcu::NODETYPE_SELF_VALIDATE,
"synchronization", "synchronization", AddPrograms(),
- TestParams(testFormats[0].format, true), checkSupport));
+ TestParams(testFormats[0].format, true), checkEvent));
group->addChild(synchronization.release());
return group.release();
}
{
if (!isSupportedBlendFormat(context.getInstanceInterface(), context.getPhysicalDevice(), m_colorFormat))
throw tcu::NotSupportedError(std::string("Unsupported color blending format: ") + getFormatName(m_colorFormat));
+
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().constantAlphaColorBlendFactors)
+ {
+ int quadNdx = 0;
+ for (; quadNdx < BlendTest::QUAD_COUNT; quadNdx++)
+ {
+ const VkPipelineColorBlendAttachmentState& blendState = m_blendStates[quadNdx];
+ if (blendState.srcColorBlendFactor == VK_BLEND_FACTOR_CONSTANT_ALPHA ||
+ blendState.dstColorBlendFactor == VK_BLEND_FACTOR_CONSTANT_ALPHA ||
+ blendState.srcColorBlendFactor == VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA ||
+ blendState.dstColorBlendFactor == VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA)
+ {
+ break;
+ }
+ }
+ if (quadNdx < BlendTest::QUAD_COUNT)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Constant alpha color blend factors are not supported by this implementation");
+ }
}
void BlendTest::initPrograms (SourceCollections& sourceCollections) const
if (params.allocationKind == ALLOCATION_KIND_DEDICATED)
context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
+
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset"))
+ {
+ const auto portabilitySubsetFeatures = context.getPortabilitySubsetFeatures();
+ const auto componentMapping = params.componentMapping;
+ if (!portabilitySubsetFeatures.imageViewFormatSwizzle &&
+ ((componentMapping.r != VK_COMPONENT_SWIZZLE_IDENTITY) ||
+ (componentMapping.g != VK_COMPONENT_SWIZZLE_IDENTITY) ||
+ (componentMapping.b != VK_COMPONENT_SWIZZLE_IDENTITY) ||
+ (componentMapping.a != VK_COMPONENT_SWIZZLE_IDENTITY)))
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Implementation does not support remapping format components");
+ }
+ }
}
ImageSamplingInstance::ImageSamplingInstance (Context& context,
default:
break;
}
+
+ if (m_primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().triangleFans)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
}
TestInstance* InputAssemblyTest::createInstance (Context& context) const
tcu::TestStatus MSInstanceBaseResolve::iterate (void)
{
+ // cases creating this tests are defined using templates and we do not have easy access
+ // to image type - to do this check in checkSupport bigger reffactoring would be needed
+ if (m_context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !m_context.getPortabilitySubsetFeatures().multisampleArrayImage &&
+ (m_imageType == IMAGE_TYPE_2D_ARRAY) &&
+ (m_imageMSParams.numSamples != VK_SAMPLE_COUNT_1_BIT) &&
+ (m_imageMSParams.imageSize.z() != 1))
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Implementation does not support image array with multiple samples per texel");
+ }
+
const InstanceInterface& instance = m_context.getInstanceInterface();
const DeviceInterface& deviceInterface = m_context.getDeviceInterface();
const VkDevice device = m_context.getDevice();
const VkImageUsageFlags colorImageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
checkImageFormatRequirements(context.getInstanceInterface(), context.getPhysicalDevice(), caseDef.numSamples, caseDef.colorFormat, colorImageUsage);
+
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().multisampleArrayImage &&
+ (caseDef.numSamples != VK_SAMPLE_COUNT_1_BIT) && (caseDef.numLayers != 1))
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Implementation does not support image array with multiple samples per texel");
+ }
}
tcu::TestStatus test (Context& context, const CaseDef caseDef)
void init (void);
void initPrograms (vk::SourceCollections& programCollection) const;
- virtual void checkSupport (Context&) const {}
+ void checkSupport (Context& context) const;
TestInstance* createInstance (Context& context) const;
static MultisampleCaseBase* createCase (tcu::TestContext& testCtx,
const std::string& name,
};
template <typename CaseClassName>
+void MSCase<CaseClassName>::checkSupport (Context& context) const
+{
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().shaderSampleRateInterpolationFunctions)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Shader sample rate interpolation functions are not supported by this implementation");
+ }
+
+ context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING);
+}
+
+template <typename CaseClassName>
MultisampleCaseBase* MSCase<CaseClassName>::createCase (tcu::TestContext& testCtx, const std::string& name, const ImageMSParams& imageMSParams)
{
return new MSCase<CaseClassName>(testCtx, name, imageMSParams);
programCollection.glslSources.add("fragment_shader") << glu::FragmentSource(fs.str());
}
-template<> void MSCase<MSCaseInterpolateAtSampleDistinctValues>::checkSupport (Context& context) const
-{
- context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING);
-}
-
template<> TestInstance* MSCase<MSCaseInterpolateAtSampleDistinctValues>::createInstance (Context& context) const
{
return new MSInstance<MSInstanceDistinctValues>(context, m_imageMSParams);
programCollection.glslSources.add("fragment_shader") << glu::FragmentSource(fs.str());
}
-template<> void MSCase<MSCaseInterpolateAtSampleSingleSample>::checkSupport (Context& context) const
-{
- context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING);
-}
-
template<> TestInstance* MSCase<MSCaseInterpolateAtSampleSingleSample>::createInstance (Context& context) const
{
return new MSInstance<MSInstanceInterpolateScreenPosition>(context, m_imageMSParams);
programCollection.glslSources.add("fragment_shader") << glu::FragmentSource(fs.str());
}
-template<> void MSCase<MSCaseInterpolateAtSampleIgnoresCentroid>::checkSupport (Context& context) const
-{
- context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING);
-}
-
template<> TestInstance* MSCase<MSCaseInterpolateAtSampleIgnoresCentroid>::createInstance (Context& context) const
{
return new MSInstance<MSInstanceInterpolateScreenPosition>(context, m_imageMSParams);
programCollection.glslSources.add("fragment_shader") << glu::FragmentSource(fs.str());
}
-template<> void MSCase<MSCaseInterpolateAtSampleConsistency>::checkSupport (Context& context) const
-{
- context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING);
-}
-
template<> TestInstance* MSCase<MSCaseInterpolateAtSampleConsistency>::createInstance (Context& context) const
{
return new MSInstance<MSInstanceInterpolateScreenPosition>(context, m_imageMSParams);
programCollection.glslSources.add("fragment_shader") << glu::FragmentSource(fs.str());
}
-template<> void MSCase<MSCaseInterpolateAtCentroidConsistency>::checkSupport (Context& context) const
-{
- context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING);
-}
-
template<> TestInstance* MSCase<MSCaseInterpolateAtCentroidConsistency>::createInstance (Context& context) const
{
return new MSInstance<MSInstanceInterpolateScreenPosition>(context, m_imageMSParams);
programCollection.glslSources.add("fragment_shader") << glu::FragmentSource(fs.str());
}
-template<> void MSCase<MSCaseInterpolateAtOffsetPixelCenter>::checkSupport (Context& context) const
-{
- context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING);
-}
-
template<> TestInstance* MSCase<MSCaseInterpolateAtOffsetPixelCenter>::createInstance (Context& context) const
{
return new MSInstance<MSInstanceInterpolateScreenPosition>(context, m_imageMSParams);
programCollection.glslSources.add("fragment_shader") << glu::FragmentSource(fs.str());
}
-template<> void MSCase<MSCaseInterpolateAtOffsetSamplePosition>::checkSupport (Context& context) const
-{
- context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING);
-}
-
template<> TestInstance* MSCase<MSCaseInterpolateAtOffsetSamplePosition>::createInstance (Context& context) const
{
return new MSInstance<MSInstanceInterpolateScreenPosition>(context, m_imageMSParams);
programCollection.glslSources.add("fragment_shader") << glu::FragmentSource(fs.str());
}
+template<> void MSCase<MSCaseCentroidQualifierInsidePrimitive>::checkSupport (Context&) const
+{
+}
+
template<> TestInstance* MSCase<MSCaseCentroidQualifierInsidePrimitive>::createInstance (Context& context) const
{
return new MSInstance<MSInstanceInterpolateBarycentricCoordinates>(context, m_imageMSParams);
// Are we allowed to modify the sample pattern within the same subpass?
if (params.drawIn == TEST_DRAW_IN_SAME_SUBPASS && ((params.options & TEST_OPTION_SAME_PATTERN_BIT) == 0) && !getSampleLocationsPropertiesEXT(context).variableSampleLocations)
TCU_THROW(NotSupportedError, "VkPhysicalDeviceSampleLocationsPropertiesEXT: variableSampleLocations not supported");
+
+ if (TEST_OPTION_WAIT_EVENTS_BIT & params.options &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") && !context.getPortabilitySubsetFeatures().events)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Events are not supported by this implementation");
+ }
}
const char* getString (const TestImageAspect aspect)
void checkImageViewTypeRequirements (Context& context, const VkImageViewType viewType)
{
if (viewType == VK_IMAGE_VIEW_TYPE_3D)
+ {
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().imageView2DOn3DImage)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Implementation does not support 2D or 2D array image view to be created on a 3D VkImage");
+ }
+
context.requireDeviceFunctionality("VK_KHR_maintenance1");
+ }
if (viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY)
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_IMAGE_CUBE_ARRAY);
bool separateStencilUsage);
virtual ~SamplerLodTest (void) {}
virtual VkSamplerCreateInfo getSamplerCreateInfo (void) const;
+ virtual void checkSupport (Context& context) const;
private:
VkSamplerMipmapMode m_mipmapMode;
float m_mipLodBias;
};
+void SamplerLodTest::checkSupport (Context& context) const
+{
+ SamplerTest::checkSupport(context);
+
+ if (m_mipLodBias != 0.0f && context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().samplerMipLodBias)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Sampler mipmap LOD bias is not supported by this implementation");
+ }
+}
+
class SamplerAddressModesTest : public SamplerTest
{
public:
if (m_separateDepthStencilLayouts && !context.isDeviceFunctionalitySupported("VK_KHR_separate_depth_stencil_layouts"))
TCU_THROW(NotSupportedError, "VK_KHR_separate_depth_stencil_layouts is not supported");
+
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") && !context.getPortabilitySubsetFeatures().separateStencilMaskRef)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Separate stencil mask references are not supported by this implementation");
}
TestInstance* StencilTest::createInstance (Context& context) const
m_data.push_back(GraphicBasicTestInstance::VertexData(tcu::Vec4( 1.0f, 1.0f, 1.0f, 1.0f), tcu::RGBA::gray().toVec()));
}
+ void checkSupport (vkt::Context& context) const
+ {
+ if (m_parametersGraphic.primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().triangleFans)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
+ }
+
vkt::TestInstance* createInstance (vkt::Context& context) const
{
return new Instance(context, m_data, m_parametersGraphic, m_drawRepeats);
{
return new CullingTestInstance(context, m_cullMode, m_primitiveTopology, m_frontFace, m_polygonMode);
}
+ void checkSupport (Context& context) const;
protected:
const VkCullModeFlags m_cullMode;
const VkPrimitiveTopology m_primitiveTopology;
const VkPolygonMode m_polygonMode;
};
+void CullingTestCase::checkSupport (Context& context) const
+{
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset"))
+ {
+ const VkPhysicalDevicePortabilitySubsetFeaturesKHR& subsetFeatures = context.getPortabilitySubsetFeatures();
+ if (m_polygonMode == VK_POLYGON_MODE_POINT && !subsetFeatures.pointPolygons)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Point polygons are not supported by this implementation");
+ if (m_primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN && !subsetFeatures.triangleFans)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
+}
+
class DiscardTestInstance : public BaseRenderingTestInstance
{
public:
{
if (m_queryFragmentShaderInvocations)
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_PIPELINE_STATISTICS_QUERY);
+
+ if (m_primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().triangleFans)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
}
protected:
{
return new TriangleInterpolationTestInstance(context, m_primitiveTopology, m_flags, m_sampleCount);
}
+
+ virtual void checkSupport (Context& context) const
+ {
+ if (m_primitiveTopology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().triangleFans)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
+ }
protected:
const VkPrimitiveTopology m_primitiveTopology;
const int m_flags;
if ((imageFormatProperties.sampleCounts & m_testParams.colorSamples) == 0)
TCU_THROW(NotSupportedError, "Color image type not supported");
+
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().multisampleArrayImage &&
+ (m_testParams.colorSamples != VK_SAMPLE_COUNT_1_BIT) && (m_testParams.viewCount != 1))
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Implementation does not support image array with multiple samples per texel");
+ }
}
FragmentDensityMapTestInstance::FragmentDensityMapTestInstance(Context& context,
}
};
+void checkSupport(Context& context, TestConfig config)
+{
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().multisampleArrayImage &&
+ (config.sampleCount != VK_SAMPLE_COUNT_1_BIT) && (config.layerCount != 1))
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Implementation does not support image array with multiple samples per texel");
+ }
+}
+
std::string formatToName (VkFormat format)
{
const std::string formatStr = de::toString(format);
renderPassType
};
- formatGroup->addChild(new InstanceFactory1<MultisampleRenderPassTestInstance, TestConfig, Programs>(testCtx, tcu::NODETYPE_SELF_VALIDATE, testName.c_str(), testName.c_str(), testConfig));
+ formatGroup->addChild(new InstanceFactory1WithSupport<MultisampleRenderPassTestInstance, TestConfig, FunctionSupport1<TestConfig>, Programs>(testCtx, tcu::NODETYPE_SELF_VALIDATE, testName.c_str(), testName.c_str(), testConfig, typename FunctionSupport1<TestConfig>::Args(checkSupport, testConfig)));
// MaxAttachmenstsRenderPassTest is ment to test extreme cases where applications might consume all available on-chip
// memory. This is achieved by using maxColorAttachments attachments and two subpasses, but during test creation we
default:
DE_FATAL("Unsupported shader type");
}
+
+ checkSupportShader(ctx, m_shaderType.getType());
}
void AtomicOperationCase::createShaderSpec (void)
generateSources(m_shaderType, m_shaderSpec, programCollection);
}
+ void checkSupport (Context& context) const;
+
protected:
const char* m_name;
const glu::ShaderType m_shaderType;
{
}
+void OpaqueTypeIndexingCase::checkSupport (Context& context) const
+{
+ checkSupportShader(context, m_shaderType);
+}
+
class OpaqueTypeIndexingTestInstance : public TestInstance
{
public:
}
}
+void checkSupportShader(Context& context, const glu::ShaderType shaderType)
+{
+ if (shaderType == glu::SHADERTYPE_TESSELLATION_EVALUATION &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().tessellationIsolines)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Tessellation iso lines are not supported by this implementation");
+ }
+}
+
} // shaderexecutor
} // vkt
bool executorSupported (glu::ShaderType shaderType);
void generateSources (glu::ShaderType shaderType, const ShaderSpec& shaderSpec, vk::SourceCollections& dst);
ShaderExecutor* createExecutor (Context& context, glu::ShaderType shaderType, const ShaderSpec& shaderSpec, vk::VkDescriptorSetLayout extraResourcesLayout = (vk::VkDescriptorSetLayout)0);
+void checkSupportShader (Context& context, const glu::ShaderType shaderType);
} // shaderexecutor
} // vkt
generateSources(m_shaderType, m_spec, programCollection);
}
+ void checkSupport (Context& context) const;
+
virtual TestInstance* createInstance (Context& context) const = 0;
protected:
{
}
+void IntegerFunctionCase::checkSupport (Context& context) const
+{
+ checkSupportShader(context, m_shaderType);
+}
+
// IntegerFunctionTestInstance
class IntegerFunctionTestInstance : public TestInstance
ShaderPackingFunctionCase (tcu::TestContext& testCtx, const char* name, const char* description, glu::ShaderType shaderType);
~ShaderPackingFunctionCase (void);
+ void checkSupport (Context& context) const;
virtual void initPrograms (vk::SourceCollections& programCollection) const
{
generateSources(m_shaderType, m_spec, programCollection);
{
}
+void ShaderPackingFunctionCase::checkSupport (Context& context) const
+{
+ checkSupportShader(context, m_shaderType);
+}
+
// ShaderPackingFunctionTestInstance
class ShaderPackingFunctionTestInstance : public TestInstance
virtual ~BuiltinGlFrontFacingCase (void);
void initPrograms (SourceCollections& dst) const;
+ void checkSupport (Context& context) const;
TestInstance* createInstance (Context& context) const;
private:
}
}
+void BuiltinGlFrontFacingCase::checkSupport (Context& context) const
+{
+ if (m_topology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().triangleFans)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Triangle fans are not supported by this implementation");
+ }
+}
+
TestInstance* BuiltinGlFrontFacingCase::createInstance (Context& context) const
{
return new BuiltinGlFrontFacingCaseInstance(context, m_topology);
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
-
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest(Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
}
}
+void supportedCheckFeaturesShader (Context& context, CaseDefinition caseDef)
+{
+ supportedCheckFeatures(context, caseDef);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
+}
+
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
{
struct internalDataStruct internalData =
const CaseDefinition caseDefCompute = {VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT, VK_SHADER_STAGE_COMPUTE_BIT, DE_FALSE, REQUIRED_SUBGROUP_SIZE_NONE};
addFunctionCaseWithPrograms(computeGroup.get(), "allow_varying_subgroup_size", "", supportedCheckFeatures, initPrograms, test, caseDefCompute);
const CaseDefinition caseDefAllGraphics = {VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT, VK_SHADER_STAGE_ALL_GRAPHICS, DE_FALSE, REQUIRED_SUBGROUP_SIZE_NONE};
- addFunctionCaseWithPrograms(graphicsGroup.get(), "allow_varying_subgroup_size", "", supportedCheckFeatures, initPrograms, test, caseDefAllGraphics);
+ addFunctionCaseWithPrograms(graphicsGroup.get(), "allow_varying_subgroup_size", "", supportedCheckFeaturesShader, initPrograms, test, caseDefAllGraphics);
for (int stageIndex = 0; stageIndex < DE_LENGTH_OF_ARRAY(stages); ++stageIndex)
{
const CaseDefinition caseDefStage = {VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT, stages[stageIndex], DE_FALSE, REQUIRED_SUBGROUP_SIZE_NONE};
- addFunctionCaseWithPrograms(framebufferGroup.get(), getShaderStageName(caseDefStage.shaderStage) + "_allow_varying_subgroup_size", "", supportedCheckFeatures, initFrameBufferPrograms, noSSBOtest, caseDefStage);
+ addFunctionCaseWithPrograms(framebufferGroup.get(), getShaderStageName(caseDefStage.shaderStage) + "_allow_varying_subgroup_size", "", supportedCheckFeaturesShader, initFrameBufferPrograms, noSSBOtest, caseDefStage);
}
}
// Tests to check setting a required subgroup size value.
{
const CaseDefinition caseDefAllGraphicsMax = {0u, VK_SHADER_STAGE_ALL_GRAPHICS, DE_FALSE, REQUIRED_SUBGROUP_SIZE_MAX};
- addFunctionCaseWithPrograms(graphicsGroup.get(), "required_subgroup_size_max", "", supportedCheckFeatures, initPrograms, testRequireSubgroupSize, caseDefAllGraphicsMax);
+ addFunctionCaseWithPrograms(graphicsGroup.get(), "required_subgroup_size_max", "", supportedCheckFeaturesShader, initPrograms, testRequireSubgroupSize, caseDefAllGraphicsMax);
const CaseDefinition caseDefComputeMax = {0u, VK_SHADER_STAGE_COMPUTE_BIT, DE_FALSE, REQUIRED_SUBGROUP_SIZE_MAX};
addFunctionCaseWithPrograms(computeGroup.get(), "required_subgroup_size_max", "", supportedCheckFeatures, initPrograms, testRequireSubgroupSize, caseDefComputeMax);
const CaseDefinition caseDefAllGraphicsMin = {0u, VK_SHADER_STAGE_ALL_GRAPHICS, DE_FALSE, REQUIRED_SUBGROUP_SIZE_MIN};
- addFunctionCaseWithPrograms(graphicsGroup.get(), "required_subgroup_size_min", "", supportedCheckFeatures, initPrograms, testRequireSubgroupSize, caseDefAllGraphicsMin);
+ addFunctionCaseWithPrograms(graphicsGroup.get(), "required_subgroup_size_min", "", supportedCheckFeaturesShader, initPrograms, testRequireSubgroupSize, caseDefAllGraphicsMin);
const CaseDefinition caseDefComputeMin = {0u, VK_SHADER_STAGE_COMPUTE_BIT, DE_FALSE, REQUIRED_SUBGROUP_SIZE_MIN};
addFunctionCaseWithPrograms(computeGroup.get(), "required_subgroup_size_min", "", supportedCheckFeatures, initPrograms, testRequireSubgroupSize, caseDefComputeMin);
for (int stageIndex = 0; stageIndex < DE_LENGTH_OF_ARRAY(stages); ++stageIndex)
{
const CaseDefinition caseDefStageMax = {0u, stages[stageIndex], DE_FALSE, REQUIRED_SUBGROUP_SIZE_MAX};
- addFunctionCaseWithPrograms(framebufferGroup.get(), getShaderStageName(caseDefStageMax.shaderStage) + "_required_subgroup_size_max", "", supportedCheckFeatures, initFrameBufferPrograms, noSSBOtestRequireSubgroupSize, caseDefStageMax);
+ addFunctionCaseWithPrograms(framebufferGroup.get(), getShaderStageName(caseDefStageMax.shaderStage) + "_required_subgroup_size_max", "", supportedCheckFeaturesShader, initFrameBufferPrograms, noSSBOtestRequireSubgroupSize, caseDefStageMax);
const CaseDefinition caseDefStageMin = {0u, stages[stageIndex], DE_FALSE, REQUIRED_SUBGROUP_SIZE_MIN};
- addFunctionCaseWithPrograms(framebufferGroup.get(), getShaderStageName(caseDefStageMin.shaderStage) + "_required_subgroup_size_min", "", supportedCheckFeatures, initFrameBufferPrograms, noSSBOtestRequireSubgroupSize, caseDefStageMin);
+ addFunctionCaseWithPrograms(framebufferGroup.get(), getShaderStageName(caseDefStageMin.shaderStage) + "_required_subgroup_size_min", "", supportedCheckFeaturesShader, initFrameBufferPrograms, noSSBOtestRequireSubgroupSize, caseDefStageMin);
}
}
return makeComputeTestRequiredSubgroupSize(context, format, inputs, inputsCount, internalData, checkResult, pipelineShaderStageCreateFlags,
numWorkgroups, requiredSubgroupSize != 0u, subgroupSize, localSizesToTest, localSizesToTestCount);
}
+
+void vkt::subgroups::supportedCheckShader(Context& context, const vk::VkShaderStageFlags shaderStage)
+{
+ if ((VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) & shaderStage &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().tessellationIsolines)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Tessellation iso lines are not supported by this implementation");
+ }
+}
deUint32 subgroupSize),
const deUint32 pipelineShaderStageCreateFlags, const deUint32 numWorkgroups[3],
const deBool isRequiredSubgroupSize, const deUint32 subgroupSize, const deUint32 localSizesToTest[][3], const deUint32 localSizesToTestCount);
+
+void supportedCheckShader(Context& context, const vk::VkShaderStageFlags shaderStage);
} // subgroups
} // vkt
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
+
+ vkt::subgroups::supportedCheckShader(context, caseDef.shaderStage);
}
tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
return tcu::TestStatus::pass("Wait and set even on device using secondary command buffers tests pass");
}
+void checkEventSupport (Context& context)
+{
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") && !context.getPortabilitySubsetFeatures().events)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Events are not supported by this implementation");
+}
+
} // anonymous
tcu::TestCaseGroup* createBasicEventTests (tcu::TestContext& testCtx)
{
de::MovePtr<tcu::TestCaseGroup> basicTests(new tcu::TestCaseGroup(testCtx, "event", "Basic event tests"));
- addFunctionCase(basicTests.get(), "host_set_reset", "Basic event tests set and reset on host", hostResetSetEventCase);
- addFunctionCase(basicTests.get(), "device_set_reset", "Basic event tests set and reset on device", deviceResetSetEventCase);
- addFunctionCase(basicTests.get(), "single_submit_multi_command_buffer", "Wait and set event single submission on device", singleSubmissionCase);
- addFunctionCase(basicTests.get(), "multi_submit_multi_command_buffer", "Wait and set event mutli submission on device", multiSubmissionCase);
- addFunctionCase(basicTests.get(), "multi_secondary_command_buffer", "Event used on secondary command buffer ", secondaryCommandBufferCase);
+ addFunctionCase(basicTests.get(), "host_set_reset", "Basic event tests set and reset on host", checkEventSupport, hostResetSetEventCase);
+ addFunctionCase(basicTests.get(), "device_set_reset", "Basic event tests set and reset on device", checkEventSupport, deviceResetSetEventCase);
+ addFunctionCase(basicTests.get(), "single_submit_multi_command_buffer", "Wait and set event single submission on device", checkEventSupport, singleSubmissionCase);
+ addFunctionCase(basicTests.get(), "multi_submit_multi_command_buffer", "Wait and set event mutli submission on device", checkEventSupport, multiSubmissionCase);
+ addFunctionCase(basicTests.get(), "multi_secondary_command_buffer", "Event used on secondary command buffer ", checkEventSupport, secondaryCommandBufferCase);
return basicTests.release();
}
return DE_NULL;
}
+ void checkSupport (Context& context) const
+ {
+ if (SYNC_PRIMITIVE_EVENT == m_syncPrimitive &&
+ context.isDeviceFunctionalitySupported("VK_KHR_portability_subset") &&
+ !context.getPortabilitySubsetFeatures().events)
+ {
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Events are not supported by this implementation");
+ }
+ }
+
private:
const ResourceDescription m_resourceDesc;
const de::SharedPtr<OperationSupport> m_writeOp;
const bool executionModeInEvaluationShader = true);
void initPrograms (SourceCollections& programCollection) const;
+ void checkSupport (Context& context) const;
TestInstance* createInstance (Context& context) const;
private:
{
}
+void TessCoordTest::checkSupport (Context& context) const
+{
+ if (const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR* const features = getPortability(context))
+ {
+ checkPointMode(*features);
+ checkPrimitive(*features, m_primitiveType);
+ }
+}
+
void TessCoordTest::initPrograms (SourceCollections& programCollection) const
{
if (m_executionModeInEvaluationShader)
return (success ? tcu::TestStatus::pass("OK") : tcu::TestStatus::fail("Failure"));
}
+void checkSupportTess(Context& context, const TestParams)
+{
+ if (const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR* const features = getPortability(context))
+ {
+ checkPointMode(*features);
+ checkIsolines(*features);
+ }
+}
+
} // anonymous
//! These tests correspond to dEQP-GLES31.functional.tessellation.fractional_spacing.*
{
de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(testCtx, "fractional_spacing", "Test fractional spacing modes"));
- addFunctionCaseWithPrograms(group.get(), "glsl_odd", "", initPrograms, test, TestParams(SHADER_LANGUAGE_GLSL, SPACINGMODE_FRACTIONAL_ODD));
- addFunctionCaseWithPrograms(group.get(), "glsl_even", "", initPrograms, test, TestParams(SHADER_LANGUAGE_GLSL, SPACINGMODE_FRACTIONAL_EVEN));
- addFunctionCaseWithPrograms(group.get(), "hlsl_odd", "", initPrograms, test, TestParams(SHADER_LANGUAGE_HLSL, SPACINGMODE_FRACTIONAL_ODD));
- addFunctionCaseWithPrograms(group.get(), "hlsl_even", "", initPrograms, test, TestParams(SHADER_LANGUAGE_HLSL, SPACINGMODE_FRACTIONAL_EVEN));
+ addFunctionCaseWithPrograms(group.get(), "glsl_odd", "", checkSupportTess, initPrograms, test, TestParams(SHADER_LANGUAGE_GLSL, SPACINGMODE_FRACTIONAL_ODD));
+ addFunctionCaseWithPrograms(group.get(), "glsl_even", "", checkSupportTess, initPrograms, test, TestParams(SHADER_LANGUAGE_GLSL, SPACINGMODE_FRACTIONAL_EVEN));
+ addFunctionCaseWithPrograms(group.get(), "hlsl_odd", "", checkSupportTess, initPrograms, test, TestParams(SHADER_LANGUAGE_HLSL, SPACINGMODE_FRACTIONAL_ODD));
+ addFunctionCaseWithPrograms(group.get(), "hlsl_even", "", checkSupportTess, initPrograms, test, TestParams(SHADER_LANGUAGE_HLSL, SPACINGMODE_FRACTIONAL_EVEN));
return group.release();
}
{
public:
void initPrograms (vk::SourceCollections& programCollection) const;
+ void checkSupport (Context& context) const;
TestInstance* createInstance (Context& context) const;
IdentityGeometryShaderTestCase (tcu::TestContext& testCtx, const std::string& name, const std::string& description, const TessPrimitiveType primitiveType)
const TessPrimitiveType m_primitiveType;
};
+void IdentityGeometryShaderTestCase::checkSupport (Context& context) const
+{
+ checkSupportPrimitive(context, m_primitiveType);
+}
+
void IdentityGeometryShaderTestCase::initPrograms (vk::SourceCollections& programCollection) const
{
addVertexAndFragmentShaders(programCollection);
{
public:
void initPrograms (vk::SourceCollections& programCollection) const;
+ void checkSupport (Context& context) const;
TestInstance* createInstance (Context& context) const;
IdentityTessellationShaderTestCase (tcu::TestContext& testCtx, const std::string& name, const std::string& description, const TessPrimitiveType primitiveType)
const TessPrimitiveType m_primitiveType;
};
+void IdentityTessellationShaderTestCase::checkSupport (Context& context) const
+{
+ checkSupportPrimitive(context, m_primitiveType);
+}
+
//! Geometry shader used in passthrough tessellation shader case.
std::string generateGeometryShader (const TessPrimitiveType primitiveType, const std::string& colorSourceName)
{
return buf.str();
}
+void checkSupportTess (Context& context, const Flags flags)
+{
+ if (isTessellationStage(flags))
+ if (const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR* const features = getPortability(context))
+ checkPointMode(*features);
+}
+
} // anonymous
//! Ported from dEQP-GLES31.functional.tessellation_geometry_interaction.point_size.*
const std::string name = getTestCaseName (caseFlags[ndx]);
const std::string desc = getTestCaseDescription(caseFlags[ndx]);
- addFunctionCaseWithPrograms(group.get(), name, desc, initPrograms, test, caseFlags[ndx]);
+ addFunctionCaseWithPrograms(group.get(), name, desc, checkSupportTess, initPrograms, test, caseFlags[ndx]);
}
return group.release();
return new OuterEdgeDivisionTestInstance(context, m_caseDef);
};
+ void checkSupport (Context& context) const
+ {
+ if (const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR* const features = getPortability(context))
+ checkPointMode(*features);
+ }
+
private:
const CaseDefinition m_caseDef;
};
return new OuterEdgeIndexIndependenceTestInstance(context, m_caseDef);
};
+ void checkSupport (Context& context) const
+ {
+ checkSupportCase(context, m_caseDef);
+ }
+
private:
const CaseDefinition m_caseDef;
};
return new SymmetricOuterEdgeTestInstance(context, m_caseDef);
};
+ void checkSupport (Context& context) const
+ {
+ checkSupportCase(context, m_caseDef);
+ }
+
private:
const CaseDefinition m_caseDef;
};
virtual ~InvarianceTestCase (void) {}
void initPrograms (SourceCollections& programCollection) const;
+ void checkSupport (Context& context) const;
TestInstance* createInstance (Context& context) const;
private:
addDefaultPrograms(programCollection, m_caseDef.primitiveType, m_caseDef.spacingMode, m_caseDef.windingUsage, getPointModeUsage(m_caseDef.usePointMode));
}
+void InvarianceTestCase::checkSupport (Context& context) const
+{
+ checkSupportCase(context, m_caseDef);
+}
+
class InvarianceTestInstance : public TestInstance
{
public:
tcu::TestCase* makeTessCoordRangeTest (tcu::TestContext& testCtx, const std::string& name, const std::string& description, const TessPrimitiveType primitiveType, const SpacingMode spacingMode, const Winding winding, const bool usePointMode)
{
const CaseDefinition caseDef = { CASETYPE_TESS_COORD_RANGE, primitiveType, spacingMode, winding, usePointMode };
- return createFunctionCaseWithPrograms(testCtx, tcu::NODETYPE_SELF_VALIDATE, name, description, initPrograms, test, caseDef);
+ return createFunctionCaseWithPrograms(testCtx, tcu::NODETYPE_SELF_VALIDATE, name, description, checkSupportCase, initPrograms, test, caseDef);
}
tcu::TestCase* makeOneMinusTessCoordTest (tcu::TestContext& testCtx, const std::string& name, const std::string& description, const TessPrimitiveType primitiveType, const SpacingMode spacingMode, const Winding winding, const bool usePointMode)
{
const CaseDefinition caseDef = { CASETYPE_ONE_MINUS_TESS_COORD, primitiveType, spacingMode, winding, usePointMode };
- return createFunctionCaseWithPrograms(testCtx, tcu::NODETYPE_SELF_VALIDATE, name, description, initPrograms, test, caseDef);
+ return createFunctionCaseWithPrograms(testCtx, tcu::NODETYPE_SELF_VALIDATE, name, description, checkSupportCase, initPrograms, test, caseDef);
}
} // TessCoordComponent ns
const SpacingMode spacingMode = static_cast<SpacingMode>(spacingModeNdx);
const std::string caseName = std::string() + "isolines_" + getSpacingModeShaderName(spacingMode);
- addFunctionCaseWithPrograms(group.get(), caseName, "Basic isolines render test",
+ addFunctionCaseWithPrograms(group.get(), caseName, "Basic isolines render test", checkSupportCase,
initProgramsIsolinesCase, runTest, makeCaseDefinition(TESSPRIMITIVETYPE_ISOLINES, spacingMode, getReferenceImagePathPrefix(caseName)));
}
+ (caseDef.usePointMode ? "_point_mode" : "")
+ (caseDef.useLessThanOneInnerLevels ? "" : "_valid_levels");
- addFunctionCaseWithPrograms(group.get(), caseName, "", initPrograms, test, caseDef);
+ addFunctionCaseWithPrograms(group.get(), caseName, "", checkSupportCase, initPrograms, test, caseDef);
}
return group.release();
public:
UserDefinedIOTest (tcu::TestContext& testCtx, const std::string& name, const std::string& description, const CaseDefinition caseDef);
void initPrograms (vk::SourceCollections& programCollection) const;
+ void checkSupport (Context& context) const;
TestInstance* createInstance (Context& context) const;
private:
std::string m_tesStatements;
};
+void UserDefinedIOTest::checkSupport (Context& context) const
+{
+ checkSupportCase(context, m_caseDef);
+}
+
UserDefinedIOTest::UserDefinedIOTest (tcu::TestContext& testCtx, const std::string& name, const std::string& description, const CaseDefinition caseDef)
: TestCase (testCtx, name, description)
, m_caseDef (caseDef)
#include "vkRefUtil.hpp"
#include "vkQueryUtil.hpp"
#include "vkObjUtil.hpp"
+#include "vktTestCase.hpp"
#include "tcuVector.hpp"
#include "tcuMaybe.hpp"
}
}
+static inline const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR* getPortability (const Context& context)
+{
+ if (context.isDeviceFunctionalitySupported("VK_KHR_portability_subset"))
+ return &context.getPortabilitySubsetFeatures();
+ return DE_NULL;
+}
+
+static inline void checkIsolines (const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR& features)
+{
+ if (!features.tessellationIsolines)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Tessellation iso lines are not supported by this implementation");
+}
+
+static inline void checkPrimitive (const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR& features, const TessPrimitiveType primitive)
+{
+ if (primitive == TESSPRIMITIVETYPE_ISOLINES)
+ checkIsolines(features);
+}
+
+static inline void checkSupportPrimitive (Context& context, const TessPrimitiveType primitive)
+{
+ if (const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR* const features = getPortability(context))
+ checkPrimitive(*features, primitive);
+}
+
+static inline void checkPointMode (const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR& features)
+{
+ if (!features.tessellationPointMode)
+ TCU_THROW(NotSupportedError, "VK_KHR_portability_subset: Tessellation point mode is not supported by this implementation");
+}
+
template<typename T>
inline std::size_t sizeInBytes (const std::vector<T>& vec)
{
return results;
}
+template <typename CaseDef, typename = bool>
+struct PointMode
+{
+ static void check(const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR&, const CaseDef)
+ {
+ }
+};
+
+template <typename CaseDef>
+struct PointMode<CaseDef, decltype(CaseDef().usePointMode)>
+{
+ static void check(const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR& features, const CaseDef caseDef)
+ {
+ if (caseDef.usePointMode)
+ checkPointMode(features);
+ }
+};
+
+template <typename CaseDef>
+void checkSupportCase (Context& context, const CaseDef caseDef)
+{
+ if (const vk::VkPhysicalDevicePortabilitySubsetFeaturesKHR* const features = getPortability(context))
+ {
+ PointMode<CaseDef>::check(*features, caseDef);
+ checkPrimitive(*features, caseDef.primitiveType);
+ }
+}
+
} // tessellation
} // vkt
return isOk ? tcu::TestStatus::pass("Pass") : tcu::TestStatus::fail("Image verification failed");
}
+} // anonymous
+
void populateTextureCompressedFormatTests (tcu::TestCaseGroup* compressedTextureTests)
{
tcu::TestContext& testCtx = compressedTextureTests->getTestContext();
}
}
-} // anonymous
-
tcu::TestCaseGroup* createTextureCompressedFormatTests (tcu::TestContext& testCtx)
{
return createTestGroup(testCtx, "compressed", "Texture compressed format tests.", populateTextureCompressedFormatTests);
#include "vktSampleVerifier.hpp"
#include "vktShaderExecutor.hpp"
#include "vktTestCaseUtil.hpp"
+#include "vktTextureTestUtil.hpp"
#include "vkDeviceUtil.hpp"
#include "vkImageUtil.hpp"
void initSpec (void);
+ void checkSupport (Context& context) const
+ {
+ util::checkTextureSupport(context, m_testCaseData.imParams.format);
+ }
+
virtual void initPrograms (vk::SourceCollections& programCollection) const
{
generateSources(m_testCaseData.shaderType, m_shaderSpec, programCollection);
(tcu::TexVerifierUtil::isLinearFilter(minFilter) || tcu::TexVerifierUtil::isLinearFilter(magFilter) ||
tcu::TexVerifierUtil::isCubicFilter(minFilter) || tcu::TexVerifierUtil::isCubicFilter(magFilter)));
}
+
+} // anonymous
+
void populateTextureFilteringTests (tcu::TestCaseGroup* textureFilteringTests)
{
tcu::TestContext& testCtx = textureFilteringTests->getTestContext();
}
}
-} // anonymous
-
tcu::TestCaseGroup* createTextureFilteringTests (tcu::TestContext& testCtx)
{
return createTestGroup(testCtx, "filtering", "Texture filtering tests.", populateTextureFilteringTests);
}
};
+} // anonymous
+
void populateTextureMipmappingTests (tcu::TestCaseGroup* textureMipmappingTests)
{
tcu::TestContext& testCtx = textureMipmappingTests->getTestContext();
}
}
-} // anonymous
-
tcu::TestCaseGroup* createTextureMipmappingTests (tcu::TestContext& testCtx)
{
return createTestGroup(testCtx, "mipmap", "Texture mipmapping tests.", populateTextureMipmappingTests);
return m_caseNdx < (int)m_cases.size() ? tcu::TestStatus::incomplete() : tcu::TestStatus::pass("Pass");
}
+} // anonymous
+
void populateTextureShadowTests (tcu::TestCaseGroup* textureShadowTests)
{
tcu::TestContext& testCtx = textureShadowTests->getTestContext();
}
}
-} // anonymous
-
tcu::TestCaseGroup* createTextureShadowTests (tcu::TestContext& testCtx)
{
return createTestGroup(testCtx, "shadow", "Texture shadow tests.", populateTextureShadowTests);
return isOk ? tcu::TestStatus::pass("Pass") : tcu::TestStatus::fail("Image verification failed");
}
+} // anonymous
+
void populateTextureSwizzleTests (tcu::TestCaseGroup* textureSwizzleTests)
{
tcu::TestContext& testCtx = textureSwizzleTests->getTestContext();
textureSwizzleTests->addChild(groupTexCoord.release());
}
-} // anonymous
-
tcu::TestCaseGroup* createTextureSwizzleTests (tcu::TestContext& testCtx)
{
return createTestGroup(testCtx, "swizzle", "Texture swizzle tests.", populateTextureSwizzleTests);
vk::VkComponentMapping m_componentMapping;
};
+void checkTextureSupport (Context& context, const vk::VkFormat imageFormat, const vk::VkComponentMapping& imageComponents,
+ const vk::VkFormat viewFormat, const vk::VkComponentMapping& viewComponents);
+
typedef de::SharedPtr<TextureBinding> TextureBindingSp;
class TextureRenderer
{
initializePrograms(programCollection, m_testsParameters.texCoordPrecision, m_testsParameters.programs);
}
+
virtual void checkSupport (Context& context) const
{
checkTextureSupport(context, m_testsParameters);