43 lines
1.6 KiB
Diff
43 lines
1.6 KiB
Diff
From e23cfbb2f0b9e52154401cb96118085811b62f09 Mon Sep 17 00:00:00 2001
|
|
From: Owen Taylor <otaylor@fresnel.(none)>
|
|
Date: Thu, 29 Apr 2010 19:47:56 -0400
|
|
Subject: [PATCH 1/3] Use a native format for atlas textures
|
|
|
|
Since we create frame buffer objects for atlas textures, we should use
|
|
a format that can be used as a rendering target. For this reason, use
|
|
an internal format of ARGB instead of RGBA when creating the texture.
|
|
|
|
(We don't actually render to it, but the Radeon Mesa drivers aren't
|
|
sophisticated enough to deal with a FBO that can be read from but
|
|
can't be rendered to. On other hardware, this is probably pretty much
|
|
neutral for efficiency.)
|
|
|
|
http://bugzilla.openedhand.com/show_bug.cgi?id=2100
|
|
--- clutter/cogl/cogl/cogl-atlas-texture.c~ 2010-08-12 07:30:06.000000000 -0400
|
|
+++ clutter/cogl/cogl/cogl-atlas-texture.c 2010-08-31 10:53:50.000000000 -0400
|
|
@@ -114,6 +114,15 @@
|
|
NULL);
|
|
}
|
|
|
|
+/* Best guess at native frame buffer formats; using these makes the
|
|
+ * Mesa framebuffer support happier on Radeon cards that can't
|
|
+ * render to arbitrarily ordered pixels */
|
|
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
|
+#define NATIVE_PIXEL_FORMAT COGL_PIXEL_FORMAT_BGRA_8888_PRE
|
|
+#else
|
|
+#define NATIVE_PIXEL_FORMAT COGL_PIXEL_FORMAT_ARGB_8888_PRE
|
|
+#endif
|
|
+
|
|
CoglAtlas *
|
|
_cogl_atlas_texture_get_atlas (void)
|
|
{
|
|
@@ -121,7 +130,7 @@
|
|
|
|
if (ctx->atlas == COGL_INVALID_HANDLE)
|
|
{
|
|
- ctx->atlas = _cogl_atlas_new (COGL_PIXEL_FORMAT_RGBA_8888,
|
|
+ ctx->atlas = _cogl_atlas_new (NATIVE_PIXEL_FORMAT,
|
|
0,
|
|
_cogl_atlas_texture_update_position_cb);
|
|
|