Bug 89180 - [IVB regression] Rendering issues in Mass Effect through VMware Workstation
Summary: [IVB regression] Rendering issues in Mass Effect through VMware Workstation
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 10.4
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Matt Turner
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-17 07:10 UTC by Alena Primenko
Modified: 2015-02-25 22:29 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Frame obtained by driver with Mesa 10.3 (773.14 KB, image/png)
2015-02-17 07:10 UTC, Alena Primenko
Details
Frame obtained by driver with Mesa 10.4 (650.25 KB, image/png)
2015-02-17 07:10 UTC, Alena Primenko
Details
patch (5.17 KB, patch)
2015-02-24 19:21 UTC, Matt Turner
Details | Splinter Review

Description Alena Primenko 2015-02-17 07:10:02 UTC
Created attachment 113550 [details]
Frame obtained by driver with Mesa 10.3

System Environment:
--------------------------
 chipset: IVB
 system architecture: x86-64
 xf86-video-intel:2:2.99.912+git20140714.e0523ade
 xserver: x.org 1.15.1
 mesa: 10.4.0, 10.5.0~git20150204.661c8bb2
 libdrm: 2.4.54+git20140628.e8c3c135
 kernel: 3.13.0


Bug detailed description:
-------------------------
I run Mass Effect on VMware Workstation and there are frames with rendering issues.
Issues appeared after updating Mesa to 10.4 version. 
Screenshots with frames obtained by driver with Mesa 10.3 and 10.4 are in attachments.
Comment 1 Alena Primenko 2015-02-17 07:10:53 UTC
Created attachment 113551 [details]
Frame obtained by driver with Mesa 10.4
Comment 2 Alena Primenko 2015-02-17 10:55:35 UTC
Additional info about Workstation: VMware Workstation ver.11.0.0 build 2281183, VMware Tools ver.9.9.0, build 1541296
Comment 3 Ian Romanick 2015-02-17 16:51:17 UTC
Can you either bisect to determine when the problem was introduced (preferred) or provide us an apitrace so that we can reproduce it locally?
Comment 4 Ian Romanick 2015-02-17 16:52:16 UTC
Also... does this occur on other chipsets or just IVB?
Comment 5 Svyatoslav Pankratov 2015-02-24 12:46:38 UTC
I have found guilty commit between 10.3 and 10.4 - 	0e2ba3ee827f77af0b1f322d95c650f6f7f4da88 (glsl: Optimize clamp(x, b, 1.0), where b > 0.0 as max(saturate(x),b)).
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0e2ba3ee827f77af0b1f322d95c650f6f7f4da88

Looks like a mistake in second part of changes:
In second condition, ir_binop_max should be replaced to ir_binop_min:
             if (outer_const->is_one() && is_greater_than_zero(inner_val_b->as_constant()))
                return expr(ir_binop_max, saturate(inner_val_a), inner_val_b);
             if (inner_val_b->as_constant()->is_one() && is_greater_than_zero(outer_const))
-               return expr(ir_binop_max, saturate(inner_val_a), outer_const);
+               return expr(ir_binop_min, saturate(inner_val_a), outer_const);
          }
       }


Issue was gone in 2 cases: 
 - optimization was deleted;
 - optimization was changed like described above.

Please check my fix or suggest more appropriate fix.
Comment 6 Matt Turner 2015-02-24 17:13:28 UTC
Yes, that's definitely a bug. Looking through it though, I see some others as well. :(

I'll take a stab at it.

Thanks a bunch for the report and narrowing it down so far. That is extremely helpful.
Comment 7 Matt Turner 2015-02-24 19:21:58 UTC
Created attachment 113798 [details] [review]
patch

Please give this patch a try.
Comment 8 Svyatoslav Pankratov 2015-02-25 05:12:07 UTC
(In reply to Matt Turner from comment #7)
> Created attachment 113798 [details] [review] [review]
> patch
> 
> Please give this patch a try.

Ok, patch fixed rendering issues. Thanks!
Comment 9 Matt Turner 2015-02-25 05:19:39 UTC
(In reply to Svyatoslav Pankratov from comment #8)
> (In reply to Matt Turner from comment #7)
> > Created attachment 113798 [details] [review] [review] [review]
> > patch
> > 
> > Please give this patch a try.
> 
> Ok, patch fixed rendering issues. Thanks!

Great. Thank you for testing!

I'll put a

> Tested-by: Svyatoslav Pankratov <svyatoslav.pankratov@intel.com>

on it and commit it tomorrow. (Hoping the original author will review it)
Comment 10 Matt Turner 2015-02-25 22:29:53 UTC
(In reply to Matt Turner from comment #9)
> (In reply to Svyatoslav Pankratov from comment #8)
> > (In reply to Matt Turner from comment #7)
> > > Created attachment 113798 [details] [review] [review] [review] [review]
> > > patch
> > > 
> > > Please give this patch a try.
> > 
> > Ok, patch fixed rendering issues. Thanks!
> 
> Great. Thank you for testing!
> 
> I'll put a
> 
> > Tested-by: Svyatoslav Pankratov <svyatoslav.pankratov@intel.com>
> 
> on it and commit it tomorrow. (Hoping the original author will review it)

Thanks again. Committed as

commit cb25087c7bd5f1ad2515647278b32d3f07803f77
Author: Matt Turner <mattst88@gmail.com>
Date:   Tue Feb 24 10:41:52 2015 -0800

    glsl: Rewrite and fix min/max to saturate optimization.

The patch will be in the next 10.4.x release and 10.5.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.