Commit facada53 by Alexis Hetu Committed by Alexis Hétu

FP32 linear filtering computation now available to most formats

All texture formats, except YUV or sRGB formats, now have access to the floating point path for texture filtering. High precision filtering can be enabled using: glHint(GL_TEXTURE_FILTERING_HINT_CHROMIUM, GL_NICEST) Bug swiftshader:76 Change-Id: Iabbe86d1bbf43070bfc5f61254c101a75c744401 Reviewed-on: https://swiftshader-review.googlesource.com/10808Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 91dd1c4c
...@@ -314,7 +314,9 @@ namespace sw ...@@ -314,7 +314,9 @@ namespace sw
} }
else else
{ {
if(hasFloatTexture() || hasUnnormalizedIntegerTexture() || state.highPrecisionFiltering) // FIXME: Mostly identical to integer sampling // FIXME: YUV and sRGB are not supported by the floating point path
bool forceFloatFiltering = state.highPrecisionFiltering && !state.sRGB && !hasYuvFormat() && (state.textureFilter != FILTER_POINT);
if(hasFloatTexture() || hasUnnormalizedIntegerTexture() || forceFloatFiltering) // FIXME: Mostly identical to integer sampling
{ {
Float4 uuuu = u; Float4 uuuu = u;
Float4 vvvv = v; Float4 vvvv = v;
...@@ -353,6 +355,30 @@ namespace sw ...@@ -353,6 +355,30 @@ namespace sw
} }
sampleFloatFilter(texture, c, uuuu, vvvv, wwww, offset, lod, anisotropy, uDelta, vDelta, face, function); sampleFloatFilter(texture, c, uuuu, vvvv, wwww, offset, lod, anisotropy, uDelta, vDelta, face, function);
if(!hasFloatTexture() && !hasUnnormalizedIntegerTexture())
{
if(has16bitTextureFormat())
{
switch(state.textureFormat)
{
case FORMAT_R5G6B5:
c.x *= Float4(1.0f / 0xF800);
c.y *= Float4(1.0f / 0xFC00);
c.z *= Float4(1.0f / 0xF800);
break;
default:
ASSERT(false);
}
}
else
{
for(int component = 0; component < textureComponentCount(); component++)
{
c[component] *= Float4(hasUnsignedTextureComponent(component) ? 1.0f / 0xFFFF : 1.0f / 0x7FFF);
}
}
}
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment