Lines Matching defs:level
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);
565 static bool isNearestSampleResultValid (const ConstPixelBufferAccess& level,
572 DE_ASSERT(level.getDepth() == 1);
574 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coordX, prec.coordBits.x(), prec.uvwBits.x());
581 const int x = wrap(sampler.wrapS, i, level.getWidth());
582 const Vector<ScalarType, 4> color = lookup<ScalarType>(level, sampler, x, coordY, 0);
592 static bool isNearestSampleResultValid (const ConstPixelBufferAccess& level,
599 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
600 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
614 const int x = wrap(sampler.wrapS, i, level.getWidth());
615 const int y = wrap(sampler.wrapT, j, level.getHeight());
616 const Vector<ScalarType, 4> color = lookup<ScalarType>(level, sampler, x, y, coordZ);
627 static bool isNearestSampleResultValid (const ConstPixelBufferAccess& level,
633 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
634 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
635 const Vec2 wBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getDepth(), coord.z(), prec.coordBits.z(), prec.uvwBits.z());
653 const int x = wrap(sampler.wrapS, i, level.getWidth());
654 const int y = wrap(sampler.wrapT, j, level.getHeight());
655 const int z = wrap(sampler.wrapR, k, level.getDepth());
656 const Vector<ScalarType, 4> color = lookup<ScalarType>(level, sampler, x, y, z);
667 bool isLinearSampleResultValid (const ConstPixelBufferAccess& level,
674 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coordX, prec.coordBits.x(), prec.uvwBits.x());
679 const int w = level.getWidth();
681 const TextureFormat format = level.getFormat();
702 const Vec4 colorA = lookup<float>(level, sampler, x0, coordY, 0);
703 const Vec4 colorB = lookup<float>(level, sampler, x1, coordY, 0);
720 bool isLinearSampleResultValid (const ConstPixelBufferAccess& level,
727 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
728 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
736 const int w = level.getWidth();
737 const int h = level.getHeight();
739 const TextureChannelClass texClass = getTextureChannelClass(level.getFormat().type);
768 lookupQuad(quad, level, sampler, x0, x1, y0, y1, coordZ);
789 static bool isLinearSampleResultValid (const ConstPixelBufferAccess& level,
795 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
796 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
797 const Vec2 wBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getDepth(), coord.z(), prec.coordBits.z(), prec.uvwBits.z());
807 const int w = level.getWidth();
808 const int h = level.getHeight();
809 const int d = level.getDepth();
811 const TextureChannelClass texClass = getTextureChannelClass(level.getFormat().type);
846 lookupQuad(quad0, level, sampler, x0, x1, y0, y1, z0);
847 lookupQuad(quad1, level, sampler, x0, x1, y0, y1, z1);
1329 static bool isLevelSampleResultValid (const ConstPixelBufferAccess& level,
1338 return isLinearSampleResultValid(level, sampler, prec, coordX, coordY, result);
1340 return isNearestSampleResultValid(level, sampler, prec, coordX, coordY, result);
1343 static bool isLevelSampleResultValid (const ConstPixelBufferAccess& level,
1352 return isLinearSampleResultValid(level, sampler, prec, coord, coordZ, result);
1354 return isNearestSampleResultValid(level, sampler, prec, coord, coordZ, result);
1420 for (int level = minLevel; level <= maxLevel; level++)
1422 const float minF = de::clamp(minLod - float(level), 0.0f, 1.0f);
1423 const float maxF = de::clamp(maxLod - float(level), 0.0f, 1.0f);
1425 if (isMipmapLinearSampleResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coord, 0, Vec2(minF, maxF), result))
1431 // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
1438 for (int level = minLevel; level <= maxLevel; level++)
1440 if (isLevelSampleResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coord, 0, result))
1485 for (int level = minLevel; level <= maxLevel; level++)
1487 const float minF = de::clamp(minLod - float(level), 0.0f, 1.0f);
1488 const float maxF = de::clamp(maxLod - float(level), 0.0f, 1.0f);
1490 if (isMipmapLinearSampleResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coord, 0, Vec2(minF, maxF), result))
1496 // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
1503 for (int level = minLevel; level <= maxLevel; level++)
1505 if (isLevelSampleResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coord, 0, result))
1707 static bool isCubeLevelSampleResultValid (const ConstPixelBufferAccess (&level)[CUBEFACE_LAST],
1717 return isSeamlessLinearSampleResultValid(level, sampler, prec, coords, result);
1719 return isLinearSampleResultValid(level[coords.face], sampler, prec, Vec2(coords.s, coords.t), 0, result);
1722 return isNearestSampleResultValid(level[coords.face], sampler, prec, Vec2(coords.s, coords.t), 0, result);
1813 // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
1889 for (int level = minLevel; level <= maxLevel; level++)
1891 const float minF = de::clamp(minLod - float(level), 0.0f, 1.0f);
1892 const float maxF = de::clamp(maxLod - float(level), 0.0f, 1.0f);
1894 if (isMipmapLinearSampleResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coordX, layer, Vec2(minF, maxF), result))
1900 // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
1907 for (int level = minLevel; level <= maxLevel; level++)
1909 if (isLevelSampleResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coordX, layer, result))
1959 for (int level = minLevel; level <= maxLevel; level++)
1961 const float minF = de::clamp(minLod - float(level), 0.0f, 1.0f);
1962 const float maxF = de::clamp(maxLod - float(level), 0.0f, 1.0f);
1964 if (isMipmapLinearSampleResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coordXY, layer, Vec2(minF, maxF), result))
1970 // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
1977 for (int level = minLevel; level <= maxLevel; level++)
1979 if (isLevelSampleResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coordXY, layer, result))
1994 static bool isLevelSampleResultValid (const ConstPixelBufferAccess& level,
2002 return isLinearSampleResultValid(level, sampler, prec, coord, result);
2004 return isNearestSampleResultValid(level, sampler, prec, coord, result);
2053 for (int level = minLevel; level <= maxLevel; level++)
2055 const float minF = de::clamp(minLod - float(level), 0.0f, 1.0f);
2056 const float maxF = de::clamp(maxLod - float(level), 0.0f, 1.0f);
2058 if (isMipmapLinearSampleResultValid(texture.getLevel(level), texture.getLevel(level+1), sampler, getLevelFilter(sampler.minFilter), prec, coord, Vec2(minF, maxF), result))
2064 // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
2071 for (int level = minLevel; level <= maxLevel; level++)
2073 if (isLevelSampleResultValid(texture.getLevel(level), sampler, getLevelFilter(sampler.minFilter), prec, coord, result))
2089 const ConstPixelBufferAccess& level = texture.getLevel(levelNdx);
2095 out[faceNdx] = getSubregion(level, 0, 0, layerDepth + getCubeArrayFaceIndex(face), level.getWidth(), level.getHeight(), 1);
2165 // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
2437 static bool isGatherOffsetsResultValid (const ConstPixelBufferAccess& level,
2446 const Vec2 uBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord.x(), prec.coordBits.x(), prec.uvwBits.x());
2447 const Vec2 vBounds = computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord.y(), prec.coordBits.y(), prec.uvwBits.y());
2455 const int w = level.getWidth();
2456 const int h = level.getHeight();
2468 color[offNdx] = lookup<ScalarType>(level, sampler, x, y, coordZ)[componentNdx];