2016-11-14 8:52 GMT-06:00 Henri Verbeet hverbeet@gmail.com:
On 13 November 2016 at 23:40, Matteo Bruni matteo.mystral@gmail.com wrote:
You need to make the same change to viewport_miscpart_cc() (you can blame me for that).
Maybe a little. But yes, it would probably make sense to have a common function for that.
Again, it would be very nice to have a testcase for this. Extending viewport_test() in d3d9/tests/visual.c and adding similar tests to the other d3d versions shouldn't be too hard.
Well, the issue with that is that context->render_offscreen is always true on common (modern) configurations. I.e., offscreen targets imply context->render_offscreen, but the reverse isn't generally true.
Oh, you're right, I somehow overlooked it. That means this change is quite suspicious, if the intention is really to avoid clamping offscreen targets. But as you say...
Perhaps more importantly though, I suspect this change is more about the wined3d_rendertarget_view_get_drawable_size() call than clamping the viewport. There was an issue with calling surface_get_drawable_size() for render targets that aren't 2D textures, but commit 5cdb8f2486cf00a61c1aac20daef8c7cac0d8312 should have mostly made that gone away.
We only need the drawable height in case context->render_offscreen is false, so perhaps it makes sense to only retrieve it for that case, but at this point that's only a (minor) optimisation.
Yeah, that makes sense.