Home | History | Annotate | Download | only in common

Lines Matching refs:sampler

38 static bool isSamplerSupported (const Sampler& sampler)
40 return sampler.compare != Sampler::COMPAREMODE_NONE &&
41 isWrapModeSupported(sampler.wrapS) &&
42 isWrapModeSupported(sampler.wrapT) &&
43 isWrapModeSupported(sampler.wrapR);
59 static CmpResultSet execCompare (const Sampler::CompareMode compareMode,
73 case Sampler::COMPAREMODE_LESS:
78 case Sampler::COMPAREMODE_LESS_OR_EQUAL:
83 case Sampler::COMPAREMODE_GREATER:
88 case Sampler::COMPAREMODE_GREATER_OR_EQUAL:
93 case Sampler::COMPAREMODE_EQUAL:
98 case Sampler::COMPAREMODE_NOT_EQUAL:
103 case Sampler::COMPAREMODE_ALWAYS:
107 case Sampler::COMPAREMODE_NEVER:
134 static float lookupDepth (const tcu::ConstPixelBufferAccess& access, const Sampler& sampler, int i, int j, int k)
139 return sampleTextureBorder<float>(access.getFormat(), sampler).x();
143 static float lookupDepthNoBorder (const tcu::ConstPixelBufferAccess& access, const Sampler& sampler, int i, int j, int k = 0)
145 DE_UNREF(sampler);
192 static bool isLinearCompareValid (const Sampler::CompareMode compareMode,
257 static bool isBilinearAnyCompareValid (const Sampler::CompareMode compareMode,
287 static bool isBilinearPCFCompareValid (const Sampler::CompareMode compareMode,
360 static bool isBilinearCompareValid (const Sampler::CompareMode compareMode,
375 static bool isTrilinearAnyCompareValid (const Sampler::CompareMode compareMode,
420 static bool isTrilinearPCFCompareValid (const Sampler::CompareMode compareMode,
521 static bool isTrilinearCompareValid (const Sampler::CompareMode compareMode,
541 const Sampler& sampler,
549 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
550 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
562 const int x = wrap(sampler.wrapS, i, level.getWidth());
563 const int y = wrap(sampler.wrapT, j, level.getHeight());
564 const float depth = lookupDepth(level, sampler, x, y, coordZ);
565 const CmpResultSet resSet = execCompare(sampler.compare, depth, cmpReference, prec.referenceBits, isFixedPointDepth);
576 const Sampler& sampler,
584 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
585 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
603 const int x0 = wrap(sampler.wrapS, i , w);
604 const int x1 = wrap(sampler.wrapS, i+1, w);
605 const int y0 = wrap(sampler.wrapT, j , h);
606 const int y1 = wrap(sampler.wrapT, j+1, h);
614 const Vec4 depths (lookupDepth(level, sampler, x0, y0, coordZ),
615 lookupDepth(level, sampler, x1, y0, coordZ),
616 lookupDepth(level, sampler, x0, y1, coordZ),
617 lookupDepth(level, sampler, x1, y1, coordZ));
619 if (isBilinearCompareValid(sampler.compare, prec, depths, Vec2(minA, maxA), Vec2(minB, maxB), cmpReference, result, isFixedPointDepth))
628 const Sampler& sampler,
629 const Sampler::FilterMode filterMode,
636 if (filterMode == Sampler::LINEAR)
637 return isLinearCompareResultValid(level, sampler, prec, coord, coordZ, cmpReference, result);
639 return isNearestCompareResultValid(level, sampler, prec, coord, coordZ, cmpReference, result);
644 const Sampler& sampler,
659 const Vec2 uBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
660 const Vec2 uBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
661 const Vec2 vBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h0, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
662 const Vec2 vBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h1, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
678 const float depth0 = lookupDepth(level0, sampler, wrap(sampler.wrapS, i0, w0), wrap(sampler.wrapT, j0, h0), coordZ);
684 const float depth1 = lookupDepth(level1, sampler, wrap(sampler.wrapS, i1, w1), wrap(sampler.wrapT, j1, h1), coordZ);
686 if (isLinearCompareValid(sampler.compare, prec, Vec2(depth0, depth1), fBounds, cmpReference, result, isFixedPointDepth))
698 const Sampler& sampler,
716 const Vec2 uBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
717 const Vec2 uBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord.x(), prec.coordBits.x(), prec.uvwBits.x());
718 const Vec2 vBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h0, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
719 const Vec2 vBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, h1, coord.y(), prec.coordBits.y(), prec.uvwBits.y());
742 const int x0 = wrap(sampler.wrapS, i0 , w0);
743 const int x1 = wrap(sampler.wrapS, i0+1, w0);
744 const int y0 = wrap(sampler.wrapT, j0 , h0);
745 const int y1 = wrap(sampler.wrapT, j0+1, h0);
747 depths0[0] = lookupDepth(level0, sampler, x0, y0, coordZ);
748 depths0[1] = lookupDepth(level0, sampler, x1, y0, coordZ);
749 depths0[2] = lookupDepth(level0, sampler, x0, y1, coordZ);
750 depths0[3] = lookupDepth(level0, sampler, x1, y1, coordZ);
764 const int x0 = wrap(sampler.wrapS, i1 , w1);
765 const int x1 = wrap(sampler.wrapS, i1+1, w1);
766 const int y0 = wrap(sampler.wrapT, j1 , h1);
767 const int y1 = wrap(sampler.wrapT, j1+1, h1);
769 depths1[0] = lookupDepth(level1, sampler, x0, y0, coordZ);
770 depths1[1] = lookupDepth(level1, sampler, x1, y0, coordZ);
771 depths1[2] = lookupDepth(level1, sampler, x0, y1, coordZ);
772 depths1[3] = lookupDepth(level1, sampler, x1, y1, coordZ);
775 if (isTrilinearCompareValid(sampler.compare, prec, depths0, depths1,
790 const Sampler& sampler,
791 const Sampler::FilterMode levelFilter,
799 if (levelFilter == Sampler::LINEAR)
800 return isLinearMipmapLinearCompareResultValid(level0, level1, sampler, prec, coord, coordZ, fBounds, cmpReference, result);
802 return isNearestMipmapLinearCompareResultValid(level0, level1, sampler, prec, coord, coordZ, fBounds, cmpReference, result);
806 const Sampler& sampler,
815 const bool canBeMagnified = minLod <= sampler.lodThreshold;
816 const bool canBeMinified = maxLod > sampler.lodThreshold;
818 DE_ASSERT(isSamplerSupported(sampler));
822 sampler, sampler.magFilter, prec, coord, 0, cmpReference, result))
828 const bool isNearestMipmap = isNearestMipmapFilter(sampler.minFilter);
829 const bool isLinearMipmap = isLinearMipmapFilter(sampler.minFilter);
847 if (isMipmapLinearCompareResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coord, 0, Vec2(minF, maxF), cmpReference, result))
862 if (isLevelCompareResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coord, 0, cmpReference, result))
868 if (isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, coord, 0, cmpReference, result))
878 const Sampler& sampler,
889 const Vec2 uBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.s, prec.coordBits.x(), prec.uvwBits.x());
890 const Vec2 uBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.s, prec.coordBits.x(), prec.uvwBits.x());
891 const Vec2 vBounds0 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.t, prec.coordBits.y(), prec.uvwBits.y());
892 const Vec2 vBounds1 = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.t, prec.coordBits.y(), prec.uvwBits.y());
934 depths0[0] = lookupDepthNoBorder(faces0[c00.face], sampler, c00.s, c00.t);
935 depths0[1] = lookupDepthNoBorder(faces0[c10.face], sampler, c10.s, c10.t);
936 depths0[2] = lookupDepthNoBorder(faces0[c01.face], sampler, c01.s, c01.t);
937 depths0[3] = lookupDepthNoBorder(faces0[c11.face], sampler, c11.s, c11.t);
959 depths1[0] = lookupDepthNoBorder(faces1[c00.face], sampler, c00.s, c00.t);
960 depths1[1] = lookupDepthNoBorder(faces1[c10.face], sampler, c10.s, c10.t);
961 depths1[2] = lookupDepthNoBorder(faces1[c01.face], sampler, c01.s, c01.t);
962 depths1[3] = lookupDepthNoBorder(faces1[c11.face], sampler, c11.s, c11.t);
966 if (isTrilinearCompareValid(sampler.compare, prec, depths0, depths1,
981 const Sampler& sampler,
982 const Sampler::FilterMode levelFilter,
989 if (levelFilter == Sampler::LINEAR)
991 if (sampler.seamlessCubeMap)
992 return isSeamplessLinearMipmapLinearCompareResultValid(texture, baseLevelNdx, sampler, prec, coords, fBounds, cmpReference, result);
996 sampler, prec, Vec2(coords.s, coords.t), 0, fBounds, cmpReference, result);
1001 sampler, prec, Vec2(coords.s, coords.t), 0, fBounds, cmpReference, result);
1006 const Sampler& sampler,
1015 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.s, prec.coordBits.x(), prec.uvwBits.x());
1016 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.t, prec.coordBits.y(), prec.uvwBits.y());
1050 depths[0] = lookupDepthNoBorder(faces[c00.face], sampler, c00.s, c00.t);
1051 depths[1] = lookupDepthNoBorder(faces[c10.face], sampler, c10.s, c10.t);
1052 depths[2] = lookupDepthNoBorder(faces[c01.face], sampler, c01.s, c01.t);
1053 depths[3] = lookupDepthNoBorder(faces[c11.face], sampler, c11.s, c11.t);
1055 if (isBilinearCompareValid(sampler.compare, prec, depths, Vec2(minA, maxA), Vec2(minB, maxB), cmpReference, result, isFixedPointDepth))
1065 const Sampler& sampler,
1066 const Sampler::FilterMode filterMode,
1072 if (filterMode == Sampler::LINEAR)
1074 if (sampler.seamlessCubeMap)
1075 return isSeamlessLinearCompareResultValid(texture, levelNdx, sampler, prec, coords, cmpReference, result);
1077 return isLinearCompareResultValid(texture.getLevelFace(levelNdx, coords.face), sampler, prec, Vec2(coords.s, coords.t), 0, cmpReference, result);
1080 return isNearestCompareResultValid(texture.getLevelFace(levelNdx, coords.face), sampler, prec, Vec2(coords.s, coords.t), 0, cmpReference, result);
1083 bool isTexCompareResultValid (const TextureCubeView& texture, const Sampler& sampler, const TexComparePrecision& prec, const Vec3& coord, const Vec2& lodBounds, const float cmpReference, const float result)
1088 DE_ASSERT(isSamplerSupported(sampler));
1100 const bool canBeMagnified = minLod <= sampler.lodThreshold;
1101 const bool canBeMinified = maxLod > sampler.lodThreshold;
1105 if (isCubeLevelCompareResultValid(texture, 0, sampler, sampler.magFilter, prec, faceCoords, cmpReference, result))
1111 const bool isNearestMipmap = isNearestMipmapFilter(sampler.minFilter);
1112 const bool isLinearMipmap = isLinearMipmapFilter(sampler.minFilter);
1130 if (isCubeMipmapLinearCompareResultValid(texture, level, sampler, getLevelFilter(sampler.minFilter), prec, faceCoords, Vec2(minF, maxF), cmpReference, result))
1145 if (isCubeLevelCompareResultValid(texture, level, sampler, getLevelFilter(sampler.minFilter), prec, faceCoords, cmpReference, result))
1151 if (isCubeLevelCompareResultValid(texture, 0, sampler, sampler.minFilter, prec, faceCoords, cmpReference, result))
1160 bool isTexCompareResultValid (const Texture2DArrayView& texture, const Sampler& sampler, const TexComparePrecision& prec, const Vec3& coord, const Vec2& lodBounds, const float cmpReference, const float result)
1168 DE_ASSERT(isSamplerSupported(sampler));
1174 const bool canBeMagnified = minLod <= sampler.lodThreshold;
1175 const bool canBeMinified = maxLod > sampler.lodThreshold;
1179 if (isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.magFilter, prec, coord.swizzle(0,1), layer, cmpReference, result))
1185 const bool isNearestMipmap = isNearestMipmapFilter(sampler.minFilter);
1186 sampler.minFilter);
1204 if (isMipmapLinearCompareResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coord.swizzle(0,1), layer, Vec2(minF, maxF), cmpReference, result))
1219 if (isLevelCompareResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coord.swizzle(0,1), layer, cmpReference, result))
1225 if (isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, coord.swizzle(0,1), layer, cmpReference, result))
1235 const Sampler& sampler,
1244 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, texture.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
1245 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, texture.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
1265 const int x = wrap(sampler.wrapS, i+offsets[offNdx].x(), w);
1266 const int y = wrap(sampler.wrapT, j+offsets[offNdx].y(), h);
1267 const float depth = lookupDepth(texture, sampler, x, y, coordZ);
1268 const CmpResultSet resSet = execCompare(sampler.compare, depth, cmpReference, prec.referenceBits, isFixedPointDepth);
1283 const Sampler& sampler,
1290 DE_ASSERT(isSamplerSupported(sampler));
1292 return isGatherOffsetsCompareResultValid(texture.getLevel(0), sampler, prec, coord, 0, offsets, cmpReference, result);
1296 const Sampler& sampler,
1309 DE_ASSERT(isSamplerSupported(sampler));
1313 if (isGatherOffsetsCompareResultValid(texture.getLevel(0), sampler, prec, coord.swizzle(0,1), layer, offsets, cmpReference, result))
1320 const Sampler& sampler,
1328 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.s, prec.coordBits.x(), prec.uvwBits.x());
1329 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.t, prec.coordBits.y(), prec.uvwBits.y());
1365 const float depth = lookupDepthNoBorder(faces[c.face], sampler, c.s, c.t);
1366 const CmpResultSet resSet = execCompare(sampler.compare, depth, cmpReference, prec.referenceBits, isFixedPointDepth);
1381 const Sampler& sampler,
1390 DE_ASSERT(isSamplerSupported(sampler));
1401 if (isGatherCompareResultValid(texture, sampler, prec, faceCoords, cmpReference, result))