Bug 212762

Summary: [11.0-RC2] [i915kms] OpenGL: DDS/DXT textures are rendered black, missing libtxn_dxtn-20140604 package
Product: Base System Reporter: Aleksander Alekseev <afiskon>
Component: kernAssignee: freebsd-x11 (Nobody) <x11>
Status: Closed FIXED    
Severity: Affects Some People CC: afiskon, dbn, rezny
Priority: --- Keywords: i915
Version: 11.0-STABLE   
Hardware: Any   
OS: Any   
Bug Depends on: 218799    
Bug Blocks:    

Description Aleksander Alekseev 2016-09-17 09:57:43 UTC
Here is a simple OpenGL project that uses DXT textures:

https://github.com/afiskon/c-opengl-text/

README.md describes how to build it on FreeBSD, it's very simple.

Here is how it should look like:

http://eax.me/files/2016/02/opengl-text.jpg

Here is how it actually looks like now on FreeBSD:

http://afiskon.ru/s/fd/5938d906fa_opengl-regression.png

In other words all DXT textures are rendered black. I had this issue before a few months ago and installing `libtxn_dxtn-20140604` package fixed it. The problem is there is no such package or any similar package any longer.

Hardware:

* Fujitsu Lifebook E733
* Intel HD Graphics 4000
Comment 1 Aleksander Alekseev 2016-09-17 10:40:25 UTC
A few updates on this ticket.

1) Previous discussion https://lists.freebsd.org/pipermail/freebsd-x11/2016-February/017198.html

2) Installing libtxn_dxtn-20140604.txz from here http://ftp.rusnet.ru/FreeBSD/PKG/freebsd%3A10%3Ax86%3A64/release_3/All/ fixes a problem. (Mirror: http://afiskon.ru/s/8b/13dfd0ba0b_libtxn_dxtn-20140604.txz ) So problem is really caused by a missing package. What happened to it? Didn't find any corresponding records in /usr/ports/UPDATING.

3) After installing a package FPS is very low (from 10 to 40 FPS depending on window size) and textures are rendered very weird:

http://afiskon.ru/s/6d/07d8fc8c66_textures-quality.png

I need to add user to 'video' group:

sudo pw group mod video -m eax

... and re-login or run `su eax` (since adding user to the group doesn't apply immediately - http://unix.stackexchange.com/q/18796 ) to fix this. After this everything renders as expected!

I strongly believe that this is a very inconvenient for users. Any chance it could be considered a bug (a minor one)?
Comment 2 David Naylor freebsd_committer freebsd_triage 2016-11-18 18:42:54 UTC
It appears that graphics/dri is missing a RUN_DEPENDS=libtxc_dxtn.so:graphics/s2tc.  I can commit this fix if someone from x11 can approve?  

(P.S. Note that it is libtxc_dxtn, not libtxn_dxtn.  There appeared to be a typo in the original port: PORTORIGIN = graphics/libtxc_dxtn, PORTNAME = libtxn_dxtn, LIBNAME = libtxc_dxtn).
Comment 3 Jan Beich freebsd_committer freebsd_triage 2017-04-11 11:18:46 UTC
(In reply to Aleksander Alekseev from comment #0)
> https://github.com/afiskon/c-opengl-text/

Note, the demo works fine on i915/i965 without libtxc_dxtn.so but just "force_s3tc_enable=1" set via environ(7) instead.
Comment 4 Matthew Rezny freebsd_committer freebsd_triage 2017-04-11 16:07:54 UTC
(In reply to David Naylor from comment #2)

That's a good suggestion with one change. Since it's not a binary which can be found in path, it should be RUN_DEPENDS=${LOCALBASE}/lib/libtxc_dxtn.so:graphics/s2tc. I will add this in the next update.
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-05-12 18:47:28 UTC
A commit references this bug:

Author: rezny
Date: Fri May 12 18:46:56 UTC 2017
New revision: 440699
URL: https://svnweb.freebsd.org/changeset/ports/440699

Log:
  Consolidate the Mesa ports, update to 17.0.4, and add Wayland option

  * libGL, libEGL, libglesv2, libglapi, and gbm have been moved into mesa-libs,
    graphics/dri has been renamed to mesa-dri, and USE_GL has been adjusted
  * mesa-libs has a new WAYLAND option that enables platform support in libEGL
  * mesa-dri now depends on graphics/s2tc for compressed texture support [1]
  * re-remove obsolete dependency on makedepends [2]
  * correct sed fix backported from 17.1 [3]

  PR:		218799 (exp-run), 212762 [1], 218552 [2], 218562 [3]
  Submitted by:	dbn [1], jbeich [2,3]
  Reported by:	afiskon@devzen.ru [1]
  Reviewed by:	kwm, johalun0@gmail.com
  Approved by:	portmgr, swills (mentor)
  Differential Revision:  https://reviews.freebsd.org/D10448

Changes:
  head/MOVED
  head/Mk/Scripts/qa.sh
  head/Mk/bsd.port.mk
  head/Mk/bsd.xorg.mk
  head/emulators/i386-wine/Makefile.i386
  head/emulators/i386-wine-devel/Makefile.i386
  head/graphics/Makefile
  head/graphics/copperspice/Makefile
  head/graphics/dri/
  head/graphics/gbm/
  head/graphics/libEGL/
  head/graphics/libGL/
  head/graphics/libglapi/
  head/graphics/libglesv2/
  head/graphics/libosmesa/Makefile
  head/graphics/mesa-dri/
  head/graphics/mesa-dri/Makefile
  head/graphics/mesa-dri/Makefile.common
  head/graphics/mesa-dri/Makefile.targets
  head/graphics/mesa-dri/distinfo
  head/graphics/mesa-dri/files/
  head/graphics/mesa-dri/files/configure.ac
  head/graphics/mesa-dri/files/patch-configure
  head/graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp
  head/graphics/mesa-dri/pkg-descr
  head/graphics/mesa-libs/
  head/graphics/mesa-libs/Makefile
  head/graphics/mesa-libs/Makefile.common
  head/graphics/mesa-libs/Makefile.targets
  head/graphics/mesa-libs/distinfo
  head/graphics/mesa-libs/files/
  head/graphics/mesa-libs/pkg-descr
  head/graphics/mesa-libs/pkg-plist
  head/graphics/s2tc/Makefile
  head/graphics/wayland/Makefile
  head/graphics/wayland/distinfo
  head/graphics/wayland/files/patch-Makefile.am
  head/graphics/wayland/files/patch-src_wayland-server.c
  head/graphics/wayland/files/patch-src_wayland-shm.c
  head/graphics/wayland/files/patch-tests_connection-test.c
  head/graphics/wayland/files/patch-tests_event-loop-test.c
  head/graphics/wayland/files/patch-tests_os-wrappers-test.c
  head/graphics/wayland/files/patch-tests_queue-test.c
  head/graphics/wayland/files/patch-tests_test-runner.c
  head/lang/clover/Makefile
  head/lang/clover/pkg-descr
  head/lang/clover/pkg-plist
  head/net/tigervnc/Makefile
  head/net/tigervnc-devel/Makefile
  head/science/iboview/Makefile
  head/x11/xorg/Makefile
  head/x11-toolkits/gtkada3/Makefile