Lines Matching refs:Lod
100 Float lod;
109 computeLod(texture, lod, anisotropy, uDelta, vDelta, uuuu, vvvv, bias.x, dsx, dsy, function);
115 computeLodCube(texture, lod, u, v, w, bias.x, dsx, dsy, M, function);
120 computeLod3D(texture, lod, uuuu, vvvv, wwww, bias.x, dsx, dsy, function);
125 c = sampleFilter(texture, uuuu, vvvv, wwww, offset, lod, anisotropy, uDelta, vDelta, face, function);
129 Vector4f cf = sampleFloatFilter(texture, uuuu, vvvv, wwww, qqqq, offset, lod, anisotropy, uDelta, vDelta, face, function);
309 Float lod;
318 computeLod(texture, lod, anisotropy, uDelta, vDelta, uuuu, vvvv, bias.x, dsx, dsy, function);
324 computeLodCube(texture, lod, u, v, w, bias.x, dsx, dsy, M, function);
329 computeLod3D(texture, lod, uuuu, vvvv, wwww, bias.x, dsx, dsy, function);
332 c = sampleFloatFilter(texture, uuuu, vvvv, wwww, qqqq, offset, lod, anisotropy, uDelta, vDelta, face, function);
502 Vector4f SamplerCore::textureSize(Pointer<Byte> &texture, Float4 &lod)
509 Pointer<Byte> mipmap = texture + OFFSET(Texture, mipmap) + (As<Int>(Extract(lod, i)) + baseLevel) * sizeof(Mipmap);
529 Short4 SamplerCore::offsetSample(Short4 &uvw, Pointer<Byte> &mipmap, int halfOffset, bool wrap, int count, Float &lod)
535 offset &= Short4(CmpNLE(Float4(lod), Float4(0.0f)));
539 offset &= Short4(CmpLE(Float4(lod), Float4(0.0f)));
566 Vector4s SamplerCore::sampleFilter(Pointer<Byte> &texture, Float4 &u, Float4 &v, Float4 &w, Vector4f &offset, Float &lod, Float &anisotropy, Float4 &uDelta, Float4 &vDelta, Int face[4], SamplerFunction function)
568 Vector4s c = sampleAniso(texture, u, v, w, offset, lod, anisotropy, uDelta, vDelta, face, false, function);
577 Vector4s cc = sampleAniso(texture, u, v, w, offset, lod, anisotropy, uDelta, vDelta, face, true, function);
579 lod *= Float(1 << 16);
581 UShort4 utri = UShort4(Float4(lod)); // FIXME: Optimize
667 Vector4s SamplerCore::sampleAniso(Pointer<Byte> &texture, Float4 &u, Float4 &v, Float4 &w, Vector4f &offset, Float &lod, Float &anisotropy, Float4 &uDelta, Float4 &vDelta, Int face[4], bool secondLOD, SamplerFunction function)
671 if(state.textureFilter != FILTER_ANISOTROPIC || function == Lod || function == Fetch)
673 c = sampleQuad(texture, u, v, w, offset, lod, face, secondLOD, function);
704 c = sampleQuad(texture, u0, v0, w, offset, lod, face, secondLOD, function);
727 Vector4s SamplerCore::sampleQuad(Pointer<Byte> &texture, Float4 &u, Float4 &v, Float4 &w, Vector4f &offset, Float &lod, Int face[4], bool secondLOD, SamplerFunction function)
731 return sampleQuad2D(texture, u, v, w, offset, lod, face, secondLOD, function);
735 return sample3D(texture, u, v, w, offset, lod, secondLOD, function);
739 Vector4s SamplerCore::sampleQuad2D(Pointer<Byte> &texture, Float4 &u, Float4 &v, Float4 &w, Vector4f &offset, Float &lod, Int face[4], bool secondLOD, SamplerFunction function)
749 selectMipmap(texture, buffer, mipmap, lod, face, secondLOD);
763 Short4 uuuu0 = offsetSample(uuuu, mipmap, OFFSET(Mipmap,uHalf), state.addressingModeU == ADDRESSING_WRAP, gather ? 0 : -1, lod);
764 Short4 vvvv0 = offsetSample(vvvv, mipmap, OFFSET(Mipmap,vHalf), state.addressingModeV == ADDRESSING_WRAP, gather ? 0 : -1, lod);
765 Short4 uuuu1 = offsetSample(uuuu, mipmap, OFFSET(Mipmap,uHalf), state.addressingModeU == ADDRESSING_WRAP, gather ? 2 : +1, lod);
766 Short4 vvvv1 = offsetSample(vvvv, mipmap, OFFSET(Mipmap,vHalf), state.addressingModeV == ADDRESSING_WRAP, gather ? 2 : +1, lod);
934 Vector4s SamplerCore::sample3D(Pointer<Byte> &texture, Float4 &u_, Float4 &v_, Float4 &w_, Vector4f &offset, Float &lod, bool secondLOD, SamplerFunction function)
944 selectMipmap(texture, buffer, mipmap, lod, face, secondLOD);
970 u[i][j][k] = offsetSample(uuuu, mipmap, OFFSET(Mipmap,uHalf), state.addressingModeU == ADDRESSING_WRAP, i * 2 - 1, lod);
971 v[i][j][k] = offsetSample(vvvv, mipmap, OFFSET(Mipmap,vHalf), state.addressingModeV == ADDRESSING_WRAP, j * 2 - 1, lod);
972 s[i][j][k] = offsetSample(wwww, mipmap, OFFSET(Mipmap,wHalf), state.addressingModeW == ADDRESSING_WRAP, k * 2 - 1, lod);
1059 lod, Float &anisotropy, Float4 &uDelta, Float4 &vDelta, Int face[4], SamplerFunction function)
1061 Vector4f c = sampleFloatAniso(texture, u, v, w, q, offset, lod, anisotropy, uDelta, vDelta, face, false, function);
1070 Vector4f cc = sampleFloatAniso(texture, u, v, w, q, offset, lod, anisotropy, uDelta, vDelta, face, true, function);
1072 Float4 lod4 = Float4(Frac(lod));
1139 Vector4f SamplerCore::sampleFloatAniso(Pointer<Byte> &texture, Float4 &u, Float4 &v, Float4 &w, Float4 &q, Vector4f &offset, Float &lod, Float &anisotropy, Float4 &uDelta, Float4 &vDelta, Int face[4], bool secondLOD, SamplerFunction function)
1143 if(state.textureFilter != FILTER_ANISOTROPIC || function == Lod || function == Fetch)
1145 c = sampleFloat(texture, u, v, w, q, offset, lod, face, secondLOD, function);
1174 c = sampleFloat(texture, u0, v0, w, q, offset, lod, face, secondLOD, function);
1197 Vector4f SamplerCore::sampleFloat(Pointer<Byte> &texture, Float4 &u, Float4 &v, Float4 &w, Float4 &q, Vector4f &offset, Float &lod, Int face[4], bool secondLOD, SamplerFunction function)
1201 return sampleFloat2D(texture, u, v, w, q, offset, lod, face, secondLOD, function);
1205 return sampleFloat3D(texture, u, v, w, offset, lod, secondLOD, function);
1209 Vector4f SamplerCore::sampleFloat2D(Pointer<Byte> &texture, Float4 &u, Float4 &v, Float4 &w, Float4 &q, Vector4f &offset, Float &lod, Int face[4], bool secondLOD, SamplerFunction function)
1219 selectMipmap(texture, buffer, mipmap, lod, face, secondLOD);
1223 Int4 filter = computeFilterOffset(lod);
1278 Vector4f SamplerCore::sampleFloat3D(Pointer<Byte> &texture, Float4 &u, Float4 &v, Float4 &w, Vector4f &offset, Float &lod, bool secondLOD, SamplerFunction function)
1288 selectMipmap(texture, buffer, mipmap, lod, face, secondLOD);
1292 Int4 filter = computeFilterOffset(lod);
1362 Float SamplerCore::log2sqrt(Float lod)
1364 // log2(sqrt(lod)) // Equals 0.25 * log2(lod^2).
1365 lod *= lod; // Squaring doubles the exponent and produces an extra bit of precision.
1366 lod = Float(As<Int>(lod)) - Float(0x3F800000); // Interpret as integer and subtract the exponent bias.
1367 lod *= As<Float>(Int(0x33000000)); // Scale by 0.25 * 2^-23 (mantissa length).
1369 return lod;
1372 Float SamplerCore::log2(Float lod)
1374 lod *= lod; // Squaring doubles the exponent and produces an extra bit of precision.
1375 lod = Float(As<Int>(lod)) - Float(0x3F800000); // Interpret as integer and subtract the exponent bias.
1376 lod *= As<Float>(Int(0x33800000)); // Scale by 0.5 * 2^-23 (mantissa length).
1378 return lod;
1381 void SamplerCore::computeLod(Pointer<Byte> &texture, Float &lod, Float &anisotropy, Float4 &uDelta, Float4 &vDelta, Float4 &uuuu, Float4 &vvvv, const Float &lodBias, Vector4f &dsx, Vector4f &dsy, SamplerFunction function)
1383 if(function != Lod && function != Fetch)
1399 // Scale by texture dimensions and global LOD.
1405 lod = Max(Float(dUV2.x), Float(dUV2.y)); // Square length of major axis
1420 anisotropy = lod * Rcp_pp(det);
1423 lod *= Rcp_pp(anisotropy * anisotropy);
1426 lod = log2sqrt(lod); // log2(sqrt(lod))
1430 lod += lodBias;
1433 else if(function == Lod)
1435 lod = lodBias;
1440 lod = Float(As<Int>(lodBias));
1444 lod = Float(0);
1448 lod = Max(lod, *Pointer<Float>(texture + OFFSET(Texture, minLod)));
1449 lod = Min(lod, *Pointer<Float>(texture + OFFSET(Texture, maxLod)));
1452 void SamplerCore::computeLodCube(Pointer<Byte> &texture, Float &lod, Float4 &u, Float4 &v, Float4 &w, const Float &lodBias, Vector4f &dsx, Vector4f &dsy, Float4 &M, SamplerFunction function)
1454 if(function != Lod && function != Fetch)
1487 lod = Max(Float(dudxy.y), Float(dudxy.z)); // FIXME: Max(dudxy.y, dudxy.z);
1489 // Scale by texture dimension and global LOD.
1490 lod *= *Pointer<Float>(texture + OFFSET(Texture,widthLOD));
1492 lod = log2(lod);
1496 lod += lodBias;
1499 else if(function == Lod)
1501 lod = lodBias;
1506 lod = Float(As<Int>(lodBias));
1510 lod = Float(0);
1514 lod = Max(lod, *Pointer<Float>(texture + OFFSET(Texture, minLod)));
1515 lod = Min(lod, *Pointer<Float>(texture + OFFSET(Texture, maxLod)));
1518 void SamplerCore::computeLod3D(Pointer<Byte> &texture, Float &lod, Float4 &uuuu, Float4 &vvvv, Float4 &wwww, const Float &lodBias, Vector4f &dsx, Vector4f &dsy, SamplerFunction function)
1520 if(function != Lod && function != Fetch)
1537 // Scale by texture dimensions and global LOD.
1549 lod = Max(Float(dudxy.y), Float(dudxy.z)); // FIXME: Max(dudxy.y, dudxy.z);
1551 lod = log2sqrt(lod); // log2(sqrt(lod))
1555 lod += lodBias;
1558 else if(function == Lod)
1560 lod = lodBias;
1565 lod = Float(As<Int>(lodBias));
1569 lod = Float(0);
1573 lod = Max(lod, *Pointer<Float>(texture + OFFSET(Texture, minLod)));
1574 lod = Min(lod, *Pointer<Float>(texture + OFFSET(Texture, maxLod)));
2234 void SamplerCore::selectMipmap(Pointer<Byte> &texture, Pointer<Byte> buffer[4], Pointer<Byte> &mipmap, Float &lod, Int face[4], bool secondLOD)
2246 ilod = RoundInt(lod);
2250 ilod = Int(lod);
2275 Int4 SamplerCore::computeFilterOffset(Float &lod)
2285 filter = CmpNLE(Float4(lod), Float4(0.0f));
2289 filter = CmpLE(Float4(lod), Float4(0.0f));