diff options
author | Robert Bragg <robert@linux.intel.com> | 2013-06-27 03:11:47 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2014-01-01 17:43:05 +0000 |
commit | b742638a1ce581f5a2c9f15907361c3b0c1b178c (patch) | |
tree | add2ff570dd57f84c99b74e5cd906dab5aa7ff7b | |
parent | 8cc9e1c8bd2fac8b2a95087249c23c952d5e379f (diff) | |
download | cogl-b742638a1ce581f5a2c9f15907361c3b0c1b178c.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.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
-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 9ce2725a..24004f72 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -678,6 +678,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, @@ -687,9 +692,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 = |