Bug 70432 - Handling of S3TC with backends not supporting s3tc (like i915g)
Summary: Handling of S3TC with backends not supporting s3tc (like i915g)
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-13 18:38 UTC by Michael Karcher
Modified: 2018-04-10 06:04 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Michael Karcher 2013-10-13 18:38:23 UTC
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.
Comment 1 Timothy Arceri 2018-04-10 06:04:19 UTC
The patent for S3TC has expired \o/ and support is now built into Mesa. I suspect this will now work correctly (or at least differently to what is described in this bug) so closing. Please reopen with updated details if this is still a problem.


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.