[08/23] wined3d: Allow viewport to be out-of-bounds if using offscreen target.

Andrew Wesie awesie at gmail.com
Mon Nov 21 22:48:55 CST 2016


On Mon, Nov 21, 2016 at 6:51 PM, Matteo Bruni <matteo.mystral at gmail.com>
wrote:
>
> viewport_test() passes just fine currently.
>

I agree it does currently. If you play around with the viewport values
though, then it will have differing behavior on real Windows and Wine. For
instance, on my Windows machine, if I modify viewport_test to use a width
and height of 1024x1024, then the behavior diverges from Wine.

When I tried different values for the viewport width and height in
viewport_test, there seemed to be different behavior once the viewport
width x height >= 2*1024*1024. For instance, a 1448x1448 viewport behaves
differently than a 1449x1448 viewport. This behavior is likely dependent on
the target size, which is 640x480 in the d3d9 tests.

The width and height values that are in viewport_test (10000 and 10000)
seem arbitrary. Does that test reflect a real world program?

Is that still an issue after 5cdb8f2486cf00a61c1aac20daef8c?
>

Yes.


> The point is that moving that block of code inside the
> !context->render_offscreen branch doesn't seem correct, the viewport
> width / height clamping should only depend on the d3d state while
> render_offscreen also depends on wined3d settings. By moving the code
> there you're effectively disabling it from wined3d with default
> settings.
>

I am trying to figure out why that block of code is even necessary. At the
moment, it just appears to make viewport_test work, which is only useful if
viewport_test reflects a real world program. My best guess was that the
code was introduced to solve a problem when context->render_offscreen is
false; hence I moved the code rather than eliminate it entirely.


> What is Overwatch depending on specifically? If it sets its viewport
> partially offscreen and doesn't like the clamping, we should probably
> make that chunk of code be (indirectly) conditional on the d3d version
> by means of a wined3d flag.
>

Overwatch renders some UI elements to a texture that is smaller than the
viewport. By clamping the viewport, the elements are now drawn incorrectly
because you just changed the mapping from clip space to screen space.

I am not convinced that the original code is correct for any d3d version.
The behavior I noted above with regards to testing different heights and
widths demonstrates that pretty clearly. I can submit a patch to the test
to make it clearer, if that is needed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20161121/99ad36fe/attachment-0001.html>


More information about the wine-devel mailing list