mirror of
https://github.com/brl/mutter.git
synced 2025-02-24 08:54:08 +00:00
cogl: Create CoglTextureUnit with its associated unit number
The index field of CoglTextureUnit was never set, leading to the creation of units with index set to 0. When trying to retrieve a texture unit by its index (!= 0) with _cogl_get_texture_unit(), a new one was created as it could not find it back in the list of textures units: ctx->texture_units. http://bugzilla.openedhand.com/show_bug.cgi?id=1958
This commit is contained in:
parent
8fc07c51a9
commit
06d8ebb0ba
@ -729,10 +729,11 @@ cogl_end_gl (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static CoglTextureUnit *
|
static CoglTextureUnit *
|
||||||
_cogl_texture_unit_new (void)
|
_cogl_texture_unit_new (int index_)
|
||||||
{
|
{
|
||||||
CoglTextureUnit *unit = g_new0 (CoglTextureUnit, 1);
|
CoglTextureUnit *unit = g_new0 (CoglTextureUnit, 1);
|
||||||
unit->matrix_stack = _cogl_matrix_stack_new ();
|
unit->matrix_stack = _cogl_matrix_stack_new ();
|
||||||
|
unit->index = index_;
|
||||||
return unit;
|
return unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,7 +767,7 @@ _cogl_get_texture_unit (int index_)
|
|||||||
/* NB: if we now insert a new layer before l, that will maintain order.
|
/* NB: if we now insert a new layer before l, that will maintain order.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unit = _cogl_texture_unit_new ();
|
unit = _cogl_texture_unit_new (index_);
|
||||||
|
|
||||||
/* Note: see comment after for() loop above */
|
/* Note: see comment after for() loop above */
|
||||||
ctx->texture_units =
|
ctx->texture_units =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user