Emulate directx wrapping with Opengl


I would like to emulate the following wrapping mode of Directx:

Does anyone know a way to achieve this with Opengl in Linux?

Thanks in advance

AFAIK it is not possible in OpenGL.
This has already been discussed on these forums, quite a long time ago. Try searching.

Do you have a practical use case for this ?

yes, to implement it in wine. Some games use that.

I must admit I have no idea how to implement this with any efficiency.

Short of triplicating each texcoord (with shifts 0, -1, +1) then deciding in the fragment shader which one to use according to the smallest derivative …

EDIT : scratch that, it should be in texcoord space instead of fragment space … well no idea

Maybe some people here have better clever ideas ?