Closed Bug 1626496 Opened 4 months ago Closed 4 months ago

Round down for nearest filtering in SWGL

Categories

(Core :: Graphics: WebRender, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: lsalzman, Assigned: lsalzman)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

The OpenGL spec mandates that nearest filtering for texture sampling must use the "Manhattan distance" to find the nearest pixel, which boils down to a floor or truncate (which are the same for positive numbers) on the texture coordinates.

Currently SWGL is using the default rounding mode of round-to-nearest-even (a.k.a. banker's rounding) which is clearly buggy with regards to specified OpenGL behavior...

The OpenGL spec however does mandate that round-to-nearest-even is used on the Z/layer coordinate for indexing into a texture array regardless of filtering, so we need to use different rounding modes for depending on the texture coordinate axis in question.

Priority: -- → P1
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e53a045094df
round texture coordinates down when nearest filtering in SWGL. r=jrmuizel
https://hg.mozilla.org/integration/autoland/rev/929cb28d1a1f
fix bit casting of vectors for GCC. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Duplicate of this bug: 1622594
You need to log in before you can comment on or make changes to this bug.