Files
compute-runtime/shared/test/unit_test/gen11/sampler_tests_gen11.cpp
2022-11-02 11:30:04 +01:00

29 lines
1.1 KiB
C++

/*
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen11/hw_cmds.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include <memory>
using namespace NEO;
using Gen11SamplerTest = ::testing::Test;
GEN11TEST_F(Gen11SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) {
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE;
auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState;
auto stateWithAppendedParams = FamilyType::cmdInitSamplerState;
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo);
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
}