<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Handling of S3TC with backends not supporting s3tc (like i915g)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=70432">70432</a>
          </td>
        </tr>

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

        <tr>
          <th>Summary</th>
          <td>Handling of S3TC with backends not supporting s3tc (like i915g)
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>minor
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>freedesktop-bugzilla@mkarcher.dialup.fu-berlin.de
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

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

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

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

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Portal for Windows (in steam) tries to set up compressed textures like this
(from seen in apitrace)

 glTexImage2D(target = GL_TEXTURE_2D, level = 0, internalformat =
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, width = 1024, height = 1024, border =
0, format = GL_RGBA, type = GL_UNSIGNED_BYTE, pixels = NULL)
 glCompressedTexSubImage2DARB(target = GL_TEXTURE_2D, level = 0, xoffset = 0,
yoffset = 0, width = 1024, height = 1024, format =
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, imageSize = 524288, data = [binary
data, size = 512 kb])

The glTexImage2D would encounter an assertion failure on debug builds, and the
glCompressedTexSubImage2DARB causes an division by zero on release builds. The
generic Mesa core decides that S3TC compression is OK when libtxc_dxtn is
installed (I have the s2tc version installed), and so texture_error_check
succeeds on the first call. Nevertheless _mesa_choose_texture_format fails as
S3TC is not supported on i915g. If assertions were enabled, the assertion
texFormat != MESA_FORMAT_NONE would trigger, but that condition is ignored.

The block size check in glCompressedTexSubImage2DARB ("(xoffset % bw != 0) ||
(yoffset % bh != 0)") crashes for MESA_FORMAT_NONE, as bw and bh are zero in
that case.

Uninstalling libtxc-dxtn-s2tc helps to not trigger that problem, thus the
"minor" severity, as that library on a system without s3tc support is mostly
pointless anyway.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>