Same fixes as for GLSL.
This is necessary to get the coordinates to give to the texture's `write()` method.