Bug 43121 - GLSL Regression: Shader with unused slots in gl_TexCoord array rejected due to too many varyings
Summary: GLSL Regression: Shader with unused slots in gl_TexCoord array rejected due t...
Status: RESOLVED DUPLICATE of bug 34201
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Ian Romanick
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-20 09:33 UTC by Tom Stellard
Modified: 2011-11-21 17:27 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Tom Stellard 2011-11-20 09:33:42 UTC
On r300g, leader portraits are no longer rendered on civ4, because their shaders are being rejected for having too many varyings.  For these shaders, the gl_TexCoord array is being counted as 8 varying because gl_TexCoord[7] is the largest index being accessed, however gl_TexCoord[1] and gl_TexCoord[2] are never used, so the array should really only count as 6 varyings.  This is similar to Bug 42930.
Comment 1 Ian Romanick 2011-11-21 17:27:58 UTC
This is correct behavior.  The shader is broken.  From page 74 of the GLSL 1.30 spec:

    "As with all arrays, indices used to subscript gl_TexCoord (deprecated)
    must either be an integral constant expressions, or this array must be
    re-declared by the shader with a size. The size can be at most
    gl_MaxTextureCoords. Using indexes close to 0 may aid the implementation
    in preserving varying resources."

My guess is that the real problem with this shader is that the other varyings are not packed according to the GLSL requirements.  Since there's already a bug for that, I'm closing this as a dup.

*** This bug has been marked as a duplicate of bug 34201 ***


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.