2018-01-24 17:23:11 +08:00
|
|
|
/*
|
2023-01-30 08:53:04 +08:00
|
|
|
* Copyright (C) 2018-2023 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-06-30 03:17:47 +08:00
|
|
|
#include "shared/source/gen8/hw_cmds.h"
|
2023-03-10 20:28:11 +08:00
|
|
|
#include "shared/source/os_interface/product_helper.h"
|
2021-12-23 17:28:36 +08:00
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
2023-01-30 08:53:04 +08:00
|
|
|
#include "shared/test/common/mocks/mock_execution_environment.h"
|
2022-06-30 03:17:47 +08:00
|
|
|
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
|
|
|
#include "shared/test/common/test_macros/test.h"
|
2021-08-25 18:28:05 +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
|
|
|
|
2021-12-23 17:28:36 +08:00
|
|
|
using Gen8SamplerTest = ::testing::Test;
|
2018-01-24 17:23:11 +08:00
|
|
|
|
2020-10-14 17:44:03 +08:00
|
|
|
GEN8TEST_F(Gen8SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) {
|
2023-01-30 08:53:04 +08:00
|
|
|
|
|
|
|
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
|
|
|
|
MockExecutionEnvironment mockExecutionEnvironment{};
|
|
|
|
auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0];
|
|
|
|
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
|
|
|
|
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);
|
2023-01-30 08:53:04 +08:00
|
|
|
productHelper.adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo);
|
2018-01-24 17:23:11 +08:00
|
|
|
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
|
|
|
|
}
|