mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Improve Sampler programming
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
54cf561e09
commit
856dee2b08
@ -5,9 +5,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/sampler/sampler.h"
|
||||
#include "shared/source/os_interface/hw_info_config.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>
|
||||
@ -18,11 +18,9 @@ typedef Test<ClDeviceFixture> Gen8SamplerTest;
|
||||
|
||||
GEN8TEST_F(Gen8SamplerTest, 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, *defaultHwInfo);
|
||||
HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->adjustSamplerState(&stateWithAppendedParams, *defaultHwInfo);
|
||||
EXPECT_TRUE(memcmp(&stateWithoutAppendedParams, &stateWithAppendedParams, sizeof(SAMPLER_STATE)) == 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user