material: Adds backend abstraction for fragment processing
authorRobert Bragg <robert@linux.intel.com>
Mon, 26 Apr 2010 09:01:43 +0000 (10:01 +0100)
committerRobert Bragg <robert@linux.intel.com>
Wed, 9 Jun 2010 16:15:59 +0000 (17:15 +0100)
commitce6e80315e17f2e671e2709268f580add757f596
treedca90d14c3819c40ca9ec392881f40867dc08423
parent8cee3c867095aacdec152842f01dc2fca1fc43aa
material: Adds backend abstraction for fragment processing

As part of an effort to improve the architecture of CoglMaterial
internally this overhauls how we flush layer state to OpenGL by adding a
formal backend abstraction for fragment processing and further
formalizing the CoglTextureUnit abstraction.

There are three backends: "glsl", "arbfp" and "fixed". The fixed backend
uses the OpenGL fixed function APIs to setup the fragment processing,
the arbfp backend uses code generation to handle fragment processing
using an ARBfp program, and the GLSL backend is currently only there as
a formality to handle user programs associated with a material. (i.e.
the glsl backend doesn't yet support code generation)

The GLSL backend has highest precedence, then arbfp and finally the
fixed. If a backend can't support some particular CoglMaterial feature
then it will fallback to the next backend.

This adds three new COGL_DEBUG options:
* "disable-texturing" as expected should disable all texturing
* "disable-arbfp" always make the arbfp backend fallback
* "disable-glsl" always make the glsl backend fallback
* "show-source" show code generated by the arbfp/glsl backends
20 files changed:
clutter/cogl/cogl/cogl-buffer.c
clutter/cogl/cogl/cogl-context.c
clutter/cogl/cogl/cogl-context.h
clutter/cogl/cogl/cogl-debug.c
clutter/cogl/cogl/cogl-debug.h
clutter/cogl/cogl/cogl-internal.h
clutter/cogl/cogl/cogl-journal.c
clutter/cogl/cogl/cogl-material-private.h
clutter/cogl/cogl/cogl-material.c
clutter/cogl/cogl/cogl-path.c
clutter/cogl/cogl/cogl-pixel-buffer.c
clutter/cogl/cogl/cogl-primitives.c
clutter/cogl/cogl/cogl-vertex-buffer.c
clutter/cogl/cogl/cogl.c
clutter/cogl/cogl/driver/gl/cogl-context-driver.h
clutter/cogl/cogl/driver/gl/cogl-feature-functions.h
clutter/cogl/cogl/driver/gl/cogl-program.c
clutter/cogl/cogl/driver/gl/cogl-program.h
clutter/cogl/cogl/driver/gl/cogl-shader.c
clutter/cogl/cogl/driver/gles/cogl-program.c