Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/opengl: enable S3TC by default #82630

Closed
wants to merge 1 commit into from
Closed

Conversation

emilazy
Copy link
Member

@emilazy emilazy commented Mar 15, 2020

Motivation for this change

The patents expired in 2017:

Resolves #82627.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@danderson
Copy link
Contributor

LGTM. Did similar research to file the linked bug. Wikipedia has more primary sources that confirm the patent expiration.

@delroth
Copy link
Contributor

delroth commented Mar 15, 2020

I'm actually curious whether libtxc_dxtn is still needed for anything these days. I can't figure out what or how it would get loaded by anything (it's not a build time dependency, so presumably there is some kind of plugin system that would load it?) and it doesn't seem like the package is carried by the likes of Debian and others anymore.

In any case, I'm in strong favor of removing the option and either 1. getting rid of libtxc_dxtn; 2. just using the s3tc version by default. The current option is technical debt that ~nobody will use and can easily be implemented with local overrides if people really strongly care.

@delroth
Copy link
Contributor

delroth commented Mar 15, 2020

More digging: it seems like the only reason for libtxc_dxtn being useful was some wine-staging patch that could use it sometimes, and that patch was also picked up by Lutris.

This matches the build-time dependencies in nixpkgs. There could be other run-time dependencies, but I would expect the runtime path thing was also for wine-staging. Looking at the wine-staging docs from 2017:

Since 1.7.37 it is not necessary anymore to have this library available at build time, if it is called either libtxc_dxtn.so or libtxc_dxtn_s2tc.so.0. If your distro uses a library with a different name, you still need it. This change was done to simplify building Wine Staging on distros where libtxc_dxtn is not available in the official repositories.

However, wine-staging stopped using libtxc_dxtn around 2018: wine-staging/wine-staging#56

Gentoo went through the same deprecation process, though they had to keep the package for compatibility with old overlays: https://bugs.gentoo.org/654466

Let's just kill the package and all uses of it?

@vcunat
Copy link
Member

vcunat commented Mar 15, 2020

S3TC should now be built directly with mesa. This old split is obsolete, I believe, as well as S2TC.

Maybe we do need to tweak our mesa derivation, though. I don't even know off the top of my head how to test the support.

@vcunat
Copy link
Member

vcunat commented Mar 15, 2020

Release notes for 17.3.0 said:

libtxc_dxtn is now integrated into Mesa. GL_EXT_texture_compression_s3tc and GL_ANGLE_texture_compression_dxt are now always enabled on drivers that support them

I believe this NixOS option should be deprecated, and we could probably even remove expressions for the two libraries. I don't feel strongly about backporting to 20.03.

@emilazy
Copy link
Member Author

emilazy commented Mar 15, 2020

Agreed re: killing the packages; closing this PR in favour of that (might not get around to submitting a new one soon, so anyone else can feel free to open a replacement too).

@delroth
Copy link
Contributor

delroth commented Mar 16, 2020

Just sent one FYI.

@emilazy emilazy deleted the enable-s3tc branch March 25, 2020 01:22
delroth added a commit to delroth/nixpkgs that referenced this pull request Apr 20, 2020
Context: discussion in NixOS#82630

Mesa has been supporting S3TC natively without requiring these libraries
since the S3TC patent expired in December 2017.
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request May 13, 2020
Context: discussion in NixOS#82630

Mesa has been supporting S3TC natively without requiring these libraries
since the S3TC patent expired in December 2017.

(cherry picked from commit 1b89bff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nixos/opengl: consider enabling S3TC by default
4 participants