On Fri, Aug 6, 2021 at 4:02 PM Henri Verbeet hverbeet@gmail.com wrote:
On Thu, 5 Aug 2021 at 19:57, Stefan Dösinger stefan@codeweavers.com wrote:
This fixes stay lines in World of Tanks' GameFace UI parts. The Metal backend doesn't have an offset like this either.
There is no Metal backend in upstream Wine ;)
Other than fixing the todo_wine in test_fractional_viewport, this also fixes a failure in d3d11's test_depth_bias that happens when viewport_array is not supported.
I am not entirely sure what the -1 / 64 in get_projection_matrix was meant for. AFAIU get_projection_matrix isn't called for d3d10+, so the path will be entered for d3d9 when we have ARB_CLIP_CONTROL. In this case we don't need to account for the half pixel offset (hence not setting it to 63/64), and I also don't see a reason to nudge for filling rules in the proj matrix and not by adjusting the values in viewport_miscpart_cc.
This may have been a mistake in commit a5d2b3622b7b4f731075d9cd62c76c64c468666b; originally this only checked for WINED3D_PIXEL_CENTER_INTEGER.
I can't be sure now but I suspect that I meant to make the whole thing conditional on !clip_control (i.e. set center_offset to 0 for the clip_control case).
It seems a little awkward to tie this to WINED3D_PIXEL_CENTER_INTEGER. Would it make sense to instead detect the filling convention during adapter initialisation, so that we can get rid of this for d3d9 and before as well if possible? We could then just store the filling convention offset in the wined3d_d3d_info structure.
FWIW I like this idea a lot.