Bug 94073 - Miscompilation of abs_vec3_vert_xvary_ref.vert in WebGL conformance
Summary: Miscompilation of abs_vec3_vert_xvary_ref.vert in WebGL conformance
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 11.0
Hardware: Other All
: medium normal
Assignee: Jason Ekstrand
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-10 06:07 UTC by Thomas Daede
Modified: 2016-02-11 01:24 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
NIR before and after out-of-SSA (11.04 KB, text/plain)
2016-02-10 06:15 UTC, Matt Turner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Daede 2016-02-10 06:07:31 UTC
The test abs_vec3_vert_xvary.test.html fails due to the reference vertex shader being miscompiled. The test can be reproduced by visiting this page with Firefox (preferably Nightly).

https://www.khronos.org/registry/webgl/conformance-suites/1.0.2/conformance/ogles/GL/abs/abs_001_to_006.html

The test passes on Chromium, but the vertex shader submitted is the same, checked with apitrace. It's unclear what is causing the behavior difference.

The error happens between the SSA and final NIR stages. Note that ssa_16 is dropped and never used, leading to the blue channel never having the absolute value applied:

https://pastebin.mozilla.org/8859127

Trivial modifications to the shader make it compile correctly. For example, replacing

if((c[2] < 0.0)) c[2] *= -1.0;

with

float x = c.b;
if (x < 0.0) x *= -1.0;
c.b = x;

This is one of a series of similar failures on the Khronos test. The entire test can be accessed here: https://www.khronos.org/registry/webgl/conformance-suites/1.0.2/webgl-conformance-tests.html
Comment 1 Matt Turner 2016-02-10 06:15:00 UTC
Created attachment 121637 [details]
NIR before and after out-of-SSA

Please attach files in bugzilla and never link to a pastebin, as pastebins come and go and files expire.
Comment 2 Jason Ekstrand 2016-02-10 06:51:06 UTC
Gut feeling is that this is actually a bug in lower_vev_to_movs not out_of_ssa.  I'll look into it.
Comment 3 Jason Ekstrand 2016-02-10 20:13:08 UTC
Turns out it's a use-after-free in lower_vec_to_movs.  I've got a patch that I'll be sending out as soon as Jenkins gives me the green light.
Comment 4 Jason Ekstrand 2016-02-11 01:24:45 UTC
I pushed the fix with a review from Matt.


bug/show.html.tmpl processed on Mar 26, 2017 at 03:25:35.
(provided by the Example extension).