[cogl/cogl-1.14] Support cogl_renderer_get_n_fragment_texture_units() for ARBfp
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.14] Support cogl_renderer_get_n_fragment_texture_units() for ARBfp
- Date: Wed, 30 Jan 2013 14:45:21 +0000 (UTC)
commit 23eca5c793cb11c66a02d55df4cf680747691551
Author: Neil Roberts <neil linux intel com>
Date: Wed Jan 30 13:53:48 2013 +0000
Support cogl_renderer_get_n_fragment_texture_units() for ARBfp
There is a cogl_renderer_get_n_fragment_texture_units() function which
is documented to return the number of texture units that are
accessible from a fragment program. This just directly returns the
value from GL_MAX_TEXTURE_IMAGE_UNITS which is available in either the
GLSL extensions or the ARBfp extension. Clutter-GST relies on this to
determine whether it can use a program to convert the YUV data on the
GPU.
When the GL3 driver was added in 66c9db993595b this was changed to
only query the value when the GLSL feature is available. Previously it
would always query the value when the GL or GLES2 driver is used. This
change makes sense on master because there is no API for an
application to make its own ARBfp programs so the only way to access
texture units from a program is via GLSL. However on the 1.14 branch
this patch broke clutter-gst when GLSL is disabled because it thinks
the ARBfp programs can't use multi-texturing.
This patch just changes it to also query the value when ARBfp support
is available.
Note: it's probably note a good idea to apply this patch to master,
but only to the 1.14 branch. On master the function probably needs to
be changed anyway because it is using _COGL_GET_CONTEXT().
Reviewed-by: Robert Bragg <robert linux intel com>
cogl/cogl-renderer.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/cogl/cogl-renderer.c b/cogl/cogl-renderer.c
index 8686935..1518a17 100644
--- a/cogl/cogl-renderer.c
+++ b/cogl/cogl-renderer.c
@@ -590,7 +590,8 @@ cogl_renderer_get_n_fragment_texture_units (CoglRenderer *renderer)
_COGL_GET_CONTEXT (ctx, 0);
#if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES2)
- if (cogl_has_feature (ctx, COGL_FEATURE_ID_GLSL))
+ if (cogl_has_feature (ctx, COGL_FEATURE_ID_GLSL) ||
+ cogl_has_feature (ctx, COGL_FEATURE_ID_ARBFP))
GE (ctx, glGetIntegerv (GL_MAX_TEXTURE_IMAGE_UNITS, &n));
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]