<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 - Indexed SHADING_LANGUAGE_VERSION query not supported"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=104915">104915</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Indexed SHADING_LANGUAGE_VERSION query not supported
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>minor
          </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>baldurk@baldurk.org
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=137134" name="attach_137134" title="GLFW sample testing shading language version queries">attachment 137134</a> <a href="attachment.cgi?id=137134&action=edit" title="GLFW sample testing shading language version queries">[details]</a></span>
GLFW sample testing shading language version queries

In GL4.3 the spec added new glGetStringi() query GL_SHADING_LANGUAGE_VERSION,
which allows an application to query a list of supported versions (rather than
just the latest, which glGetString() returns). I don't believe this ever
existed in an extension, only in this new core version.

There are two queries relevant - the GL_SHADING_LANGUAGE_VERSION passed to
glGetStringi(), and then the index ranges from 0 to whatever
glGetIntegerv(GL_NUM_SHADING_LANGUAGE_VERSIONS) returns, which is the other
query.

I've attached a simple program (using glfw for conciseness/clarity) that
exhibits the problem in an isolated run. The important bit though is:

  printf("Shading language version: %s\n",
glGetString(GL_SHADING_LANGUAGE_VERSION));

  glGetIntegerv(GL_NUM_SHADING_LANGUAGE_VERSIONS, &numLanguages);
  printf("%d total languages\n", numLanguages);

  for(i = 0; i < numLanguages; i++)
    printf("language %d: %s\n", i, glGetStringi(GL_SHADING_LANGUAGE_VERSION,
i));

Actual output:

  Shading language version: 4.50
  0 total languages

Expected output (something along these lines):

  Shading language version: 4.50
  10 total languages
  language 0: 450 core
  language 1: 450 compatibility
  language 2: 440 core
  language 3: 440 compatibility
  language 4: 430 core
  language 5: 430 compatibility
  language 6: 420 core
  language 7: 420 compatibility
  language 8: 410 core
  language 9: 410 compatibility</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>