Metal ClampToZero should be ClampToEdge until uv outside [0,1].

The problem with ClampToEdge is that it stretches the outer strip of pixels even when uv goes outside [0,1]. So the typcial change is to use ClampToZero.

The problem with ClampToZero/Border of 0 is that it pulls in black transparent color into images. What would be better is for this to double up the edge pixels of the texture (ClampToEdge), and only once uv exceeds 0,1 then bilerp the transparent color. Currently ClampToZero pulls in black and drops alpha at the edges of small images leading to poor edges of small textures.

ClampToZero is unique to Metal, but it's designed to be consistent with OpenGL's CLAMP_TO_BORDER wrap mode when TEXTURE_BORDER_COLOR is set to (0, 0, 0, 0). We have gotten requests to be able change the border color as you in OpenGL, but it doesn't sounds like that would satisfy your request since you'd like to have see they double up behavior of pixel edges. Is that right?

In any case, a report via Feedback Assistant would be helpful here.

Yes, the problem is that CLAMP_TO_ZERO on a fully opaque 4x4 pixel texture brings down those outer pixels to transparent. So if you were drawing a quad or particles and expected the texture to fill to the edge, then that won't happen. The bilinear filter will pull in those pixels leading to a 3x3 pixel area and a half pixel transparent border around the quad. When magnified this ramp is even more obvious and the black tinting of even premul color looks bad. Switching back to CLAMP_TO_EDGE fixes the issue, but now get stretching of pixels if you try to draw uv outside the [0,1] range.

Metal ClampToZero should be ClampToEdge until uv outside [0,1].
 
 
Q