Bug 29623 - Regression: GLSL linker aborts when linking a single vertex program containing a varying.
Summary: Regression: GLSL linker aborts when linking a single vertex program containin...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Ian Romanick
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-17 14:19 UTC by Nick Bowler
Modified: 2010-08-17 15:03 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Test case (2.20 KB, text/plain)
2010-08-17 14:19 UTC, Nick Bowler
Details

Description Nick Bowler 2010-08-17 14:19:11 UTC
Created attachment 37927 [details]
Test case

When attempting to link a program object using a single vertex shader that has
a 'varying' object, the GLSL linker instantly aborts:

  varycrash: program/ir_to_mesa.cpp:1467: virtual void ir_to_mesa_visitor::visit(ir_dereference_variable*): Assertion `ir->var->location != -1' failed.

This is a regression from mesa 7.8, presumably due to the recent glsl2 merge.
I can bisect it later if necessary.  Occurs on at least swrast and i965.
Comment 1 Ian Romanick 2010-08-17 14:35:11 UTC
I add a piglit shader_runner test glsl-vs-ff-frag that reproduces this bug.

I think I know what might be causing this.  When linking a vertex shader and a fragment shader, all varyings that are written but not read are marked as not being varying.  When there's only a vertex shader, this pass never happens.  This means the linker should be modified to do at least the demoting of varyings in the VS-only case.
Comment 2 Ian Romanick 2010-08-17 15:03:17 UTC
commit 40e114b5dc60c5e196a86e33c2436b099ed9f392
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Aug 17 14:55:50 2010 -0700

    linker: Demote user-defined varyings in the VS-only case
    
    Fixes piglit test case glsl-vs-ff-frag and bugzilla #29623.


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.