@@ -67,7 +67,7 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
67
67
};
68
68
69
69
// testing creation of compute pipeline layouts compatible for multiple shaders
70
- #if 0
70
+ #if 1
71
71
// TODO: if these are to stay, then i should avoid code multiplication
72
72
{
73
73
constexpr std::array mergeTestShadersPaths = {
@@ -120,7 +120,9 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
120
120
" app_resources/pplnLayoutCreationWithPredefinedLayoutTest/shader_0.comp.hlsl" ,
121
121
" app_resources/pplnLayoutCreationWithPredefinedLayoutTest/shader_1.comp.hlsl" ,
122
122
" app_resources/pplnLayoutCreationWithPredefinedLayoutTest/shader_2.comp.hlsl" ,
123
- " app_resources/pplnLayoutCreationWithPredefinedLayoutTest/shader_3.comp.hlsl"
123
+ " app_resources/pplnLayoutCreationWithPredefinedLayoutTest/shader_3.comp.hlsl" ,
124
+ " app_resources/pplnLayoutCreationWithPredefinedLayoutTest/shader_4.comp.hlsl" ,
125
+ " app_resources/pplnLayoutCreationWithPredefinedLayoutTest/shader_5.comp.hlsl"
124
126
};
125
127
constexpr uint32_t MERGE_TEST_SHADERS_CNT = mergeTestShadersPaths.size ();
126
128
@@ -173,7 +175,12 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
173
175
if (!dsLayout0 || !dsLayout1)
174
176
return logFail (" Failed to create a Descriptor Layout!\n " );
175
177
176
- smart_refctd_ptr<ICPUPipelineLayout> predefinedPplnLayout = core::make_smart_refctd_ptr<ICPUPipelineLayout>(std::span<const asset::SPushConstantRange>(), std::move (dsLayout0), std::move (dsLayout1), nullptr , nullptr );
178
+ SPushConstantRange pc;
179
+ pc.offset = 0u ;
180
+ pc.size = 5 * sizeof (uint32_t );
181
+ pc.stageFlags = IShader::E_SHADER_STAGE::ESS_COMPUTE;
182
+
183
+ smart_refctd_ptr<ICPUPipelineLayout> predefinedPplnLayout = core::make_smart_refctd_ptr<ICPUPipelineLayout>(std::span<const asset::SPushConstantRange>({ pc }), std::move (dsLayout0), std::move (dsLayout1), nullptr , nullptr );
177
184
if (!predefinedPplnLayout)
178
185
return logFail (" Failed to create a Pipeline Layout!\n " );
179
186
@@ -195,11 +202,12 @@ class DeviceSelectionAndSharedSourcesApp final : public application_templates::M
195
202
confirmExpectedOutput (pplnCreationSuccess[2 ], false );
196
203
// layout from introspection is NOT a subset (same bindings, different type of one of the bindings) of pre-defined layout, hence ppln creation should FAIL
197
204
confirmExpectedOutput (pplnCreationSuccess[3 ], false );
205
+
198
206
// PUSH CONSTANTS VALIDATION TESTS
199
207
// layout from introspection is a subset of pre-defined layout (Push constant size declared in shader are compatible), hence ppln creation should SUCCEED
200
- // TODO
208
+ confirmExpectedOutput (pplnCreationSuccess[ 4 ], true );
201
209
// layout from introspection is NOT a subset of pre-defined layout (Push constant size declared in shader are NOT compatible), hence ppln creation should FAIL
202
- // TODO
210
+ confirmExpectedOutput (pplnCreationSuccess[ 5 ], false );
203
211
}
204
212
205
213
m_logger->log (" ------- shader.comp.hlsl INTROSPECTION -------" , ILogger::E_LOG_LEVEL::ELL_WARNING);
0 commit comments