2019-01-10 15:36:57 +01:00
|
|
|
/*
|
2023-01-30 00:53:04 +00:00
|
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
2019-01-10 15:36:57 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2022-06-29 19:17:47 +00:00
|
|
|
#include "shared/source/gen11/hw_cmds.h"
|
2023-03-10 12:28:11 +00:00
|
|
|
#include "shared/source/os_interface/product_helper.h"
|
2022-10-28 13:51:20 +00:00
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
2023-01-30 00:53:04 +00:00
|
|
|
#include "shared/test/common/mocks/mock_execution_environment.h"
|
2022-06-29 19:17:47 +00:00
|
|
|
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
|
|
|
|
#include "shared/test/common/test_macros/test.h"
|
2021-08-25 10:28:05 +00:00
|
|
|
|
2019-01-10 15:36:57 +01:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
using namespace NEO;
|
|
|
|
|
|
2022-10-28 13:51:20 +00:00
|
|
|
using Gen11SamplerTest = ::testing::Test;
|
2019-01-10 15:36:57 +01:00
|
|
|
|
2020-10-14 11:44:03 +02:00
|
|
|
GEN11TEST_F(Gen11SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) {
|
2023-01-30 00:53:04 +00:00
|
|
|
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
|
|
|
|
|
MockExecutionEnvironment mockExecutionEnvironment{};
|
|
|
|
|
auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0];
|
|
|
|
|
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
2019-01-10 15:36:57 +01:00
|
|
|
auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState;
|
|
|
|
|
auto stateWithAppendedParams = FamilyType::cmdInitSamplerState;
|
|
|
|
|
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
|
2023-01-30 00:53:04 +00:00
|
|
|
productHelper.adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo);
|
2019-01-10 15:36:57 +01:00
|
|
|
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
|
|
|
|
|
}
|