Bug 93526

Summary: GfxBench 4 tessellation demos misrender
Product: Mesa Reporter: Kenneth Graunke <kenneth>
Component: Drivers/DRI/i965Assignee: Kenneth Graunke <kenneth>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: eero.t.tamminen
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Kenneth Graunke 2015-12-28 21:30:40 UTC
GfxBench 4 has a tessellation shader demo.  It misrenders on both i965 and nve0, but works with the nvidia blob.
Comment 1 Kenneth Graunke 2015-12-28 21:31:59 UTC
Some comments from Eero:

"On quick look at the apitrace output for GfxBench 4.0 tessellation test, basically it has a single shader source which has few defines that determine whether geometry shader or tessellation is used, and for which shader stage the pre-processor extracts the appropriate code. On each frame it uses two variants of these tessellation shader pipelines, one with and other without geometry shader.

That's also how this test differs from tessellation pipelines in Unigine Heaven, SynMark terrain and GpuTest tessellation tests, those don't use geometry shader with tessellation shaders. I would guess that Steam games didn't use geometry shader with tessellation shaders either..."
Comment 2 Kenneth Graunke 2015-12-30 10:10:38 UTC
It's a bug in the GLSL linker.  There are two outputs - one is a struct of four mat4s, the other a float.  The linker thinks the structure takes no space, so it assigns both the same location.
Comment 3 Kenneth Graunke 2015-12-31 11:42:10 UTC
Well, I fixed that (commit 7cdc2b9ca0ab6 - glsl: Fix varying struct locations when varying packing is disabled.)  That almost fixed it on Nouveau - it just needed one more tiny fix (commit 65d3f85eb3ef - nvc0: Set winding order regardless of domain.)  Since it works on a Mesa-based driver, I think core Mesa is probably OK.

Probably an i965 bug at this point.  I'll look at it again soon.
Comment 4 Kenneth Graunke 2015-12-31 11:44:41 UTC
Oh, another thing: the very first image drawn is broken, and the GS is disabled for that.  So, I think it's purely a tessellation problem, and not GS related after all.
Comment 5 Eero Tamminen 2016-01-07 15:59:04 UTC
Triangles for the cars in the GfxBench "gl_4" test are also clearly wrong.  That could also be due to the same bug.

That test can be run with:
export MESA_GL_VERSION_OVERRIDE=4.3
export MESA_GLSL_VERSION_OVERRIDE=430
export MESA_EXTENSION_OVERRIDE=GL_ARB_compute_shader

(Without CS extension it would segfault.)
Comment 6 Kenneth Graunke 2016-01-11 23:11:53 UTC
Patch on the list:
http://lists.freedesktop.org/archives/mesa-dev/2016-January/104675.html
Comment 7 Eero Tamminen 2016-01-12 10:41:51 UTC
(In reply to Kenneth Graunke from comment #6)
> Patch on the list:
> http://lists.freedesktop.org/archives/mesa-dev/2016-January/104675.html

That patch fixes also vertexes in the GfxBench v4 "gl_4" (Car Chase) test.

(Shapes in the test look all now OK, but some other issues remain in that GL 4.3 test.)
Comment 8 Kenneth Graunke 2016-01-12 20:27:28 UTC
Fix is upstream:

commit 9095847c254be2d55ab188232aa6b84555dbac4e
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Mon Jan 11 12:25:12 2016 -0800

    i965: Mark TCS URB writes as having side effects.

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.