mutter/cogl
Robert Bragg 1cc3ae6944 CoglMaterial: Implements sparse materials design
This is a complete overhaul of the data structures used to manage
CoglMaterial state.

We have these requirements that were aiming to meet:
(Note: the references to "renderlists" correspond to the effort to
support scenegraph level shuffling of Clutter actor primitives so we can
minimize GPU state changes)

Sparse State:
We wanted a design that allows sparse descriptions of state so it scales
well as we make CoglMaterial responsible for more and more state. It
needs to scale well in terms of memory usage and the cost of operations
we need to apply to materials such as comparing, copying and flushing
their state. I.e. we would rather have these things scale by the number
of real changes a material represents not by how much overall state
CoglMaterial becomes responsible for.

Cheap Copies:
As we add support for renderlists in Clutter we will need to be able to
get an immutable handle for a given material's current state so that we
can retain a record of a primitive with its associated material without
worrying that changes to the original material will invalidate that
record.

No more flush override options:
We want to get rid of the flush overrides mechanism we currently use to
deal with texture fallbacks, wrap mode changes and to handle the use of
highlevel CoglTextures that need to be resolved into lowlevel textures
before flushing the material state.

The flush options structure has been expanding in size and the structure
is logged with every journal entry so it is not an approach that scales
well at all. It also makes flushing material state that much more
complex.

Weak Materials:
Again for renderlists we need a way to create materials derived from
other materials but without the strict requirement that modifications to
the original material wont affect the derived ("weak") material. The
only requirement is that its possible to later check if the original
material has been changed.

A summary of the new design:

A CoglMaterial now basically represents a diff against its parent.
Each material has a single parent and a mask of state that it changes.

Each group of state (such as the blending state) has an "authority"
which is found by walking up from a given material through its ancestors
checking the difference mask until a match for that group is found.

There is only one root node to the graph of all materials, which is the
default material first created when Cogl is being initialized.

All the groups of state are divided into two types, such that
infrequently changed state belongs in a separate "BigState" structure
that is only allocated and attached to a material when necessary.

CoglMaterialLayers are another sparse structure. Like CoglMaterials they
represent a diff against their parent and all the layers are part of
another graph with the "default_layer_0" layer being the root node that
Cogl creates during initialization.

Copying a material is now basically just a case of slice allocating a
CoglMaterial, setting the parent to be the source being copied and
zeroing the mask of changes.

Flush overrides should now be handled by simply relying on the cheapness
of copying a material and making changes to it. (This will be done in a
follow on commit)

