/* * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/gen11/hw_cmds.h" #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" #include using namespace NEO; using Gen11SamplerTest = ::testing::Test; GEN11TEST_F(Gen11SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) { using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE; MockExecutionEnvironment mockExecutionEnvironment{}; auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0]; auto &productHelper = rootDeviceEnvironment.getHelper(); auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState; auto stateWithAppendedParams = FamilyType::cmdInitSamplerState; EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0); productHelper.adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo); EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0); }