diff options
author | Robert Bragg <robert@linux.intel.com> | 2013-06-27 03:11:47 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2013-11-29 23:18:07 +0000 |
commit | 2622fdf008ada0833f2b3d8fe33bbc0aeef0a1dd (patch) | |
tree | ed788988ff3e659ec60803b278bc8743c6695de8 | |
parent | f9ff28a068b362d12fe3123b62f6ece48e8bc9f8 (diff) | |
download | cogl-2622fdf008ada0833f2b3d8fe33bbc0aeef0a1dd.tar.gz |
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.
-rw-r--r-- | cogl/cogl-framebuffer.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index 626e8b36..b7a3441e 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -681,6 +681,11 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer, 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)) { _cogl_set_error (error, COGL_SYSTEM_ERROR, @@ -690,9 +695,6 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer, return FALSE; } - if (!cogl_texture_allocate (offscreen->texture, error)) - return FALSE; - /* Forward the texture format as the internal format of the * framebuffer */ framebuffer->internal_format = |