diff --git a/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp b/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp index 4488bf9f55..01f996ad3f 100644 --- a/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp +++ b/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp @@ -303,7 +303,9 @@ void ImmediateCmdListSharedHeapsFixture::setUp() { mockKernelImmData->kernelInfo->kernelDescriptor.payloadMappings.samplerTable.tableOffset = 16; mockKernelImmData->kernelInfo->kernelDescriptor.payloadMappings.samplerTable.borderColor = 0; - kernel->dynamicStateHeapDataSize = static_cast(16 * 2 + mockKernelImmData->kernelInfo->kernelDescriptor.payloadMappings.samplerTable.tableOffset); + auto surfaceStateSize = device->getNEODevice()->getGfxCoreHelper().getSamplerStateSize(); + + kernel->dynamicStateHeapDataSize = static_cast(surfaceStateSize * 2 + mockKernelImmData->kernelInfo->kernelDescriptor.payloadMappings.samplerTable.tableOffset); kernel->dynamicStateHeapData.reset(new uint8_t[kernel->dynamicStateHeapDataSize]); mockKernelImmData->mockKernelDescriptor->payloadMappings.samplerTable = mockKernelImmData->kernelInfo->kernelDescriptor.payloadMappings.samplerTable; diff --git a/level_zero/core/test/unit_tests/sources/kernel/test_kernel_2.cpp b/level_zero/core/test/unit_tests/sources/kernel/test_kernel_2.cpp index 4073659f2f..0c23c8f54d 100644 --- a/level_zero/core/test/unit_tests/sources/kernel/test_kernel_2.cpp +++ b/level_zero/core/test/unit_tests/sources/kernel/test_kernel_2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2024 Intel Corporation + * Copyright (C) 2022-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -485,6 +485,7 @@ HWTEST_F(KernelImpSuggestMaxCooperativeGroupCountTests, GivenUsedSlmSizeWhenCalc using KernelTest = Test; HWTEST2_F(KernelTest, GivenInlineSamplersWhenSettingInlineSamplerThenDshIsPatched, SupportsSampler) { + using SamplerState = typename FamilyType::SAMPLER_STATE; WhiteBox<::L0::KernelImmutableData> kernelImmData = {}; NEO::KernelDescriptor descriptor; kernelImmData.kernelDescriptor = &descriptor; @@ -498,12 +499,11 @@ HWTEST2_F(KernelTest, GivenInlineSamplersWhenSettingInlineSamplerThenDshIsPatche Mock kernel; kernel.module = &module; kernel.kernelImmData = &kernelImmData; - kernel.dynamicStateHeapData.reset(new uint8_t[64 + 16]); - kernel.dynamicStateHeapDataSize = 64 + 16; + kernel.dynamicStateHeapData.reset(new uint8_t[64 + sizeof(SamplerState)]); + kernel.dynamicStateHeapDataSize = 64 + sizeof(SamplerState); kernel.setInlineSamplers(); - using SamplerState = typename FamilyType::SAMPLER_STATE; auto samplerState = reinterpret_cast(kernel.dynamicStateHeapData.get() + 64U); EXPECT_TRUE(samplerState->getNonNormalizedCoordinateEnable()); EXPECT_EQ(SamplerState::TEXTURE_COORDINATE_MODE_WRAP, samplerState->getTcxAddressControlMode());