Bug 91022

Summary: [g45 g965 bisected] assertions generated from textureGrad cube samplers fix
Product: Mesa Reporter: Mark Janes <mark.a.janes>
Component: Drivers/DRI/i965Assignee: Kenneth Graunke <kenneth>
Status: CLOSED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: ben, itoral, mark.a.janes
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Fix for the bug (untested)

Description Mark Janes 2015-06-18 16:19:00 UTC
The following commit fixed 4 piglit tests on newer platforms:

commit 2b1cdb0eddb73f62e4848d4b64840067f1f70865
Author: Iago Toral Quiroga <itoral@igalia.com>
Date:   Tue Feb 24 19:02:50 2015 +0100

    i965: Fix textureGrad with cube samplers


However, it created new assertions on g965 and g45.

-----------------------------------------------------
g45:
spec.arb_shader_texture_lod.execution.tex-miplevel-selection *gradarb cube
Standard Output
/tmp/build_root/m64/lib/piglit/bin/tex-miplevel-selection *GradARB Cube -auto -fbo

Standard Error
tex-miplevel-selection: /var/lib/jenkins/jobs/Leeroy/workspace/repos/mesa/src/mesa/drivers/dri/i965/brw_fs_generator.cpp:704: void fs_generator::generate_tex(fs_inst*, brw_reg, brw_reg, brw_reg): Assertion `inst->mlen == 3' failed.

-----------------------------------------------------
g45:
spec.arb_shader_texture_lod.execution.arb_shader_texture_lod-texgradcube
Standard Output
/tmp/build_root/m64/lib/piglit/bin/arb_shader_texture_lod-texgradcube -auto -fbo

Standard Error
arb_shader_texture_lod-texgradcube: /var/lib/jenkins/jobs/Leeroy/workspace/repos/mesa/src/mesa/drivers/dri/i965/brw_fs_generator.cpp:704: void fs_generator::generate_tex(fs_inst*, brw_reg, brw_reg, brw_reg): Assertion `inst->mlen == 3' failed.

-----------------------------------------------------
g965:
spec.arb_shader_texture_lod.compiler.tex_grad-texturecube-cube-vec3.frag
Standard Output
/tmp/build_root/m64/lib/piglit/bin/glslparsertest /tmp/build_root/m64/lib/piglit/generated_tests/spec/arb_shader_texture_lod/compiler/tex_grad-textureCube-Cube-vec3.frag pass 1.10 GL_ARB_shader_texture_lod

Standard Error
glslparsertest: /var/lib/jenkins/jobs/Leeroy/workspace/repos/mesa/src/mesa/drivers/dri/i965/brw_fs_generator.cpp:704: void fs_generator::generate_tex(fs_inst*, brw_reg, brw_reg, brw_reg): Assertion `inst->mlen == 3' failed.
-----------------------------------------------------


It may be that these assertions are intermittent.
Comment 1 Kenneth Graunke 2015-06-18 23:13:55 UTC
Created attachment 116584 [details] [review]
Fix for the bug (untested)

My Gen4 SIMD16 texturing code was broken.  I've attached a patch which should fix it, but I haven't had access to my machine to piglit test it yet.

The tests still assert fail, but due to another existing bug with tile offsets.
Comment 2 Iago Toral 2015-06-19 05:50:20 UTC
(In reply to Kenneth Graunke from comment #1)
> Created attachment 116584 [details] [review] [review]
> Fix for the bug (untested)
> 
> My Gen4 SIMD16 texturing code was broken.  I've attached a patch which
> should fix it, but I haven't had access to my machine to piglit test it yet.
> 
> The tests still assert fail, but due to another existing bug with tile
> offsets.

Ugh, sorry about this... I don't have gen4 hardware available and never imagined this could break older gens like this.

Since you have a patch for this and the driver still hits more problems down the line I fear that my change is driving the gen4 code through paths that were not ready for this. If it creates too much havoc for you we can always limit my change to gen >= 5 while we figure out how to apply this to gen4.
Comment 3 Kenneth Graunke 2015-06-19 17:44:07 UTC
Don't worry about it!  The original bug was just a stupid mistake I made recently, and the final thing causing them to fail is a long-time bug we really ought to fix that has absolutely nothing to do with what you did :)
Comment 4 Mark Janes 2015-06-19 18:19:07 UTC
With Ken's patch, the crashes are gone.  One g45 test continues
to fail, the others are fixed.  The remaining failure:
-----------------------------------------------------
g45:
spec.arb_shader_texture_lod.execution.arb_shader_texture_lod-texgradcube

crash changed to failure:

/tmp/build_root/m64/lib/piglit/bin/arb_shader_texture_lod-texgradcube -auto -fbo
Left: textureCube, Right: textureCubeGradARB
Probe color at (80,78)
  Left: 0.678431 0.333333 0.000000 1.000000
  Right: 0.647059 0.349020 0.000000 1.000000

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.