[MPlayer-dev-eng] [PATCH] Make vo_gl / fragment programs work with Mesa

Matthias Hopf mat at mshopf.de
Sat Feb 24 15:16:32 CET 2007


While preparing a talk for FOSDEM I found out that the vo_gl driver
doesn't really work well together with i915 chips and the open source
Mesa driver.

Basically, Mesa has a glProgramString function and exports it, which
seems completely uncorrelated to glProgramStringARB (I don't exactly
remember whether this is an OpenGL 2.0 call, but I doubt so), which
results in a segfault as soon as a fragment program is to be loaded.
Same for glGenPrograms etc.

Also, all fragment programs in gl_common.c are ARB fragment programs, so
having a fallback for NV fragment programs (which have different syntax)
is actually harmful.

This patch fixes both issues, and -vo gl:yuv=2 works fine now :)


That's the good news. The bad news is that neither lscale=1 nor yuv>2
gets hardware accelerated, because we hit several driver limits. First,
we get:

  Mesa 6.5.3 implementation error: i915_program_error: Can't (yet)
  swizzle TEX arguments
  Please report at bugzilla.freedesktop.org

By patching the ARB program with the second patch (do not apply to SVN!)
we can get around this issue (patch only showcase for lscale=1), but
that makes the program larger, and we hit a second limit we cannot
circumvent:

  Mesa 6.5.3 implementation error: i915_program_error: Exceeded max nr
  indirect texture lookups
  Please report at bugzilla.freedesktop.org

I'll ask Keith later tomorrow about this issue.

Cheers

Matthias

-- 
Matthias Hopf <mhopf at suse.de>      __        __   __
Maxfeldstr. 5 / 90409 Nuernberg   (_   | |  (_   |__          mat at mshopf.de
Phone +49-911-74053-715           __)  |_|  __)  |__  R & D   www.mshopf.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer_gl.diff
Type: text/x-patch
Size: 1960 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070224/b0f35f68/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer_gl_TEST_ONLY.diff
Type: text/x-patch
Size: 1905 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070224/b0f35f68/attachment-0001.bin>


More information about the MPlayer-dev-eng mailing list