Add hwInfo to sampler setArg and appendSamplerStateParams

Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska
2021-02-05 01:58:42 +00:00
committed by Compute-Runtime-Automation
parent 7dad49ccf4
commit 9d0422cf69
15 changed files with 51 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -50,7 +50,7 @@ class Sampler : public BaseObject<_cl_sampler> {
cl_int getInfo(cl_sampler_info paramName, size_t paramValueSize,
void *paramValue, size_t *paramValueSizeRet);
virtual void setArg(void *memory) = 0;
virtual void setArg(void *memory, const HardwareInfo &hwInfo) = 0;
static size_t getSamplerStateSize(const HardwareInfo &hwInfo);
bool isTransformable() const;
@@ -86,8 +86,8 @@ class Sampler : public BaseObject<_cl_sampler> {
template <typename GfxFamily>
struct SamplerHw : public Sampler {
void setArg(void *memory) override;
void appendSamplerStateParams(typename GfxFamily::SAMPLER_STATE *state);
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

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -13,7 +13,7 @@
namespace NEO {
template <typename GfxFamily>
void SamplerHw<GfxFamily>::setArg(void *memory) {
void SamplerHw<GfxFamily>::setArg(void *memory, const HardwareInfo &hwInfo) {
using SAMPLER_STATE = typename GfxFamily::SAMPLER_STATE;
auto samplerState = reinterpret_cast<SAMPLER_STATE *>(memory);
samplerState->setNonNormalizedCoordinateEnable(!this->normalizedCoordinates);
@@ -87,11 +87,11 @@ void SamplerHw<GfxFamily>::setArg(void *memory) {
samplerState->setMinLod(minLodValue.getRawAccess());
samplerState->setMaxLod(maxLodValue.getRawAccess());
appendSamplerStateParams(samplerState);
appendSamplerStateParams(samplerState, hwInfo);
}
template <typename GfxFamily>
void SamplerHw<GfxFamily>::appendSamplerStateParams(typename GfxFamily::SAMPLER_STATE *state) {
void SamplerHw<GfxFamily>::appendSamplerStateParams(typename GfxFamily::SAMPLER_STATE *state, const HardwareInfo &hwInfo) {
}
template <typename GfxFamily>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2020 Intel Corporation
* Copyright (C) 2019-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -15,7 +15,7 @@ namespace NEO {
using SAMPLER_STATE = typename Family::SAMPLER_STATE;
template <>
void SamplerHw<Family>::appendSamplerStateParams(SAMPLER_STATE *state) {
void SamplerHw<Family>::appendSamplerStateParams(SAMPLER_STATE *state, const HardwareInfo &hwInfo) {
if (DebugManager.flags.ForceSamplerLowFilteringPrecision.get()) {
state->setLowQualityFilter(SAMPLER_STATE::LOW_QUALITY_FILTER_ENABLE);
}