mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00

Related-To: NEO-2236 Change-Id: Ieea95a0b59c07f1df06b0aec385d7a244325fc52 Signed-off-by: Adam Cetnerowski <adam.cetnerowski@intel.com>
29 lines
1.1 KiB
C++
29 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2018-2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "opencl/source/sampler/sampler.h"
|
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
|
#include "test.h"
|
|
|
|
#include <memory>
|
|
|
|
using namespace NEO;
|
|
|
|
typedef Test<ClDeviceFixture> Gen11SamplerTest;
|
|
|
|
GEN11TEST_F(Gen11SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) {
|
|
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE;
|
|
std::unique_ptr<MockContext> context(new MockContext());
|
|
std::unique_ptr<SamplerHw<FamilyType>> sampler(new SamplerHw<FamilyType>(context.get(), CL_FALSE, CL_ADDRESS_NONE, CL_FILTER_NEAREST));
|
|
auto stateWithoutAppendedParams = FamilyType::cmdInitSamplerState;
|
|
auto stateWithAppendedParams = FamilyType::cmdInitSamplerState;
|
|
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
|
|
sampler->appendSamplerStateParams(&stateWithAppendedParams);
|
|
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
|
|
}
|