Commit 2ed3149a by Nicolas Capens

Disable filtering on 1x1 textures.

Textures with just one texel don't require filtering. This also avoids precision issues for pedantic tests which expect exact values. Bug swiftshader:39 Change-Id: I52c5697e277523e2b8cb2c879ba0a7b2296ee7c5 Reviewed-on: https://swiftshader-review.googlesource.com/9068Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 22be88e5
...@@ -406,6 +406,15 @@ namespace sw ...@@ -406,6 +406,15 @@ namespace sw
FilterType Sampler::getTextureFilter() const FilterType Sampler::getTextureFilter() const
{ {
// Don't filter 1x1 textures.
if(texture.mipmap[0].width[0] == 1 && texture.mipmap[0].height[0] == 1 && texture.mipmap[0].depth[0] == 1)
{
if(mipmapFilter() == MIPMAP_NONE)
{
return FILTER_POINT;
}
}
FilterType filter = textureFilter; FilterType filter = textureFilter;
if(gather && Surface::componentCount(internalTextureFormat) == 1) if(gather && Surface::componentCount(internalTextureFormat) == 1)
......
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