offscreen: allocate texture before querying slicing

Since we are planning on deferring more texture allocation work this
makes sure we don't query whether a texture is sliced until we know it
has been allocated.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit b742638a1ce581f5a2c9f15907361c3b0c1b178c)
This commit is contained in:
Robert Bragg 2013-06-27 03:11:47 +01:00
parent 2e61318914
commit a07d26e9ae

View File

@ -734,6 +734,11 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
return FALSE; return FALSE;
} }
if (!cogl_texture_allocate (offscreen->texture, error))
return FALSE;
/* NB: it's only after allocating the texture that we will
* determine whether a texture needs slicing... */
if (cogl_texture_is_sliced (offscreen->texture)) if (cogl_texture_is_sliced (offscreen->texture))
{ {
_cogl_set_error (error, COGL_SYSTEM_ERROR, _cogl_set_error (error, COGL_SYSTEM_ERROR,
@ -743,9 +748,6 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
return FALSE; return FALSE;
} }
if (!cogl_texture_allocate (offscreen->texture, error))
return FALSE;
/* Forward the texture format as the internal format of the /* Forward the texture format as the internal format of the
* framebuffer */ * framebuffer */
framebuffer->internal_format = framebuffer->internal_format =