From a65429363e5c9dc03f84df3b8d4a95988b602dd1 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 8 Jul 2010 18:37:01 +0100 Subject: [PATCH] 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. --- clutter/cogl/cogl/driver/gles/cogl-texture-driver.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clutter/cogl/cogl/driver/gles/cogl-texture-driver.c b/clutter/cogl/cogl/driver/gles/cogl-texture-driver.c index 610411e6f..64a3d7eba 100644 --- a/clutter/cogl/cogl/driver/gles/cogl-texture-driver.c +++ b/clutter/cogl/cogl/driver/gles/cogl-texture-driver.c @@ -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