http://bugs.winehq.org/show_bug.cgi?id=14762
--- Comment #24 from Tobias Jakobi liquid.acid@gmx.net 2008-11-25 05:26:16 --- My current assumption is that all RECT textures that are used have the dimensions of the backbuffer. This assumption holds as long as the game is only using RECTs for fullscreen post processing effects.
You're right that this won't work (correctly) if the texture where the shader samples from doesn't have this dimensions.
However currently the most that is sampled from a RECT texture is one single pixel (since we supply texcoords in the range [0,1]x[0,1]).
This hack isn't valid in general at all, but it's kinda "better" than the current situation. And after all it's only a hack :)
@"You have to use the texture size of the texture you're sampling from.": Seems like my current approach won't work there, since I'm hardcoding the fixup vector in the shader. I don't think I can simply assume that the shader that is generated is only used for the currently bound texture (if there is anything bound at all).
So as soon as the bound texture changes I would have to regenerate the shader, modifying the fixup vector. That doesn't look like a good/clean approach to me.