From 0791898c9e0a07369934490a299c55d50ae98e7a Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Thu, 21 Apr 2022 15:12:57 +0000 Subject: [PATCH] Improve L0 sampler_state programming Signed-off-by: Bartosz Dunajski --- level_zero/core/source/sampler/sampler_hw.h | 4 ++-- level_zero/core/source/sampler/sampler_hw.inl | 4 +++- level_zero/core/source/xe_hpg_core/dg2/sampler_dg2.cpp | 8 ++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/level_zero/core/source/sampler/sampler_hw.h b/level_zero/core/source/sampler/sampler_hw.h index ffdccd86f1..c3c1eedcf3 100644 --- a/level_zero/core/source/sampler/sampler_hw.h +++ b/level_zero/core/source/sampler/sampler_hw.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ struct SamplerCoreFamily : public SamplerImp { using BaseClass = SamplerImp; ze_result_t initialize(Device *device, const ze_sampler_desc_t *desc) override; - virtual void appendSamplerStateParams(SAMPLER_STATE *state){}; + void copySamplerStateToDSH(void *dynamicStateHeap, const uint32_t dynamicStateHeapSize, const uint32_t offset) override; diff --git a/level_zero/core/source/sampler/sampler_hw.inl b/level_zero/core/source/sampler/sampler_hw.inl index d220c2205e..2426f2bb09 100644 --- a/level_zero/core/source/sampler/sampler_hw.inl +++ b/level_zero/core/source/sampler/sampler_hw.inl @@ -107,7 +107,9 @@ ze_result_t SamplerCoreFamily::initialize(Device *device, const z samplerState.setMinLod(minLodValue.getRawAccess()); samplerState.setMaxLod(maxLodValue.getRawAccess()); - appendSamplerStateParams(&samplerState); + auto &hwInfo = device->getHwInfo(); + + NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily)->adjustSamplerState(&samplerState, hwInfo); return ZE_RESULT_SUCCESS; } diff --git a/level_zero/core/source/xe_hpg_core/dg2/sampler_dg2.cpp b/level_zero/core/source/xe_hpg_core/dg2/sampler_dg2.cpp index cb6dd8f6d1..cb3738f7f7 100644 --- a/level_zero/core/source/xe_hpg_core/dg2/sampler_dg2.cpp +++ b/level_zero/core/source/xe_hpg_core/dg2/sampler_dg2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,11 +14,7 @@ template struct SamplerCoreFamily; template <> struct SamplerProductFamily : public SamplerCoreFamily { using SamplerCoreFamily::SamplerCoreFamily; - void appendSamplerStateParams(SAMPLER_STATE *state) override { - if (NEO::DebugManager.flags.ForceSamplerLowFilteringPrecision.get()) { - state->setLowQualityFilter(SAMPLER_STATE::LOW_QUALITY_FILTER_ENABLE); - } - } + ze_result_t initialize(Device *device, const ze_sampler_desc_t *desc) override { return SamplerCoreFamily::initialize(device, desc); };