<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Could anyone review this patch?<br>
</p>
<a moz-do-not-send="true"
href="https://devtalk.nvidia.com/default/topic/971005/linux/glviewportindexedf-wrongly-rounding-down-x-and-y-parameters/">Here
is a Wine dev reporting similar bug to Nvidia</a>.<br>
<a moz-do-not-send="true"
href="https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/wined3d/utils.c#l3568">Test
in Wine source to enable a workaround for this issue</a>.<br>
<a moz-do-not-send="true"
href="https://patchwork.freedesktop.org/patch/81255/">Similar
patch for gallium/radeon</a>.<br>
<br>
Hope this will help.<br>
<br>
-Danil<br>
<br>
<div class="moz-cite-prefix">On 04.06.18 13:41, Danylo Piliaiev
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1528108899-23777-1-git-send-email-danylo.piliaiev@gmail.com">
<pre wrap="">On gen8+ fractional translation of viewport moved it by a whole integer.
The behaviour in this case isn't defined anywhere but some apps like
Wine may depend on viewport's width and height being ceiled.
Bugzilla: <a class="moz-txt-link-freetext" href="https://bugs.freedesktop.org/show_bug.cgi?id=106526">https://bugs.freedesktop.org/show_bug.cgi?id=106526</a>
Signed-off-by: Danylo Piliaiev <a class="moz-txt-link-rfc2396E" href="mailto:danylo.piliaiev@gmail.com"><danylo.piliaiev@gmail.com></a>
---
src/mesa/drivers/dri/i965/genX_state_upload.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c
index 88fde9d..886290f 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -2586,12 +2586,11 @@ genX(upload_sf_clip_viewport)(struct brw_context *brw)
* pipeline stall so we're better off just being a little more clever
* with our viewport so we can emit it once at context creation time.
*/
- const float viewport_Xmin = MAX2(ctx->ViewportArray[i].X, 0);
- const float viewport_Ymin = MAX2(ctx->ViewportArray[i].Y, 0);
- const float viewport_Xmax =
- MIN2(ctx->ViewportArray[i].X + ctx->ViewportArray[i].Width, fb_width);
- const float viewport_Ymax =
- MIN2(ctx->ViewportArray[i].Y + ctx->ViewportArray[i].Height, fb_height);
+ const struct gl_viewport_attrib *vp = &ctx->ViewportArray[i];
+ const float viewport_Xmin = MAX2(vp->X, 0);
+ const float viewport_Ymin = MAX2(vp->Y, 0);
+ const float viewport_Xmax = MIN2(ceilf(vp->X + vp->Width), fb_width);
+ const float viewport_Ymax = MIN2(ceilf(vp->Y + vp->Height), fb_height);
if (render_to_fbo) {
sfv.XMinViewPort = viewport_Xmin;
</pre>
</blockquote>
<br>
</body>
</html>