I think, I found a bug.
RTG screen 960x540 should sharp-scale to 1920x1080 (same output as texture_filter=nearest) but it does not.
It looks like only bilinear scaling is used, same result as no-shader + texture_filter=bilinear.
Edit: Changed
floor(rubyOutputSize / rubyInputSize)
to
floor((rubyOutputSize + 1.0) / rubyInputSize)
to "save" one pixel.
I have absolutely no clue what I'm doing here, but it seems to work, LOL