1
0
Fork 0

Use GL_MAX_TEXTURE_SIZE on GLES when checking supported tex size

Under big GL, _cogl_texture_driver_size_supported uses the proxy
texture to check whether the given texture size is supported. Proxy
textures aren't available under GLES so previously this would just
return TRUE to assume all texture sizes are supported. This patch
makes it use glGetIntegerv with GL_MAX_TEXTURE_SIZE to give a second
best guess.

This fixes the sliced texture backend so that it will use slices when
the texture is too big.
This commit is contained in:
Neil Roberts 2010-07-08 18:37:01 +01:00
parent eb24d2a252
commit a65429363e

View file

@ -211,7 +211,13 @@ _cogl_texture_driver_size_supported (GLenum gl_target,
int width,
int height)
{
return TRUE;
GLint max_size;
/* GLES doesn't support a proxy texture target so let's at least
check whether the size is greater than GL_MAX_TEXTURE_SIZE */
GE( glGetIntegerv (GL_MAX_TEXTURE_SIZE, &max_size) );
return width <= max_size && height <= max_size;
}
void