[Cogl] [PATCH] Remove the public ARBfp feature

Robert Bragg robert at sixbynine.org
Wed Jan 30 06:32:13 PST 2013


This looks good to land to me:

Reviewed-by: Robert Bragg <robert at linux.intel.com>

thanks,
- Robert

On Wed, Jan 30, 2013 at 2:21 PM, Neil Roberts <neil at linux.intel.com> wrote:
> Cogl no longer publicly exposes ARBfps so the feature check is
> useless. This patch converts it to be an internal private feature
> which is used to determine whether we can use the ARBfp fragend.
> ---
>  cogl/cogl-context.c                                   | 2 +-
>  cogl/cogl-context.h                                   | 2 --
>  cogl/cogl-private.h                                   | 3 ++-
>  cogl/driver/gl/cogl-pipeline-opengl.c                 | 2 +-
>  cogl/driver/gl/gl/cogl-driver-gl.c                    | 2 +-
>  cogl/driver/gl/gl/cogl-pipeline-progend-fixed-arbfp.c | 2 +-
>  examples/cogl-info.c                                  | 5 -----
>  7 files changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c
> index ea2b1c0..21f87f4 100644
> --- a/cogl/cogl-context.c
> +++ b/cogl/cogl-context.c
> @@ -85,7 +85,7 @@ _cogl_init_feature_overrides (CoglContext *ctx)
>      ctx->private_feature_flags &= ~COGL_PRIVATE_FEATURE_PBOS;
>
>    if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_ARBFP)))
> -    COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_ARBFP, FALSE);
> +    ctx->private_feature_flags &= ~COGL_PRIVATE_FEATURE_ARBFP;
>
>    if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_GLSL)))
>      COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_GLSL, FALSE);
> diff --git a/cogl/cogl-context.h b/cogl/cogl-context.h
> index 160f5cd..25e1d24 100644
> --- a/cogl/cogl-context.h
> +++ b/cogl/cogl-context.h
> @@ -184,7 +184,6 @@ cogl_is_context (void *object);
>   * @COGL_FEATURE_ID_ONSCREEN_MULTIPLE: Multiple onscreen framebuffers
>   *    supported.
>   * @COGL_FEATURE_ID_GLSL: GLSL support
> - * @COGL_FEATURE_ID_ARBFP: ARBFP support
>   * @COGL_FEATURE_ID_UNSIGNED_INT_INDICES: Set if
>   *     %COGL_INDICES_TYPE_UNSIGNED_INT is supported in
>   *     cogl_indices_new().
> @@ -220,7 +219,6 @@ typedef enum _CoglFeatureID
>    COGL_FEATURE_ID_TEXTURE_RECTANGLE,
>    COGL_FEATURE_ID_TEXTURE_3D,
>    COGL_FEATURE_ID_GLSL,
> -  COGL_FEATURE_ID_ARBFP,
>    COGL_FEATURE_ID_OFFSCREEN,
>    COGL_FEATURE_ID_OFFSCREEN_MULTISAMPLE,
>    COGL_FEATURE_ID_ONSCREEN_MULTIPLE,
> diff --git a/cogl/cogl-private.h b/cogl/cogl-private.h
> index d1c32e8..08ee775 100644
> --- a/cogl/cogl-private.h
> +++ b/cogl/cogl-private.h
> @@ -56,7 +56,8 @@ typedef enum
>    COGL_PRIVATE_FEATURE_QUERY_TEXTURE_PARAMETERS = 1L<<20,
>    COGL_PRIVATE_FEATURE_ALPHA_TEXTURES = 1L<<21,
>    COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE = 1L<<22,
> -  COGL_PRIVATE_FEATURE_TEXTURE_MAX_LEVEL = 1L<<23
> +  COGL_PRIVATE_FEATURE_TEXTURE_MAX_LEVEL = 1L<<23,
> +  COGL_PRIVATE_FEATURE_ARBFP = 1L<<24
>  } CoglPrivateFeatureFlags;
>
>  /* Sometimes when evaluating pipelines, either during comparisons or
> diff --git a/cogl/driver/gl/cogl-pipeline-opengl.c b/cogl/driver/gl/cogl-pipeline-opengl.c
> index 8fc4a55..0a7b4db 100644
> --- a/cogl/driver/gl/cogl-pipeline-opengl.c
> +++ b/cogl/driver/gl/cogl-pipeline-opengl.c
> @@ -662,7 +662,7 @@ get_max_activateable_texture_units (void)
>               uploaded (but doesn't necessarily relate to how many texture
>               images can be sampled) */
>            if (cogl_has_feature (ctx, COGL_FEATURE_ID_GLSL) ||
> -              cogl_has_feature (ctx, COGL_FEATURE_ID_ARBFP))
> +              (ctx->private_feature_flags & COGL_PRIVATE_FEATURE_ARBFP))
>              /* Previously this code subtracted the value by one but there
>                 was no explanation for why it did this and it doesn't seem
>                 to make sense so it has been removed */
> diff --git a/cogl/driver/gl/gl/cogl-driver-gl.c b/cogl/driver/gl/gl/cogl-driver-gl.c
> index 140a0e7..efe25c1 100644
> --- a/cogl/driver/gl/gl/cogl-driver-gl.c
> +++ b/cogl/driver/gl/gl/cogl-driver-gl.c
> @@ -465,7 +465,7 @@ _cogl_driver_update_features (CoglContext *ctx,
>      private_flags |= COGL_PRIVATE_FEATURE_BLEND_CONSTANT;
>
>    if (ctx->glGenPrograms)
> -    COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_ARBFP, TRUE);
> +    private_flags |= COGL_PRIVATE_FEATURE_ARBFP;
>
>    if (ctx->glCreateProgram)
>      COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_GLSL, TRUE);
> diff --git a/cogl/driver/gl/gl/cogl-pipeline-progend-fixed-arbfp.c b/cogl/driver/gl/gl/cogl-pipeline-progend-fixed-arbfp.c
> index 31e715b..3d41f92 100644
> --- a/cogl/driver/gl/gl/cogl-pipeline-progend-fixed-arbfp.c
> +++ b/cogl/driver/gl/gl/cogl-pipeline-progend-fixed-arbfp.c
> @@ -58,7 +58,7 @@ _cogl_pipeline_progend_fixed_arbfp_start (CoglPipeline *pipeline)
>    /* Validate that we can handle the fragment state using ARBfp
>     */
>
> -  if (!cogl_has_feature (ctx, COGL_FEATURE_ID_ARBFP))
> +  if (!(ctx->private_feature_flags & COGL_PRIVATE_FEATURE_ARBFP))
>      return FALSE;
>
>    /* Fragment snippets are only supported in the GLSL fragend */
> diff --git a/examples/cogl-info.c b/examples/cogl-info.c
> index 3eacdc3..50721b2 100644
> --- a/examples/cogl-info.c
> +++ b/examples/cogl-info.c
> @@ -70,11 +70,6 @@ struct {
>      "GLSL support"
>    },
>    {
> -    COGL_FEATURE_ID_ARBFP,
> -    "ARBFP support",
> -    "ARBFP support"
> -  },
> -  {
>      COGL_FEATURE_ID_UNSIGNED_INT_INDICES,
>      "Unsigned integer indices",
>      "COGL_RENDERER_INDICES_TYPE_UNSIGNED_INT is supported in cogl_indices_new()."
> --
> 1.7.11.3.g3c3efa5
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl


More information about the Cogl mailing list