@@ -54,14 +54,13 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
54
54
#endif
55
55
// testing creation of compute pipeline layouts compatible for multiple shaders
56
56
{
57
- constexpr uint32_t MERGE_TEST_SHADERS_CNT = 3u ;
58
-
59
-
60
- std::array mergeTestShadersPaths = {
57
+ constexpr std::array mergeTestShadersPaths = {
61
58
" app_resources/pplnLayoutMergeTest/shader_1.comp.hlsl" ,
62
59
" app_resources/pplnLayoutMergeTest/shader_2.comp.hlsl" ,
63
- " app_resources/pplnLayoutMergeTest/shader_3.comp.hlsl"
60
+ " app_resources/pplnLayoutMergeTest/shader_3.comp.hlsl" ,
61
+ " app_resources/pplnLayoutMergeTest/shader_4.comp.hlsl"
64
62
};
63
+ constexpr uint32_t MERGE_TEST_SHADERS_CNT = mergeTestShadersPaths.size ();
65
64
66
65
auto confirmExpectedOutput = [this ](bool value, bool expectedValue)
67
66
{
@@ -89,9 +88,19 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
89
88
90
89
core::smart_refctd_ptr<CSPIRVIntrospector::CPipelineIntrospectionData> pplnIntroData;
91
90
pplnIntroData = core::make_smart_refctd_ptr<CSPIRVIntrospector::CPipelineIntrospectionData>();
91
+
92
+ // should merge successfully since shader is not messed up and it is the first merge
92
93
confirmExpectedOutput (pplnIntroData->merge (introspections[0 ].get ()), true );
94
+ // should merge successfully since pipeline layout of "shader_2.comp.hlsl" is compatible with "shader_1.comp.hlsl"
93
95
confirmExpectedOutput (pplnIntroData->merge (introspections[1 ].get ()), true );
96
+ // should not merge since pipeline layout of "shader_3.comp.hlsl" is not compatible with "shader_1.comp.hlsl"
94
97
confirmExpectedOutput (pplnIntroData->merge (introspections[2 ].get ()), false );
98
+
99
+ core::smart_refctd_ptr<CSPIRVIntrospector::CPipelineIntrospectionData> pplnIntroData2;
100
+ pplnIntroData2 = core::make_smart_refctd_ptr<CSPIRVIntrospector::CPipelineIntrospectionData>();
101
+
102
+ // should not merge since run-time sized destriptor of "shader_4.comp.hlsl" is not last
103
+ confirmExpectedOutput (pplnIntroData2->merge (introspections[3 ].get ()), false );
95
104
}
96
105
97
106
m_logger->log (" ------- shader.comp.hlsl INTROSPECTION -------" , ILogger::E_LOG_LEVEL::ELL_WARNING);
0 commit comments