diff options
author | Neil Roberts <neil@linux.intel.com> | 2010-09-15 14:07:30 +0100 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2010-09-15 14:28:44 +0100 |
commit | a433bd8e9e732016e03ced0bc7ab57ee44c54620 (patch) | |
tree | 06e8d5a5bb05c7a2286480dbc8ae202012f39248 /cogl/cogl-vertex-buffer.c | |
parent | 91b46890f776171afcfa6187b3dcfbe13d353214 (diff) | |
download | cogl-a433bd8e9e732016e03ced0bc7ab57ee44c54620.tar.gz |
cogl-vertex-buffer: Don't always set COGL_MATERIAL_FLUSH_FALLBACK_MASK
Previously CoglVertexBuffer would always set the flush options flags
to at least contain COGL_MATERIAL_FLUSH_FALLBACK_MASK. The code then
later checks whether any flags are set before deciding whether to copy
the material to implement the overrides. This means that it would
always end up copying the material even if there are no fallback
layers. This patch changes it so that it only sets
COGL_MATERIAL_FLUSH_FALLBACK_MASK if fallback_layers != 0.
Diffstat (limited to 'cogl/cogl-vertex-buffer.c')
-rw-r--r-- | cogl/cogl-vertex-buffer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cogl/cogl-vertex-buffer.c b/cogl/cogl-vertex-buffer.c index 24e21040..65f275a6 100644 --- a/cogl/cogl-vertex-buffer.c +++ b/cogl/cogl-vertex-buffer.c @@ -1533,8 +1533,7 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer) if (buffer->new_attributes) cogl_vertex_buffer_submit_real (buffer); - options.flags = - COGL_MATERIAL_FLUSH_FALLBACK_MASK; + options.flags = 0; memset (&options.wrap_mode_overrides, 0, sizeof (options.wrap_mode_overrides)); @@ -1737,7 +1736,11 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer) /* Disable any tex coord arrays that we didn't use */ _cogl_disable_other_texcoord_arrays (&ctx->temp_bitmask); - options.fallback_layers = fallback_layers; + if (fallback_layers) + { + options.fallback_layers = fallback_layers; + options.flags |= COGL_MATERIAL_FLUSH_FALLBACK_MASK; + } if (G_UNLIKELY (options.flags)) { |