EXSWHTEC-318 - Implement tests for 2D texture device functions #367

Change-Id: I5404eae219d23dc058aa6ef150a0764b06ab6de1
Этот коммит содержится в:
Mirza Halilčević
2023-12-28 14:22:01 +01:00
коммит произвёл Rakesh Roy
родитель da67d77a0c
Коммит 37d8529a9b
5 изменённых файлов: 363 добавлений и 10 удалений
+2 -9
Просмотреть файл
@@ -236,17 +236,10 @@ template <typename TexelType> class TextureReference {
return coord;
}
template <size_t N> float FloatToNBitFractional(float x) const {
constexpr size_t mult = 1 << N;
const auto x_trunc = std::trunc(x);
const auto x_frac = std::round((x - x_trunc) * mult) / mult;
return x_trunc + x_frac;
}
std::tuple<float, float> GetLinearFilteringParams(float coord) const {
const auto coordB = FloatToNBitFractional<8>(coord - 0.5f);
const auto coordB = coord - 0.5f;
const auto index = floorf(coordB);
const auto coeff = coordB - index;
const FixedPoint<8> coeff = coordB - index;
return {index, coeff};
}