<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - The Chronicles of Riddick: Assault on Dark Athena fails to start with nouveau"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=91169">91169</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>The Chronicles of Riddick: Assault on Dark Athena fails to start with nouveau
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>git
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>patch
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Mesa core
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>gyebro69@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>imirkin@alum.mit.edu
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=116838" name="attach_116838" title="trace file (unpatched mesa, game fails to start)">attachment 116838</a> <a href="attachment.cgi?id=116838&action=edit" title="trace file (unpatched mesa, game fails to start)">[details]</a></span>
trace file (unpatched mesa, game fails to start)

The game uses OpenGL and runs fine in Wine with Nvidia binary drivers 340.76.
With nouveau the game crashes on start and pops up an error message something
about: 
'CCException. 
Location: class CRenderContextGL::GLSL_LoadSrc
Message: OpenGL: no error'
I get the same error message with the software renderer too.

The following proposed patched written by Ilia Mirkin fixes the problem for me,
the game starts, shows the intro videos and menus correctly:

diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index efab299..9c3037b 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp
@@ -2045,7 +2045,7 @@ builtin_builder::create_builtins()

    add_function("texture2D",
                 _texture(ir_tex, always_available, glsl_type::vec4_type, 
glsl_type::sampler2D_type, glsl_type::vec2_type),
-                _texture(ir_txb, fs_only,          glsl_type::vec4_type, 
glsl_type::sampler2D_type, glsl_type::vec2_type),
+                _texture(ir_txb, always_available,         
glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec2_type),
                 _texture(ir_tex, texture_external, glsl_type::vec4_type, 
glsl_type::samplerExternalOES_type, glsl_type::vec2_type),
                 NULL);

@@ -2096,7 +2096,7 @@ builtin_builder::create_builtins()

    add_function("textureCube",
                 _texture(ir_tex, always_available, glsl_type::vec4_type, 
glsl_type::samplerCube_type, glsl_type::vec3_type),
-                _texture(ir_txb, fs_only,          glsl_type::vec4_type, 
glsl_type::samplerCube_type, glsl_type::vec3_type),
+                _texture(ir_txb, always_available,         
glsl_type::vec4_type,  glsl_type::samplerCube_type, glsl_type::vec3_type),
                 NULL);

    add_function("textureCubeLod",
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 046d5d7..6b1a104 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -655,6 +655,8 @@ void _mesa_glsl_extension::set_flags(_mesa_glsl_parse_state
*state,
  */
 static const _mesa_glsl_extension *find_extension(const char *name)
 {
+   if (strcmp(name, "GL_ATI_shader_texture_lod") == 0)
+      name = "GL_ARB_shader_texture_lod";
    for (unsigned i = 0; i < ARRAY_SIZE(_mesa_glsl_supported_extensions); ++i)
{
       if (strcmp(name, _mesa_glsl_supported_extensions[i].name) == 0) {
          return &_mesa_glsl_supported_extensions[i];


Trace file with patch applied:
<a href="https://drive.google.com/open?id=0B-tTbLKBl-tOQUNwWEgtekN6LVE">https://drive.google.com/open?id=0B-tTbLKBl-tOQUNwWEgtekN6LVE</a>

Fedora 22 32-bit
Mesa 10.6-branchpoint-773-g1de93f9
Kernel 4.0.6-300.fc22.i686+PAE
Xorg 1.17.2
libdrm-2.4.61-3.fc22.i686</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>