From 11045c724c9344f2f3146054c9ed533d0d6e29ff Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 5 Aug 2010 10:59:03 +0100 Subject: [PATCH] cogl: Adds a COGL_FEATURE_SHADERS_ARBFP feature flag This adds a public feature flag for ARBfp so developers can determine if the cogl API supports ARBfp or not. --- cogl/cogl-internal.h | 2 +- cogl/cogl-material-arbfp.c | 2 +- cogl/cogl-types.h | 4 +++- cogl/cogl.c | 2 +- cogl/driver/gl/cogl-feature-functions.h | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cogl/cogl-internal.h b/cogl/cogl-internal.h index df074687a..afc12553b 100644 --- a/cogl/cogl-internal.h +++ b/cogl/cogl-internal.h @@ -219,7 +219,7 @@ _cogl_xlib_remove_filter (CoglXlibFilterFunc func, typedef enum _CoglFeatureFlagsPrivate { - COGL_FEATURE_PRIVATE_ARB_FP = (1 << 0) + COGL_FEATURE_PRIVATE_PLACE_HOLDER = (1 << 0) } CoglFeatureFlagsPrivate; gboolean diff --git a/cogl/cogl-material-arbfp.c b/cogl/cogl-material-arbfp.c index ea671e9a8..4d7930166 100644 --- a/cogl/cogl-material-arbfp.c +++ b/cogl/cogl-material-arbfp.c @@ -256,7 +256,7 @@ _cogl_material_backend_arbfp_start (CoglMaterial *material, _COGL_GET_CONTEXT (ctx, FALSE); - if (!_cogl_features_available_private (COGL_FEATURE_PRIVATE_ARB_FP)) + if (!cogl_features_available (COGL_FEATURE_SHADERS_ARBFP)) return FALSE; /* TODO: support fog */ diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h index f892bea67..0e654acda 100644 --- a/cogl/cogl-types.h +++ b/cogl/cogl-types.h @@ -226,6 +226,7 @@ typedef enum { /*< prefix=COGL_PIXEL_FORMAT >*/ * @COGL_FEATURE_TEXTURE_YUV: ycbcr conversion support * @COGL_FEATURE_TEXTURE_READ_PIXELS: glReadPixels() support * @COGL_FEATURE_SHADERS_GLSL: GLSL support + * @COGL_FEATURE_SHADERS_ARBFP: ARBFP support * @COGL_FEATURE_OFFSCREEN: FBO support * @COGL_FEATURE_OFFSCREEN_MULTISAMPLE: Multisample support on FBOs * @COGL_FEATURE_OFFSCREEN_BLIT: Blit support on FBOs @@ -276,7 +277,8 @@ typedef enum COGL_FEATURE_TEXTURE_NPOT_MIPMAP = (1 << 16), COGL_FEATURE_TEXTURE_NPOT_REPEAT = (1 << 17), COGL_FEATURE_POINT_SPRITE = (1 << 18), - COGL_FEATURE_TEXTURE_3D = (1 << 19) + COGL_FEATURE_TEXTURE_3D = (1 << 19), + COGL_FEATURE_SHADERS_ARBFP = (1 << 20) } CoglFeatureFlags; /** diff --git a/cogl/cogl.c b/cogl/cogl.c index 4df0cdbd3..624a63c78 100644 --- a/cogl/cogl.c +++ b/cogl/cogl.c @@ -522,7 +522,7 @@ _cogl_features_available_private (CoglFeatureFlagsPrivate features) _cogl_features_init (); if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_DISABLE_ARBFP)) - ctx->feature_flags_private &= ~COGL_FEATURE_PRIVATE_ARB_FP; + ctx->feature_flags_private &= ~COGL_FEATURE_SHADERS_ARBFP; return (ctx->feature_flags_private & features) == features; } diff --git a/cogl/driver/gl/cogl-feature-functions.h b/cogl/driver/gl/cogl-feature-functions.h index 6b184f4a5..26eeee998 100644 --- a/cogl/driver/gl/cogl-feature-functions.h +++ b/cogl/driver/gl/cogl-feature-functions.h @@ -119,8 +119,8 @@ COGL_FEATURE_END () COGL_FEATURE_BEGIN (arbfp, 255, 255, "ARB\0", "fragment_program\0", - 0, - COGL_FEATURE_PRIVATE_ARB_FP) + COGL_FEATURE_SHADERS_ARBFP, + 0) COGL_FEATURE_FUNCTION (void, glGenPrograms, (GLsizei n, GLuint *programs))