OSDN Git Service

Fix checking all mipmap levels for padding.
authorNicolas Capens <capn@google.com>
Thu, 21 Apr 2016 17:59:20 +0000 (13:59 -0400)
committerNicolas Capens <capn@google.com>
Thu, 21 Apr 2016 20:36:22 +0000 (20:36 +0000)
commitadb305a2f99710a691a5396af85828cc3ad89bd5
treec48b3d199d042efe3ea44bd4952a8f78018131f0
parent31b65a76cd89ee30fc61c0d3899a3caeac7f09a7
Fix checking all mipmap levels for padding.

When textures have padding after a row of pixels, we can't use the sampler's
fast path which uses shift operations. We have to treat it as an NPOT texture.
Previously only mipmap level 0 was checked for padding, but when a texture is
also a render target we allocate 2x2 pixel blocks so a 1x1 mipmap has stride 2.

Change-Id: I7421fddbe5ed0d330d881f09c2161d9c42348600
Reviewed-on: https://swiftshader-review.googlesource.com/5175
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/Renderer/Sampler.cpp