2018-01-24 17:23:11 +08:00
|
|
|
/*
|
2021-02-05 09:58:42 +08:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2018-01-24 17:23:11 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-01-24 17:23:11 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-08-25 18:28:05 +08:00
|
|
|
#include "shared/source/os_interface/hw_info_config.h"
|
2021-12-15 01:40:08 +08:00
|
|
|
#include "shared/test/common/test_macros/test.h"
|
2021-08-25 18:28:05 +08:00
|
|
|
|
2020-05-28 20:05:12 +08:00
|
|
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2018-01-24 17:23:11 +08:00
|
|
|
#include <memory>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2018-01-24 17:23:11 +08:00
|
|
|
|
2020-05-28 20:05:12 +08:00
|
|
|
typedef Test<ClDeviceFixture> Gen9SamplerTest;
|
2018-01-24 17:23:11 +08:00
|
|
|
|
2020-10-14 17:44:03 +08:00
|
|
|
GEN9TEST_F(Gen9SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) {
|
2018-01-24 17:23:11 +08:00
|
|
|
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE;
|
2019-01-18 00:10:12 +08:00
|
|
|
auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState;
|
|
|
|
auto stateWithAppendedParams = FamilyType::cmdInitSamplerState;
|
2018-01-24 17:23:11 +08:00
|
|
|
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
|
2021-08-25 18:28:05 +08:00
|
|
|
HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo);
|
2018-01-24 17:23:11 +08:00
|
|
|
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
|
|
|
|
}
|