Correctly set normalized mode in zeSamplerCreate()

Change-Id: If9d595136668e2a12b1871c7dc06f96101eba10d
Signed-off: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga 2020-04-12 14:40:17 -07:00 committed by sys_ocldev
parent e8085c5740
commit ac4e9c129a
2 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,8 @@ ze_result_t SamplerCoreFamily<gfxCoreFamily>::initialize(Device *device, const z
return ret;
}
samplerState.setNonNormalizedCoordinateEnable(!desc->isNormalized);
auto addressControlModeX = SAMPLER_STATE::TEXTURE_COORDINATE_MODE_CLAMP_BORDER;
auto addressControlModeY = SAMPLER_STATE::TEXTURE_COORDINATE_MODE_CLAMP_BORDER;
auto addressControlModeZ = SAMPLER_STATE::TEXTURE_COORDINATE_MODE_CLAMP_BORDER;

View File

@ -57,6 +57,12 @@ HWTEST2_P(SamplerCreateTest, givenDifferentDescriptorValuesThenSamplerIsCorrectl
sampler->initialize(device, &desc);
if (isNormalized == static_cast<ze_bool_t>(true)) {
EXPECT_FALSE(sampler->samplerState.getNonNormalizedCoordinateEnable());
} else {
EXPECT_TRUE(sampler->samplerState.getNonNormalizedCoordinateEnable());
}
if (addressMode == ZE_SAMPLER_ADDRESS_MODE_NONE) {
EXPECT_EQ(SAMPLER_STATE::TEXTURE_COORDINATE_MODE_CLAMP_BORDER,
sampler->samplerState.getTcxAddressControlMode());