Bug 92033 - [SNB,regression,dEQP,bisected] functional.shaders.random tests regressed
Summary: [SNB,regression,dEQP,bisected] functional.shaders.random tests regressed
Status: CLOSED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Antia Puentes
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-17 20:47 UTC by Mark Janes
Modified: 2015-11-06 19:02 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Mark Janes 2015-09-17 20:47:18 UTC
The following dEQP tests regressed on SNB with a recent patch series:

piglit.deqp-gles3.functional.shaders.random.trigonometric.vertex.1
mesa c951bb83056724df02ba7e6fe2dfa720c0f45c1f

piglit.deqp-gles2.functional.shaders.random.trigonometric.vertex.1
mesa c3f8cde964f9850c86469a06d5eedf4e783cbf5c

piglit.deqp-gles3.functional.shaders.random.all_features.vertex.73
mesa cadd7dd384b33a779d46bd664f456bed4a21a5b7

src/mesa/drivers/dri/i965/brw_vec4_generator.cpp:178: void brw::check_gen6_math_src_arg(brw_reg): Assertion `src.dw1.bits.swizzle == (((0)<<0) | ((1)<<2) | ((2)<<4) | ((3)<<6))' failed.
Comment 1 Jason Ekstrand 2015-09-18 06:35:38 UTC
I'm pretty sure I know exactly what's going on here.  NIR has swizzles for all ALU instructions, but i965 can't swizzle some (maybe all?) math instructions.  The easiest fix would be to simply make emit_math emit an additional MOV if there is a non-trivial swizzle.  The reason this showed up as a regression is probably that we're doing better coalescing now than we were before.  The bug was present, we just weren't tickling it.  I'm re-assigning this to one of the Igalia people.

DISCLAIMER: The above is entirely off the top of my head.  I haven't looked at the docs or the actual shaders.

Mark: As a side-note, we should probably be running dEQP on a HSW as well as BDW.  That way we get their merciless shader tests on vec4 as well as FS.  That would have caught this one earlier.
Comment 2 Antia Puentes 2015-09-18 16:12:07 UTC
(In reply to Jason Ekstrand from comment #1)
> I'm pretty sure I know exactly what's going on here.  NIR has swizzles for
> all ALU instructions, but i965 can't swizzle some (maybe all?) math
> instructions.  The easiest fix would be to simply make emit_math emit an
> additional MOV if there is a non-trivial swizzle.  The reason this showed up
> as a regression is probably that we're doing better coalescing now than we
> were before.  The bug was present, we just weren't tickling it.  I'm
> re-assigning this to one of the Igalia people.

Thanks for the tip. I will be taking a look at this.
Comment 3 Mark Janes 2015-09-18 17:57:18 UTC
Jason, can you explain why enabling dEQP on HSW would have caught this?  It only regressed on SNB, according to my tests.
Comment 4 Antia Puentes 2015-09-20 15:56:46 UTC
(In reply to Jason Ekstrand from comment #1)
> I'm pretty sure I know exactly what's going on here.  NIR has swizzles for
> all ALU instructions, but i965 can't swizzle some (maybe all?) math
> instructions.  The easiest fix would be to simply make emit_math emit an
> additional MOV if there is a non-trivial swizzle.  The reason this showed up
> as a regression is probably that we're doing better coalescing now than we
> were before.  The bug was present, we just weren't tickling it.  I'm
> re-assigning this to one of the Igalia people.

We are currently emitting an additional MOV in emit_math if there is a non-trivial swizzle (gen6). However, as you said, register coalescing is certainly involved because it removes that MOV instruction. I wrote patch to prevent register coalescing when non-trivial swizzling is required in gen 6 math instructions. You can find the patch here:
http://lists.freedesktop.org/archives/mesa-dev/2015-September/094889.html

It fixes the 3 listed dEQP regressions and I have checked that it does not introduce new Piglit or dEQP GLES 3.0 regressions in SandyBridge. I have not had time to run dEQP GLES 2.0 tests though, I can do it on Monday.
Comment 5 Antia Puentes 2015-09-23 15:13:48 UTC
Fix pushed!
commit f2e75ac88a92ab2180de576aca298929cfce03f2
Comment 6 Jason Ekstrand 2015-11-06 18:33:12 UTC
This bug has been fixed for a while now.  Closing.


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.