Commit 10f7befc by Nicolas Capens Committed by Chris Forbes

Fix overwriting of filter factor

The third coordinate of the 2D sampling code is only used for 2D array textures, so we don't compute a filter factor. This used to be taken advantage of by passing the filter factor of the second coordinate to the addressing method for the third coordinate, and ensuring that the addressing mode of this component was ADDRESSING_LAYER even for non- array textures. Instead of relying on this brittle hack, just specify a third filter factor. Now that we elide materialization of single-block variables, this doesn't take any stack space and is zero overhead to the backend. Bug: b/129523279 Change-Id: Iee6b0f90bf1cc4ccc41672d3bdb706ff5af0a555 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30548 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
parent c57ec6f0
...@@ -1045,11 +1045,11 @@ namespace sw ...@@ -1045,11 +1045,11 @@ namespace sw
selectMipmap(texture, buffer, mipmap, lod, face, secondLOD); selectMipmap(texture, buffer, mipmap, lod, face, secondLOD);
Int4 x0, x1, y0, y1, z0; Int4 x0, x1, y0, y1, z0;
Float4 fu, fv; Float4 fu, fv, fw;
Int4 filter = computeFilterOffset(lod); Int4 filter = computeFilterOffset(lod);
address(u, x0, x1, fu, mipmap, offset.x, filter, OFFSET(Mipmap, width), state.addressingModeU, function); address(u, x0, x1, fu, mipmap, offset.x, filter, OFFSET(Mipmap, width), state.addressingModeU, function);
address(v, y0, y1, fv, mipmap, offset.y, filter, OFFSET(Mipmap, height), state.addressingModeV, function); address(v, y0, y1, fv, mipmap, offset.y, filter, OFFSET(Mipmap, height), state.addressingModeV, function);
address(w, z0, z0, fv, mipmap, offset.z, filter, OFFSET(Mipmap, depth), state.addressingModeW, function); address(w, z0, z0, fw, mipmap, offset.z, filter, OFFSET(Mipmap, depth), state.addressingModeW, function);
Int4 pitchP = *Pointer<Int4>(mipmap + OFFSET(Mipmap, pitchP), 16); Int4 pitchP = *Pointer<Int4>(mipmap + OFFSET(Mipmap, pitchP), 16);
y0 *= pitchP; y0 *= pitchP;
......
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