[cogl/wip/neil/master-next: 8/11] pipeline-arbfp: Check for fog on the pipeline not the legacy state
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/neil/master-next: 8/11] pipeline-arbfp: Check for fog on the pipeline not the legacy state
- Date: Mon, 19 Sep 2011 11:51:52 +0000 (UTC)
commit d00d1ee930aa86e176f493906df18da2db5a731b
Author: Neil Roberts <neil linux intel com>
Date: Wed Sep 14 15:25:58 2011 +0100
pipeline-arbfp: Check for fog on the pipeline not the legacy state
The ARBfp backend can't handle fog so it tries to check for when it's
enabled and bails out. However it was checking using the global legacy
state value on the CoglContext but this doesn't necessarily reflect
the state that will actually be used by the pipeline because Cogl may
have internally pushed a different pipeline.
This patch adds an internal _cogl_pipeline_get_fog_enabled which the
ARBfp backend now uses.
cogl/cogl-pipeline-fragend-arbfp.c | 2 +-
cogl/cogl-pipeline-private.h | 3 +++
cogl/cogl-pipeline.c | 12 ++++++++++++
3 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/cogl/cogl-pipeline-fragend-arbfp.c b/cogl/cogl-pipeline-fragend-arbfp.c
index 294daa9..8c25b36 100644
--- a/cogl/cogl-pipeline-fragend-arbfp.c
+++ b/cogl/cogl-pipeline-fragend-arbfp.c
@@ -165,7 +165,7 @@ _cogl_pipeline_fragend_arbfp_start (CoglPipeline *pipeline,
return FALSE;
/* TODO: support fog */
- if (ctx->legacy_fog_state.enabled)
+ if (_cogl_pipeline_get_fog_enabled (pipeline))
return FALSE;
user_program = cogl_pipeline_get_user_program (pipeline);
diff --git a/cogl/cogl-pipeline-private.h b/cogl/cogl-pipeline-private.h
index 7e019c2..de96c6c 100644
--- a/cogl/cogl-pipeline-private.h
+++ b/cogl/cogl-pipeline-private.h
@@ -1184,6 +1184,9 @@ void
_cogl_pipeline_set_blend_enabled (CoglPipeline *pipeline,
CoglPipelineBlendEnable enable);
+gboolean
+_cogl_pipeline_get_fog_enabled (CoglPipeline *pipeline);
+
void
_cogl_pipeline_set_static_breadcrumb (CoglPipeline *pipeline,
const char *breadcrumb);
diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c
index cdeac12..25518b8 100644
--- a/cogl/cogl-pipeline.c
+++ b/cogl/cogl-pipeline.c
@@ -2859,6 +2859,18 @@ _cogl_pipeline_update_authority (CoglPipeline *pipeline,
}
}
+gboolean
+_cogl_pipeline_get_fog_enabled (CoglPipeline *pipeline)
+{
+ CoglPipeline *authority;
+
+ g_return_val_if_fail (cogl_is_pipeline (pipeline), FALSE);
+
+ authority =
+ _cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_FOG);
+ return authority->big_state->fog_state.enabled;
+}
+
unsigned long
_cogl_pipeline_get_age (CoglPipeline *pipeline)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]