Improve Sampler programming

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-08-25 10:28:05 +00:00
committed by Compute-Runtime-Automation
parent 54cf561e09
commit 856dee2b08
18 changed files with 76 additions and 79 deletions

View File

@@ -87,7 +87,6 @@ class Sampler : public BaseObject<_cl_sampler> {
template <typename GfxFamily>
struct SamplerHw : public Sampler {
void setArg(void *memory, const HardwareInfo &hwInfo) override;
void appendSamplerStateParams(typename GfxFamily::SAMPLER_STATE *state, const HardwareInfo &hwInfo);
static constexpr float getGenSamplerMaxLod() {
return 14.0f;
}

View File

@@ -6,6 +6,7 @@
*/
#include "shared/source/helpers/populate_factory.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/utilities/numeric.h"
#include <algorithm>
@@ -87,11 +88,7 @@ void SamplerHw<GfxFamily>::setArg(void *memory, const HardwareInfo &hwInfo) {
samplerState->setMinLod(minLodValue.getRawAccess());
samplerState->setMaxLod(maxLodValue.getRawAccess());
appendSamplerStateParams(samplerState, hwInfo);
}
template <typename GfxFamily>
void SamplerHw<GfxFamily>::appendSamplerStateParams(typename GfxFamily::SAMPLER_STATE *state, const HardwareInfo &hwInfo) {
HwInfoConfig::get(hwInfo.platform.eProductFamily)->adjustSamplerState(samplerState, hwInfo);
}
template <typename GfxFamily>

View File

@@ -5,21 +5,9 @@
*
*/
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "opencl/source/sampler/sampler.h"
#include "opencl/source/sampler/sampler.inl"
namespace NEO {
using SAMPLER_STATE = typename Family::SAMPLER_STATE;
template <>
void SamplerHw<Family>::appendSamplerStateParams(SAMPLER_STATE *state, const HardwareInfo &hwInfo) {
if (DebugManager.flags.ForceSamplerLowFilteringPrecision.get()) {
state->setLowQualityFilter(SAMPLER_STATE::LOW_QUALITY_FILTER_ENABLE);
}
}
#include "opencl/source/sampler/sampler_factory_init.inl"
} // namespace NEO