diff options
author | Neil Roberts <neil@linux.intel.com> | 2011-01-20 17:45:47 +0000 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2011-02-15 12:10:54 +0000 |
commit | c8ddb3b55a0a0f46f1c3068fd32dba3f4b198979 (patch) | |
tree | 7e0b2d48ab4b9913aae299d035021a16199a7130 /cogl/cogl-context.h | |
parent | 5ca053a3c151078ec7db1f18bc7ae537b6952ece (diff) | |
download | cogl-c8ddb3b55a0a0f46f1c3068fd32dba3f4b198979.tar.gz |
cogl-atlas: Try 4 different approaches for migrating textures
Instead of directly banging GL to migrate textures the atlas now uses
the CoglFramebuffer API. It will use one of four approaches; it can
set up two FBOs and use _cogl_blit_framebuffer to copy between them;
it can use a single target fbo and then render the source texture to
the FBO using a Cogl draw call; it can use a single FBO and call
glCopyTexSubImage2D; or it can fallback to reading all of the texture
data back to system memory and uploading it again with a sub texture
update.
Previously GL calls were used directly because Cogl wasn't able to
create a framebuffer without a stencil and depth buffer. However there
is now an internal version of cogl_offscreen_new_to_texture which
takes a set of flags to disable the two buffers.
The code for blitting has now been moved into a separate file called
cogl-blit.c because it has become quite long and it may be useful
outside of the atlas at some point.
The 4 different methods have a fixed order of preference which is:
* Texture render between two FBOs
* glBlitFramebuffer
* glCopyTexSubImage2D
* glGetTexImage + glTexSubImage2D
Once a method is succesfully used it is tried first for all subsequent
blits. The default default can be overridden by setting the
environment variable COGL_ATLAS_DEFAULT_BLIT_MODE to one of the
following values:
* texture-render
* framebuffer
* copy-tex-sub-image
* get-tex-data
Diffstat (limited to 'cogl/cogl-context.h')
-rw-r--r-- | cogl/cogl-context.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cogl/cogl-context.h b/cogl/cogl-context.h index 8c0161fa..eead5dc0 100644 --- a/cogl/cogl-context.h +++ b/cogl/cogl-context.h @@ -175,6 +175,7 @@ typedef struct gboolean in_begin_gl_block; CoglPipeline *texture_download_pipeline; + CoglPipeline *blit_texture_pipeline; GSList *atlases; |