@@ -331,6 +331,7 @@ struct SamplerSupportedMatcher {
331
331
HWTEST2_F (CommandEncodeStatesTest, giveNumSamplersOneWhenDispatchKernelThensamplerStateWasCopied, SamplerSupportedMatcher) {
332
332
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
333
333
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
334
+ using SAMPLER_BORDER_COLOR_STATE = typename FamilyType::SAMPLER_BORDER_COLOR_STATE;
334
335
335
336
if (!pDevice->getDeviceInfo ().imageSupport ) {
336
337
GTEST_SKIP ();
@@ -346,8 +347,9 @@ HWTEST2_F(CommandEncodeStatesTest, giveNumSamplersOneWhenDispatchKernelThensampl
346
347
uint32_t dims[] = {2 , 1 , 1 };
347
348
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface (new MockDispatchKernelEncoder ());
348
349
350
+ constexpr auto samplerTableBorderColorOffset = 0u ;
349
351
dispatchInterface->kernelDescriptor .payloadMappings .samplerTable .numSamplers = numSamplers;
350
- dispatchInterface->kernelDescriptor .payloadMappings .samplerTable .borderColor = 0 ;
352
+ dispatchInterface->kernelDescriptor .payloadMappings .samplerTable .borderColor = samplerTableBorderColorOffset ;
351
353
dispatchInterface->kernelDescriptor .payloadMappings .samplerTable .tableOffset = 0 ;
352
354
353
355
unsigned char *samplerStateRaw = reinterpret_cast <unsigned char *>(&samplerState);
@@ -369,8 +371,13 @@ HWTEST2_F(CommandEncodeStatesTest, giveNumSamplersOneWhenDispatchKernelThensampl
369
371
auto cmd = genCmdCast<COMPUTE_WALKER *>(*itor);
370
372
auto &idd = cmd->getInterfaceDescriptor ();
371
373
372
- auto borderColorOffsetInDsh = usedBefore;
373
- samplerState.setIndirectStatePointer (static_cast <uint32_t >(borderColorOffsetInDsh));
374
+ if (pDevice->getCompilerProductHelper ().isHeaplessModeEnabled ()) {
375
+ auto borderColor = reinterpret_cast <const SAMPLER_BORDER_COLOR_STATE *>(ptrOffset (dispatchInterface->getDynamicStateHeapData (), samplerTableBorderColorOffset));
376
+ EncodeStates<FamilyType>::adjustSamplerStateBorderColor (samplerState, *borderColor);
377
+ } else {
378
+ auto borderColorOffsetInDsh = usedBefore;
379
+ samplerState.setIndirectStatePointer (static_cast <uint32_t >(borderColorOffsetInDsh));
380
+ }
374
381
375
382
auto samplerStateOffset = idd.getSamplerStatePointer ();
376
383
0 commit comments