Bug 91461 - gl_TessLevel* writes have no effect for all but the last TCS invocation
Summary: gl_TessLevel* writes have no effect for all but the last TCS invocation
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-25 14:33 UTC by Daniel Scharrer
Modified: 2015-08-06 18:51 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Tessellation test case (6.03 KB, text/plain)
2015-07-25 14:34 UTC, Daniel Scharrer
Details

Description Daniel Scharrer 2015-07-25 14:33:27 UTC
The tessellator ignores all writes to gl_TessLevelInner and gl_TessLevelOuter by the tessellation control shader except except those done by the last TCS invocation (gl_InvocationID == patch output vertices - 1).

This results in no primitives being generated unless all entries of gl_TessLevelOuter are written in that invocation (the 'initial' values seem to be 0 for gl_TessLevelOuter and 1 for gl_TessLevelInner).

Additionally, barrier() does not synchronize changes to the gl_TessLevel* between TCS invocations.

Neither of these problems can be reproduced with user-defined 'patch out' variables - writes by any TCS invocation are visible in the evaluation shader and barrier() makes them visible to the other TCS invocations.

GPU: Radeon HD 7950 (TAHITI)
Mesa: 10.7.0-devel (git-9deb614)
LLVM: r243203
Comment 1 Daniel Scharrer 2015-07-25 14:34:24 UTC
Created attachment 117373 [details]
Tessellation test case

I have attached a test case for this. It can be compiled and run using:
 $ sh tessellation.cpp

Use the arrow keys to change which TCS invocation writes to gl_TessLevel* (or use space/enter to toggle between the first and the last).

It should display a yellow grid no matter what TCS invocation is selected but instead displays a green grid for invocation 3 and nothing for all other invocations.
Comment 2 Daniel Scharrer 2015-08-03 14:11:36 UTC
I can confirm that the patch "radeonsi: before storing tess levels, load them from LDS instead of temporary" on the mailing list fixes the issue.
Comment 3 Marek Olšák 2015-08-06 18:51:28 UTC
Fixed by 60159bcfc66a067b50da06f5cabfa20d72e89. 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.