I'm drawing a quad with texture coordinates ranging from 0-1 onto a canvas using WebGL2. This quad is used to draw an image to the canvas which can be zoomed and moved by the user. I use nearest-filtering on the texture in order to see sharp pixels. When no mip-mapping is enabled everything works as expected, but as soon as I turn on mip-mapping I get artifacts at the boundary (even when zoomed in a lot in which case only the most detailed mip-map should be at work). These artifacts are usually only a single pixel wide, no matter how to much I zoom in.
Here's an example (the white line on the right of the quad):

Somebody knows what's causing this and how to get rid of it ?
The mip level is derived by the screen-space derivative of the given coordinates, so the more the coordinates change from one pixel to another the higher the miplevel(=lower-res mipmap) that is being sampled from. Now when you shade a fragment that is on the edge of the surface so that the edge runs through the pixel and you have your texture wrapping set to
REPEATthere's a good chance the derivative will be huge which will result in a lower resolution mipmap being sampled from:The fix is easy, don't use
REPEAT.This is how it looks for me, you can see the red/blue mipmap fringing around the green square.