Weak material support will be added in a follow on commit.
2010-06-15 15:26:27 +01:00
..
driver cogl-program: Add cogl_program_uniform_1i to GLES 2010-06-11 16:06:31 +01:00
winsys cogl/winsys/cogl-eglx: Use the right egl header on 1.1 2010-06-11 16:06:31 +01:00
cogl-atlas-texture-private.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-atlas-texture.c CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-atlas.c Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-atlas.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-bitmap-fallback.c cogl-bitmap: Fix converting formats with and without alpha channels 2010-04-21 10:56:21 +01:00
cogl-bitmap-pixbuf.c Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-bitmap-private.h bitmap: Remove use of CoglHandle in the CoglBitmap API 2010-06-01 12:20:59 +01:00
cogl-bitmap.c bitmap: Remove use of CoglHandle in the CoglBitmap API 2010-06-01 12:20:59 +01:00
cogl-bitmap.h bitmap: Remove use of CoglHandle in the CoglBitmap API 2010-06-01 12:20:59 +01:00
cogl-bitmask.c cogl: Add an internal CoglBitmask type 2010-05-24 16:10:56 +01:00
cogl-bitmask.h cogl: Add an internal CoglBitmask type 2010-05-24 16:10:56 +01:00
cogl-blend-string.c blend-strings: removes the AUTO_COMPOSITE function enum 2010-06-15 15:26:27 +01:00
cogl-blend-string.h blend-strings: removes the AUTO_COMPOSITE function enum 2010-06-15 15:26:27 +01:00
cogl-buffer-private.h buffer: Remove use of CoglHandle in the CoglBuffer API 2010-05-28 18:42:33 +01:00
cogl-buffer.c material: Adds backend abstraction for fragment processing 2010-06-09 17:15:59 +01:00
cogl-buffer.h buffer: Remove use of CoglHandle in the CoglBuffer API 2010-05-28 18:42:33 +01:00
cogl-clip-stack.c cogl-clip-stack: Always use the scissor when clipping 2010-06-10 21:52:55 +01:00
cogl-clip-stack.h clip_stack: Remove use of CoglHandle in the CoglClipStack API 2010-06-01 12:20:59 +01:00
cogl-clip-state.c cogl-clip-state: Export transform_point internally to Cogl 2010-06-10 21:52:49 +01:00
cogl-clip-state.h cogl: Implement retained clip stacks 2010-04-15 14:51:01 +01:00
cogl-color-private.h cogl-color: add private _cogl_color_get_rgba_4ubv API 2010-06-15 15:26:27 +01:00
cogl-color.c cogl-color: add cogl_color_init_from_xyz funcs 2010-06-15 15:26:27 +01:00
cogl-color.h cogl-color: add cogl_color_init_from_xyz funcs 2010-06-15 15:26:27 +01:00
cogl-context.c CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-context.h CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-debug.c CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-debug.h CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-deprecated.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-enum-types.c.in Intial Re-layout of the Cogl source code and introduction of a Cogl Winsys 2009-10-16 18:58:50 +01:00
cogl-enum-types.h.in Intial Re-layout of the Cogl source code and introduction of a Cogl Winsys 2009-10-16 18:58:50 +01:00
cogl-feature-private.c Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-feature-private.h cogl: Introduce private feature flags and check for ARB_fp 2010-06-09 15:19:30 +01:00
cogl-fixed.c Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-fixed.h analysis: Fix some CoglFixed API 2010-06-01 12:08:18 +01:00
cogl-framebuffer-private.h Implement accessors for the color bits in a framebuffer 2010-05-05 12:25:16 +01:00
cogl-framebuffer.c cogl: Initialize the framebuffer bits on state flush 2010-06-10 19:55:18 +01:00
cogl-handle.h CoglObject: Adds cogl_object_{get,set}_user_data 2010-06-04 14:44:15 +01:00
cogl-internal.h CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-journal-private.h cogl-material: Add support for setting the wrap mode for a layer 2010-04-12 15:44:23 +01:00
cogl-journal.c CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-material-private.h CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-material.c CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-material.h CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-matrix-mesa.c Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-matrix-mesa.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-matrix-private.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-matrix-stack.c Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-matrix-stack.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-matrix.c matrix: add cogl_matrix_equal API 2010-06-09 15:19:31 +01:00
cogl-matrix.h matrix: add cogl_matrix_equal API 2010-06-09 15:19:31 +01:00
cogl-object-private.h cogl-object-private.h: white space cleanup 2010-06-04 14:44:15 +01:00
cogl-object.c CoglObject: Adds cogl_object_{get,set}_user_data 2010-06-04 14:44:15 +01:00
cogl-object.h CoglObject: Adds a COGL_OBJECT macro for casting 2010-06-04 14:44:15 +01:00
cogl-offscreen.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-path-private.h cogl-path: Export _cogl_path_get_bounds 2010-06-10 21:52:54 +01:00
cogl-path.c CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-path.h cogl-path: Adds missing cogl_is_path prototype 2010-06-04 14:44:15 +01:00
cogl-pixel-buffer-private.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-pixel-buffer.c material: Adds backend abstraction for fragment processing 2010-06-09 17:15:59 +01:00
cogl-pixel-buffer.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-primitives.c CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-primitives.h Use begin/end macros in cogl-primitives.h 2010-03-25 09:33:26 +00:00
cogl-profile.c profiling: Adds initial UProf accounting to Cogl 2010-01-08 20:19:50 +00:00
cogl-profile.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-shader.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-spans.c Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-spans.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-sub-texture-private.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-sub-texture.c material: Avoid redundant glBindTexture calls 2010-06-09 17:26:15 +01:00
cogl-texture-2d-private.h Split the wrap mode of _cogl_texture_set_wrap_mode into three 2010-04-12 15:44:23 +01:00
cogl-texture-2d-sliced-private.h Split the wrap mode of _cogl_texture_set_wrap_mode into three 2010-04-12 15:44:23 +01:00
cogl-texture-2d-sliced.c cogl_texture_get_data() copies using wrong width size. 2010-06-10 20:58:22 +01:00
cogl-texture-2d.c material: Avoid redundant glBindTexture calls 2010-06-09 17:26:15 +01:00
cogl-texture-driver.h material: Avoid redundant glBindTexture calls 2010-06-09 17:26:15 +01:00
cogl-texture-private.h material: Avoid redundant glBindTexture calls 2010-06-09 17:26:15 +01:00
cogl-texture.c material: Avoid redundant glBindTexture calls 2010-06-09 17:26:15 +01:00
cogl-texture.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-types.h doc: Some fixes for the Cogl documentation 2010-06-07 14:32:32 +01:00
cogl-util.c CoglObject: Adds cogl_object_{get,set}_user_data 2010-06-04 14:44:15 +01:00
cogl-util.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-vector.c math: Adds an experimental cogl_vector3_* API 2010-05-20 17:18:24 +01:00
cogl-vector.h math: Adds an experimental cogl_vector3_* API 2010-05-20 17:18:24 +01:00
cogl-vertex-buffer-private.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl-vertex-buffer.c CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl-vertex-buffer.h Remove mentions of the FSF address 2010-03-01 12:56:10 +00:00
cogl.c CoglMaterial: Implements sparse materials design 2010-06-15 15:26:27 +01:00
cogl.h cogl: Hide cogl_framebuffer_get_*_bits() 2010-06-10 19:06:37 +01:00
cogl.pc.in Intial Re-layout of the Cogl source code and introduction of a Cogl Winsys 2009-10-16 18:58:50 +01:00
Makefile.am build: Don't distribute clutter-version.h and cogl-defines.h 2010-06-04 17:43:57 +01:00
stb_image.c Update stb_image.c 2010-03-03 17:02:51 +00:00