Bug 75068 - GL_COLOR not handled in GL_ARB_vertex_program MatrixMode() function
Summary: GL_COLOR not handled in GL_ARB_vertex_program MatrixMode() function
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All All
: medium minor
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-16 23:13 UTC by Benjamin Bellec
Modified: 2014-02-16 23:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Benjamin Bellec 2014-02-16 23:13:20 UTC
The GL_ARB_vertex_program's MatrixMode function is defined in ./src/mesa/main/matrix.c, function "void GLAPIENTRY _mesa_MatrixMode( GLenum mode )".

OpenGL spec defined GL_COLOR as a valid parameter but it is not handled here.

These results in "Mesa: User error: GL_INVALID_ENUM in glMatrixMode(mode)" errors when launching the Source engine games (CS:S, L4D2, HL² or Team Fortress 2) and when mesa debug is set on.

Also, I don't know if it's a problem or not, the parameters GL_MATRIX8_ARB to GL_MATRIX31_ARB are not handled too.
Comment 1 Kenneth Graunke 2014-02-16 23:40:57 UTC
Yes, that was intentionally removed in 2010:

commit 73578ba9c4938db3a23198c3a2ddf843cfc4f700
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Sep 9 16:58:48 2010 -0700

    mesa: Remove SGI_color_matrix.
    
    Another optional ARB_imaging subset extension.

Passing GL_COLOR to MatrixMode refers to the color matrix stack, which doesn't exist without either GL_SGI_color_matrix or GL_ARB_imaging, which are optional extensions that Mesa doesn't support.

Raising INVALID_ENUM here seems like the only sensible option for drivers that want to implement ARB_vertex_program but not the other optional deprecated extensions from the 1990s.

We've talked to Valve about this in the past, and discovered that Source engine games don't use the color matrix stack.  However, the Steam overlay tries to save and restore it, for compatibility with games that do use it.  They claim to properly handle the GL error, so it's just (a lot of) spam.


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.