1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-05 06:30:06 +00:00

Check texture dimensions instead of internal format in max texture

size check to work around OS X ATI driver bugs:
- does not keep format but use an equivalent one (1 becomes 0x8040).
- does not set to 0 on failure but to 0x8018


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31013 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-04-04 19:56:26 +00:00
parent 3107620451
commit e6455d7161

View File

@ -172,7 +172,6 @@ static int initTextures(void)
GLfloat texpercx, texpercy; GLfloat texpercx, texpercy;
int s; int s;
int x=0, y=0; int x=0, y=0;
GLint format=0;
// textures smaller than 64x64 might not be supported // textures smaller than 64x64 might not be supported
s=64; s=64;
@ -190,15 +189,16 @@ static int initTextures(void)
/* Test the max texture size */ /* Test the max texture size */
do { do {
GLint w;
glTexImage2D (GL_PROXY_TEXTURE_2D, 0, glTexImage2D (GL_PROXY_TEXTURE_2D, 0,
gl_internal_format, gl_internal_format,
texture_width, texture_height, texture_width, texture_height,
0, gl_bitmap_format, gl_bitmap_type, NULL); 0, gl_bitmap_format, gl_bitmap_type, NULL);
glGetTexLevelParameteriv glGetTexLevelParameteriv
(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format); (GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
if (format == gl_internal_format) if (w >= texture_width)
break; break;
mp_msg (MSGT_VO, MSGL_V, "[gl2] Needed texture [%dx%d] too big, trying ", mp_msg (MSGT_VO, MSGL_V, "[gl2] Needed texture [%dx%d] too big, trying ",