[MPlayer-dev-eng] Fix for vo_gl.c on SGI Octane ?
Diego Biurrun
diego at biurrun.de
Wed Sep 4 18:23:59 CEST 2002
Could you make a patch out of this, please? DOCS/tech/patches.txt
explains how. Thanks
Diego
On Wed, Sep 04, 2002 at 02:50:59PM +0200, Gernot Ziegler wrote:
> Now I found out why vo_gl.c only produces a white canvas, and vo_gl2
> works:
>
> #if 1
> // glBindTexture(GL_TEXTURE_2D, texture_id);
> glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR);
> glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR);
> #ifdef TEXTUREFORMAT_32BPP
> glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, texture_width, texture_height,
> 0,
> #else
> glTexImage2D(GL_TEXTURE_2D, 0, BYTES_PP, texture_width, texture_height,
> 0,
> #endif
> (image_bytes==4)?GL_RGBA:GL_BGR, GL_UNSIGNED_BYTE, ImageData);
> #endif
>
> GL_BGR up there has to be replaced by GL_RGB (the Octane OpenGL driver
> causes an error otherwise).... I don't know if BGR
> is a bug or a feature, but it looks suspicious since:
> for(i=0;i<h;i++){
> glTexSubImage2D( GL_TEXTURE_2D, // target
> 0, // level
> x, // x offset
> y+i, // y offset
> w, // width
> 1, // height
> (BYTES_PP==4)?GL_RGBA:GL_RGB, // format
> GL_UNSIGNED_BYTE, // type
> ImageData+i*dstride ); // *pixels
>
> downloads the pictures in GL_RGB mode.
>
> (BYTES_PP and image_bytes are both 3 here, and TEXTUREFORMAT_32BPP is
> defined, maybe an unexpected combination ?)
More information about the MPlayer-dev-eng
mailing list