Home | History | Annotate | Download | only in common

Lines Matching refs:sampler

39 static bool isSamplerSupported (const Sampler& sampler)
41 return sampler.compare == Sampler::COMPAREMODE_NONE &&
42 isWrapModeSupported(sampler.wrapS) &&
43 isWrapModeSupported(sampler.wrapT) &&
44 isWrapModeSupported(sampler.wrapR);
56 inline Vector<ScalarType, 4> lookup (const ConstPixelBufferAccess& access, const Sampler& sampler, int i, int j, int k)
61 return sampleTextureBorder<ScalarType>(access.getFormat(), sampler);
65 inline Vector<float, 4> lookup (const ConstPixelBufferAccess& access, const Sampler& sampler, int i, int j, int k)
74 return sampleTextureBorder<float>(access.getFormat(), sampler);
101 static void lookupQuad (ColorQuad& dst, const ConstPixelBufferAccess& level, const Sampler& sampler, int x0, int x1, int y0, int y1, int z)
103 dst.p00 = lookup<float>(level, sampler, x0, y0, z);
104 dst.p10 = lookup<float>(level, sampler, x1, y0, z);
105 dst.p01 = lookup<float>(level, sampler, x0, y1, z);
106 dst.p11 = lookup<float>(level, sampler, x1, y1, z);
115 static void lookupLine (ColorLine& dst, const ConstPixelBufferAccess& level, const Sampler& sampler, int x0, int x1, int y)
117 dst.p0 = lookup<float>(level, sampler, x0, y, 0);
118 dst.p1 = lookup<float>(level, sampler, x1, y, 0);
521 const Sampler& sampler,
529 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coordX, prec.coordBits.x(), prec.uvwBits.x());
536 const int x = wrap(sampler.wrapS, i, level.getWidth());
537 const Vector<ScalarType, 4> color = lookup<ScalarType>(level, sampler, x, coordY, 0);
548 const Sampler& sampler,
554 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
555 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
569 const int x = wrap(sampler.wrapS, i, level.getWidth());
570 const int y = wrap(sampler.wrapT, j, level.getHeight());
571 const Vector<ScalarType, 4> color = lookup<ScalarType>(level, sampler, x, y, coordZ);
583 const Sampler& sampler,
588 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
589 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
590 const Vec2 wBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getDepth(), coord.z(), prec.coordBits.z(), prec.uvwBits.z());
608 const int x = wrap(sampler.wrapS, i, level.getWidth());
609 const int y = wrap(sampler.wrapT, j, level.getHeight());
610 const int z = wrap(sampler.wrapR, k, level.getDepth());
611 const Vector<ScalarType, 4> color = lookup<ScalarType>(level, sampler, x, y, z);
623 const Sampler& sampler,
629 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coordX, prec.coordBits.x(), prec.uvwBits.x());
648 const int x0 = wrap(sampler.wrapS, i , w);
649 const int x1 = wrap(sampler.wrapS, i+1, w);
655 const Vec4 colorA = lookup<float>(level, sampler, x0, coordY, 0);
656 const Vec4 colorB = lookup<float>(level, sampler, x1, coordY, 0);
666 const Sampler& sampler,
672 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
673 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
700 const int x0 = wrap(sampler.wrapS, i , w);
701 const int x1 = wrap(sampler.wrapS, i+1, w);
702 const int y0 = wrap(sampler.wrapT, j , h);
703 const int y1 = wrap(sampler.wrapT, j+1, h);
712 lookupQuad(quad, level, sampler, x0, x1, y0, y1, coordZ);
726 const Sampler& sampler,
731 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
732 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
733 const Vec2 wBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getDepth(), coord.z(), prec.coordBits.z(), prec.uvwBits.z());
765 const int x0 = wrap(sampler.wrapS, i , w);
766 const int x1 = wrap(sampler.wrapS, i+1, w);
767 const int y0 = wrap(sampler.wrapT, j , h);
768 const int y1 = wrap(sampler.wrapT, j+1, h);
769 const int z0 = wrap(sampler.wrapR, k , d);
770 const int z1 = wrap(sampler.wrapR, k+1, d);
781 lookupQuad(quad0, level, sampler, x0, x1, y0, y1, z0);
782 lookupQuad(quad1, level, sampler, x0, x1, y0, y1, z1);
798 const Sampler& sampler,
808 const Vec2 uBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord, prec.coordBits.x(), prec.uvwBits.x());
809 const Vec2 uBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord, prec.coordBits.x(), prec.uvwBits.x());
821 const Vec4 c0 = lookup<float>(level0, sampler, wrap(sampler.wrapS, i0, w0), coordY, 0);
822 const Vec4 c1 = lookup<float>(level1, sampler, wrap(sampler.wrapS, i1, w1), coordY, 0);
834 const Sampler& sampler,
846 const Vec2 uBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
847 const Vec2 uBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
848 const Vec2 vBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h0, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
849 const Vec2 vBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h1, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
869 const Vec4 c0 = lookup<float>(level0, sampler, wrap(samplersampler.wrapT, j0, h0), coordZ);
870 const Vec4 c1 = lookup<float>(level1, sampler, wrap(sampler.wrapS, i1, w1), wrap(sampler.wrapT, j1, h1), coordZ);
884 const Sampler& sampler,
897 const Vec2 uBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
898 const Vec2 uBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
899 const Vec2 vBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h0, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
900 const Vec2 vBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h1, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
901 const Vec2 wBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, d0, coord.z(), prec.coordBits.z(), prec.uvwBits.z());
902 const Vec2 wBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, d1, coord.z(), prec.coordBits.z(), prec.uvwBits.z());
930 const Vec4 c0 = lookup<float>(level0, sampler, wrap(sampler.wrapS, i0, w0), wrap(sampler.wrapT, j0, h0), wrap(sampler.wrapR, k0, d0));
931 const Vec4 c1 = lookup<float>(level1, sampler, wrap(sampler.wrapS, i1, w1), wrap(sampler.wrapT, j1, h1), wrap(sampler.wrapR, k1, d1));
947 const Sampler& sampler,
960 const Vec2 uBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coordX, prec.coordBits.x(), prec.uvwBits.x());
961 const Vec2 uBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coordX, prec.coordBits.x(), prec.uvwBits.x());
984 const int x0 = wrap(sampler.wrapS, i0 , w0);
985 const int x1 = wrap(sampler.wrapS, i0+1, w0);
986 lookupLine(line0, level0, sampler, x0, x1, coordY);
1003 const int x0 = wrap(sampler.wrapS, i1 , w1);
1004 const int x1 = wrap(sampler.wrapS, i1+1, w1);
1005 lookupLine(line1, level1, sampler, x0, x1, coordY);
1026 const Sampler& sampler,
1041 const Vec2 uBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
1042 const Vec2 uBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
1043 const Vec2 vBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h0, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
1044 const Vec2 vBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h1, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
1073 const int x0 = wrap(sampler.wrapS, i0 , w0);
1074 const int x1 = wrap(sampler.wrapS, i0+1, w0);
1075 const int y0 = wrap(sampler.wrapT, j0 , h0);
1076 const int y1 = wrap(sampler.wrapT, j0+1, h0);
1077 lookupQuad(quad0, level0, sampler, x0, x1, y0, y1, coordZ);
1098 const int x0 = wrap(sampler.wrapS, i1 , w1);
1099 const int x1 = wrap(sampler.wrapS, i1+1, w1);
1100 const int y0 = wrap(sampler.wrapT, j1 , h1);
1101 const int y1 = wrap(sampler.wrapT, j1+1, h1);
1102 lookupQuad(quad1, level1, sampler, x0, x1, y0, y1, coordZ);
1128 const Sampler& sampler,
1144 const Vec2 uBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
1145 const Vec2 uBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
1146 const Vec2 vBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h0, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
1147 const Vec2 vBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h1, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
1148 const Vec2 wBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, d0, coord.z(), prec.coordBits.z(), prec.uvwBits.z());
1149 const Vec2 wBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, d1, coord.z(), prec.coordBits.z(), prec.uvwBits.z());
1184 const int x0 = wrap(sampler.wrapS, i0 , w0);
1185 const int x1 = wrap(sampler.wrapS, i0+1, w0);
1186 const int y0 = wrap(sampler.wrapT, j0 , h0);
1187 const int y1 = wrap(sampler.wrapT, j0+1, h0);
1188 const int z0 = wrap(sampler.wrapR, k0 , d0);
1189 const int z1 = wrap(sampler.wrapR, k0+1, d0);
1190 lookupQuad(quad00, level0, sampler, x0, x1, y0, y1, z0);
1191 lookupQuad(quad01, level0, sampler, x0, x1, y0, y1, z1);
1216 const int x0 = wrap(sampler.wrapS, i1 , w1);
1217 const int x1 = wrap(sampler.wrapS, i1+1, w1);
1218 const int y0 = wrap(sampler.wrapT, j1 , h1);
1219 const int y1 = wrap(sampler.wrapT, j1+1, h1);
1220 const int z0 = wrap(sampler.wrapR, k1 , d1);
1221 const int z1 = wrap(sampler.wrapR, k1+1, d1);
1222 lookupQuad(quad10, level1, sampler, x0, x1, y0, y1, z0);
1223 lookupQuad(quad11, level1, sampler, x0, x1, y0, y1, z1);
1254 const Sampler& sampler,
1255 const Sampler::FilterMode filterMode,
1261 if (filterMode == Sampler::LINEAR)
1262 return isLinearSampleResultValid(level, sampler, prec, coordX, coordY, result);
1264 return isNearestSampleResultValid(level, sampler, prec, coordX, coordY, result);
1268 const Sampler& sampler,
1269 const Sampler::FilterMode filterMode,
1275 if (filterMode == Sampler::LINEAR)
1276 return isLinearSampleResultValid(level, sampler, prec, coord, coordZ, result);
1278 return isNearestSampleResultValid(level, sampler, prec, coord, coordZ, result);
1283 const Sampler& sampler,
1284 const Sampler::FilterMode levelFilter,
1291 if (levelFilter == Sampler::LINEAR)
1292 return isLinearMipmapLinearSampleResultValid(level0, level1, sampler, prec, coordX, coordY, fBounds, result);
1294 return isNearestMipmapLinearSampleResultValid(level0, level1, sampler, prec, coordX, coordY, fBounds, result);
1299 const Sampler& sampler,
1300 const Sampler::FilterMode levelFilter,
1307 if (levelFilter == Sampler::LINEAR)
1308 return isLinearMipmapLinearSampleResultValid(level0, level1, sampler, prec, coord, coordZ, fBounds, result);
1310 return isNearestMipmapLinearSampleResultValid(level0, level1, sampler, prec, coord, coordZ, fBounds, result);
1313 bool isLookupResultValid (const Texture2DView& texture, const Sampler& sampler, const LookupPrecision& prec, const Vec2& coord, const Vec2& lodBounds, const Vec4& result)
1317 const bool canBeMagnified = minLod <= sampler.lodThreshold;
1318 const bool canBeMinified = maxLod > sampler.lodThreshold;
1320 DE_ASSERT(isSamplerSupported(sampler));
1324 if (isLevelSampleResultValid(texture.getLevel(0), sampler, sampler.magFilter, prec, coord, 0, result))
1330 const bool isNearestMipmap = isNearestMipmapFilter(sampler.minFilter);
1331 const bool isLinearMipmap = isLinearMipmapFilter(sampler.minFilter);
1349 if (isMipmapLinearSampleResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coord, 0, Vec2(minF, maxF), result))
1364 if (isLevelSampleResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coord, 0, result))
1370 if (isLevelSampleResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, coord, 0, result))
1378 bool isLookupResultValid (const Texture1DView& texture, const Sampler& sampler, const LookupPrecision& prec, const float coord, const Vec2& lodBounds, const Vec4& result)
1382 const bool canBeMagnified = minLod <= sampler.lodThreshold;
1383 const bool canBeMinified = maxLod > sampler.lodThreshold;
1385 DE_ASSERT(isSamplerSupported(sampler));
1389 if (isLevelSampleResultValid(texture.getLevel(0), sampler, sampler.magFilter, prec, coord, 0, result))
1395 const bool isNearestMipmap = isNearestMipmapFilter(sampler.minFilter);
1396 const bool isLinearMipmap = isLinearMipmapFilter(sampler.minFilter);
1414 if (isMipmapLinearSampleResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coord, 0, Vec2(minF, maxF), result))
1429 if (isLevelSampleResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coord, 0, result))
1435 if (isLevelSampleResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, coord, 0, result))
1444 const Sampler& sampler,
1451 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.s, prec.coordBits.x(), prec.uvwBits.x());
1452 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.t, prec.coordBits.y(), prec.uvwBits.y());
1490 quad.p00 = lookup<float>(faces[c00.face], sampler, c00.s, c00.t, 0);
1491 quad.p10 = lookup<float>(faces[c10.face], sampler, c10.s, c10.t, 0);
1492 quad.p01 = lookup<float>(faces[c01.face], sampler, c01.s, c01.t, 0);
1493 quad.p11 = lookup<float>(faces[c11.face], sampler, c11.s, c11.t, 0);
1508 const Sampler& sampler,
1520 const Vec2 uBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.s, prec.coordBits.x(), prec.uvwBits.x());
1521 const Vec2 uBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.s, prec.coordBits.x(), prec.uvwBits.x());
1522 const Vec2 vBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.t, prec.coordBits.y(), prec.uvwBits.y());
1523 const Vec2 vBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.t, prec.coordBits.y(), prec.uvwBits.y());
1562 quad0.p00 = lookup<float>(faces0[c00.face], sampler, c00.s, c00.t, 0);
1563 quad0.p10 = lookup<float>(faces0[c10.face], sampler, c10.s, c10.t, 0);
1564 quad0.p01 = lookup<float>(faces0[c01.face], sampler, c01.s, c01.t, 0);
1565 quad0.p11 = lookup<float>(faces0[c11.face], sampler, c11.s, c11.t, 0);
1594 quad1.p00 = lookup<float>(faces1[c00.face], sampler, c00.s, c00.t, 0);
1595 quad1.p10 = lookup<float>(faces1[c10.face], sampler, c10.s, c10.t, 0);
1596 quad1.p01 = lookup<float>(faces1[c01.face], sampler, c01.s, c01.t, 0);
1597 sampler, c11.s, c11.t, 0);
1622 const Sampler& sampler,
1623 const Sampler::FilterMode filterMode,
1628 if (filterMode == Sampler::LINEAR)
1630 if (sampler.seamlessCubeMap)
1631 return isSeamlessLinearSampleResultValid(level, sampler, prec, coords, result);
1633 return isLinearSampleResultValid(level[coords.face], sampler, prec, Vec2(coords.s, coords.t), 0, result);
1636 return isNearestSampleResultValid(level[coords.face], sampler, prec, Vec2(coords.s, coords.t), 0, result);
1641 const Sampler& sampler,
1642 const Sampler::FilterMode levelFilter,
1648 if (levelFilter == Sampler::LINEAR)
1650 if (sampler.seamlessCubeMap)
1651 return isSeamplessLinearMipmapLinearSampleResultValid(faces0, faces1, sampler, prec, coords, fBounds, result);
1653 return isLinearMipmapLinearSampleResultValid(faces0[coords.face], faces1[coords.face], sampler, prec, Vec2(coords.s, coords.t), 0, fBounds, result);
1656 return isNearestMipmapLinearSampleResultValid(faces0[coords.face], faces1[coords.face], sampler, prec, Vec2(coords.s, coords.t), 0, fBounds, result);
1665 bool isLookupResultValid (const TextureCubeView& texture, const Sampler& sampler, const LookupPrecision& prec, const Vec3& coord, const Vec2& lodBounds, const Vec4& result)
1670 DE_ASSERT(isSamplerSupported(sampler));
1682 const bool canBeMagnified = minLod <= sampler.lodThreshold;
1683 const bool canBeMinified = maxLod > sampler.lodThreshold;
1690 if (isCubeLevelSampleResultValid(faces, sampler, sampler.magFilter, prec, faceCoords, result))
1696 const bool isNearestMipmap = isNearestMipmapFilter(sampler.minFilter);
1697 const bool isLinearMipmap = isLinearMipmapFilter(sampler.minFilter);
1721 if (isCubeMipmapLinearSampleResultValid(faces0, faces1, sampler, getLevelFilter(sampler.minFilter), prec, faceCoords, Vec2(minF, maxF), result))
1739 if (isCubeLevelSampleResultValid(faces, sampler, getLevelFilter(sampler.minFilter), prec, faceCoords, result))
1748 if (isCubeLevelSampleResultValid(faces, sampler, sampler.minFilter, prec, faceCoords, result))
1768 bool isLookupResultValid (const Texture1DArrayView& texture, const Sampler& sampler, const LookupPrecision& prec, const Vec2& coord, const Vec2& lodBounds, const Vec4& result)
1774 const bool canBeMagnified = minLod <= sampler.lodThreshold;
1775 const bool canBeMinified = maxLod > sampler.lodThreshold;
1777 DE_ASSERT(isSamplerSupported(sampler));
1783 if (isLevelSampleResultValid(texture.getLevel(0), sampler, sampler.magFilter, prec, coordX, layer, result))
1789 const bool isNearestMipmap = isNearestMipmapFilter(sampler.minFilter);
1790 const bool isLinearMipmap = isLinearMipmapFilter(sampler.minFilter);
1808 if (isMipmapLinearSampleResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coordX, layer, Vec2(minF, maxF), result))
1823 if (isLevelSampleResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coordX, layer, result))
1829 if (isLevelSampleResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, coordX, layer, result))
1838 bool isLookupResultValid (const Texture2DArrayView& texture, const Sampler& sampler, const LookupPrecision& prec, const Vec3& coord, const Vec2& lodBounds, const Vec4& result)
1844 const bool canBeMagnified = minLod <= sampler.lodThreshold;
1845 const bool canBeMinified = maxLod > sampler.lodThreshold;
1847 DE_ASSERT(isSamplerSupported(sampler));
1853 if (isLevelSampleResultValid(texture.getLevel(0), sampler, sampler.magFilter, prec, coordXY, layer, result))
1859 const bool isNearestMipmap = isNearestMipmapFilter(sampler.minFilter);
1860 const bool isLinearMipmap = isLinearMipmapFilter(sampler.minFilter);
1878 if (isMipmapLinearSampleResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coordXY, layer, Vec2(minF, maxF), result))
1893 if (isLevelSampleResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coordXY, layer, result))
1899 if (isLevelSampleResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, coordXY, layer, result))
1909 const Sampler& sampler,
1910 const Sampler::FilterMode filterMode,
1915 if (filterMode == Sampler::LINEAR)
1916 return isLinearSampleResultValid(level, sampler, prec, coord, result);
1918 return isNearestSampleResultValid(level, sampler, prec, coord, result);
1923 const Sampler& sampler,
1924 const Sampler::FilterMode levelFilter,
1930 if (levelFilter == Sampler::LINEAR)
1931 return isLinearMipmapLinearSampleResultValid(level0, level1, sampler, prec, coord, fBounds, result);
1933 return isNearestMipmapLinearSampleResultValid(level0, level1, sampler, prec, coord, fBounds, result);
1936 bool isLookupResultValid (const Texture3DView& texture, const Sampler& sampler, const LookupPrecision& prec, const Vec3& coord, const Vec2& lodBounds, const Vec4& result)
1940 const bool canBeMagnified = minLod <= sampler.lodThreshold;
1941 const bool canBeMinified = maxLod > sampler.lodThreshold;
1943 DE_ASSERT(isSamplerSupported(sampler));
1947 if (isLevelSampleResultValid(texture.getLevel(0), sampler, sampler.magFilter, prec, coord, result))
1953 const bool isNearestMipmap = isNearestMipmapFilter(sampler.minFilter);
1954 const bool isLinearMipmap = isLinearMipmapFilter(sampler.minFilter);
1972 if (isMipmapLinearSampleResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coord, Vec2(minF, maxF), result))
1987 if (isLevelSampleResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coord, result))
1993 if (isLevelSampleResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, coord, result))
2013 bool isLookupResultValid (const TextureCubeArrayView& texture, const Sampler& sampler, const LookupPrecision& prec, const IVec4& coordBits, const Vec4& coord, const Vec2& lodBounds, const Vec4& result)
2020 DE_ASSERT(isSamplerSupported(sampler));
2034 const bool canBeMagnified = minLod <= sampler.lodThreshold;
2035 const bool canBeMinified = maxLod > sampler.lodThreshold;
2042 if (isCubeLevelSampleResultValid(faces, sampler, sampler.magFilter, prec, faceCoords, result))
2048 const bool isNearestMipmap = isNearestMipmapFilter(sampler.minFilter);
2049 const bool isLinearMipmap = isLinearMipmapFilter(sampler.minFilter);
2073 if (isCubeMipmapLinearSampleResultValid(faces0, faces1, sampler, getLevelFilter(sampler.minFilter), prec, faceCoords, Vec2(minF, maxF), result))
2091 if (isCubeLevelSampleResultValid(faces, sampler, getLevelFilter(sampler.minFilter), prec, faceCoords, result))
2100 if (isCubeLevelSampleResultValid(faces, sampler, sampler.minFilter, prec, faceCoords, result))
2214 const Sampler& sampler,
2221 const Sampler::FilterMode filterMode = scaleMode == TEX_LOOKUP_SCALE_MAGNIFY ? sampler.magFilter : sampler.minFilter;
2222 return isLevelSampleResultValid(access, sampler, filterMode, prec, coordX, coordY, result);
2226 const Sampler& sampler,
2233 DE_ASSERT(sampler.minFilter == Sampler::NEAREST && sampler.magFilter == Sampler::NEAREST);
2235 return isNearestSampleResultValid(access, sampler, prec, coordX, coordY, result);
2239 const Sampler& sampler,
2246 DE_ASSERT(sampler.minFilter == Sampler::NEAREST && sampler.magFilter == Sampler::NEAREST);
2248 return isNearestSampleResultValid(access, sampler, prec, coordX, coordY, result);
2252 const Sampler& sampler,
2259 const Sampler::FilterMode filterMode = scaleMode == TEX_LOOKUP_SCALE_MAGNIFY ? sampler.magFilter : sampler.minFilter;
2260 return isLevelSampleResultValid(access, sampler, filterMode, prec, coord, coordZ, result);
2264 const Sampler& sampler,
2271 DE_ASSERT(sampler.minFilter == Sampler::NEAREST && sampler.magFilter == Sampler::NEAREST);
2273 return isNearestSampleResultValid(access, sampler, prec, coord, coordZ, result);
2277 const Sampler& sampler,
2284 DE_ASSERT(sampler.minFilter == Sampler::NEAREST && sampler.magFilter == Sampler::NEAREST);
2286 return isNearestSampleResultValid(access, sampler, prec, coord, coordZ, result);
2290 const Sampler& sampler,
2296 const tcu::Sampler::FilterMode filterMode = scaleMode == TEX_LOOKUP_SCALE_MAGNIFY ? sampler.magFilter : sampler.minFilter;
2297 return isLevelSampleResultValid(access, sampler, filterMode, prec, coord, result);
2301 const Sampler& sampler,
2307 DE_ASSERT(sampler.minFilter == Sampler::NEAREST && sampler.magFilter == Sampler::NEAREST);
2309 return isNearestSampleResultValid(access, sampler, prec, coord, result);
2313 const Sampler& sampler,
2319 DE_ASSERT(sampler.minFilter == Sampler::NEAREST && sampler.magFilter == Sampler::NEAREST);
2321 return isNearestSampleResultValid(access, sampler, prec, coord, result);
2326 const Sampler& sampler,
2334 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
2335 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
2354 const int x = wrap(sampler.wrapS, i+offsets[offNdx].x(), w);
2355 const int y = wrap(sampler.wrapT, j+offsets[offNdx].y(), h);
2356 color[offNdx] = lookup<ScalarType>(level, sampler, x, y, coordZ)[componentNdx];
2368 const Sampler& sampler,
2375 return isGatherOffsetsResultValid(texture.getLevel(0), sampler, prec, coord, 0, componentNdx, offsets, result);
2379 const Sampler& sampler,
2386 return isGatherOffsetsResultValid(texture.getLevel(0), sampler, prec, coord, 0, componentNdx, offsets, result);
2390 const Sampler& sampler,
2397 return isGatherOffsetsResultValid(texture.getLevel(0), sampler, prec, coord, 0, componentNdx, offsets, result);
2402 const Sampler& sampler,
2412 if (isGatherOffsetsResultValid(texture.getLevel(0), sampler, prec, coord.swizzle(0,1), layer, componentNdx, offsets, result))
2419 const Sampler& sampler,
2426 return is2DArrayGatherOffsetsResultValid(texture, sampler, prec, coord, componentNdx, offsets, result);
2430 const Sampler& sampler,
2437 return is2DArrayGatherOffsetsResultValid(texture, sampler, prec, coord, componentNdx, offsets, result);
2441 const Sampler& sampler,
2448 return is2DArrayGatherOffsetsResultValid(texture, sampler, prec, coord, componentNdx, offsets, result);
2453 const Sampler& sampler,
2461 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.s, prec.coordBits.x(), prec.uvwBits.x());
2462 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.t, prec.coordBits.y(), prec.uvwBits.y());
2497 color[offNdx] = lookup<ScalarType>(faces[c.face], sampler, c.s, c.t, 0)[componentNdx];
2510 const Sampler& sampler,
2528 if (isGatherResultValid(texture, sampler, prec, faceCoords, componentNdx, result))
2536 const Sampler& sampler,
2542 return isCubeGatherResultValid(texture, sampler, prec, coord, componentNdx, result);
2546 const Sampler& sampler,
2552 return isCubeGatherResultValid(texture, sampler, prec, coord, componentNdx, result);
2556 const Sampler& sampler,
2562 return isCubeGatherResultValid(texture, sampler, prec, coord, componentNdx, result);