summaryrefslogtreecommitdiff
path: root/cogl/cogl-pipeline-layer-private.h
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-02-09 20:39:27 +0000
committerNeil Roberts <neil@linux.intel.com>2012-02-13 17:15:35 +0000
commite6b3bfa41a18d7885ee6933d4333194b9976c0e4 (patch)
tree47935997e30fe38e9bae763f08e8f4e6540df40f /cogl/cogl-pipeline-layer-private.h
parent740bd12f2ddd432af03e3ceb133db0d8e53cf716 (diff)
pipeline: Use layer numbers not unit numbers in the combine strings
In a combine string the application can specify TEXTURE_? as a source to sample from the texture attached to a particular unit. The number specified here was being interpreted as a unit index. This is not helpful to applications because theoretically the unit index is an internal implementation detail so they can't reliably determine what it is. This patch changes them to be interpreted as layer indices instead. To make this work the enums in CoglPipelineCombineSource are no longer directly mapped to GLenums. Otherwise it implies a low limit on the number of layer indices because there are only 32 reserved numbers between GL_TEXTURE0 and GL_ACTIVE_TEXTURE. This also fixes a bug in the ARBfp fragend where it was generating code using the texture type of the layer doing the referencing rather than the layer that was being referenced. Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/cogl-pipeline-layer-private.h')
-rw-r--r--cogl/cogl-pipeline-layer-private.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/cogl/cogl-pipeline-layer-private.h b/cogl/cogl-pipeline-layer-private.h
index 6911b2be..4446224b 100644
--- a/cogl/cogl-pipeline-layer-private.h
+++ b/cogl/cogl-pipeline-layer-private.h
@@ -170,12 +170,14 @@ typedef enum
typedef enum
{
- /* These are the same values as GL */
- COGL_PIPELINE_COMBINE_SOURCE_TEXTURE = 0x1702,
- COGL_PIPELINE_COMBINE_SOURCE_CONSTANT = 0x8576,
- COGL_PIPELINE_COMBINE_SOURCE_PRIMARY_COLOR = 0x8577,
- COGL_PIPELINE_COMBINE_SOURCE_PREVIOUS = 0x8578,
- COGL_PIPELINE_COMBINE_SOURCE_TEXTURE0 = 0x84C0
+ /* Note that these numbers are deliberately not the same as the GL
+ numbers so that we can reserve all numbers > TEXTURE0 to store
+ very large layer numbers */
+ COGL_PIPELINE_COMBINE_SOURCE_TEXTURE,
+ COGL_PIPELINE_COMBINE_SOURCE_CONSTANT,
+ COGL_PIPELINE_COMBINE_SOURCE_PRIMARY_COLOR,
+ COGL_PIPELINE_COMBINE_SOURCE_PREVIOUS,
+ COGL_PIPELINE_COMBINE_SOURCE_TEXTURE0
} CoglPipelineCombineSource;
typedef enum