[Cogl] [PATCH 6/8] tweak: Support retrieving depth textures from framebuffers

Robert Bragg robert at sixbynine.org
Thu Sep 6 09:29:34 PDT 2012


From: Robert Bragg <robert at linux.intel.com>

Remove COGL_PIXEL_FORMAT_DEPTH_24 since GL doesn't give us a way to load
packed 3byte-per-pixel integers so we can't make this format work like
other CoglPixelFormats which are used to represent the layout of system
memory data.

Although CoglPixelFormats do currently get overloaded to represent
"internal formats" which is what this particular format is really
intended as we should wait until we create a separate CoglInternalFormat
enum to enable applications to specify a minimum precision for the depth
component internally.

TODO: fold this patch into original
---
 cogl/cogl-bitmap-conversion.c |    1 -
 cogl/cogl-bitmap-packing.h    |    2 --
 cogl/cogl-types.h             |    1 -
 cogl/driver/gl/cogl-gl.c      |    5 -----
 cogl/driver/gles/cogl-gles.c  |    5 -----
 5 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/cogl/cogl-bitmap-conversion.c b/cogl/cogl-bitmap-conversion.c
index 4d4d35a..ca611ee 100644
--- a/cogl/cogl-bitmap-conversion.c
+++ b/cogl/cogl-bitmap-conversion.c
@@ -307,7 +307,6 @@ _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
   switch (format)
     {
     case COGL_PIXEL_FORMAT_DEPTH_16:
-    case COGL_PIXEL_FORMAT_DEPTH_24:
     case COGL_PIXEL_FORMAT_DEPTH_32:
     case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8:
     case COGL_PIXEL_FORMAT_ANY:
diff --git a/cogl/cogl-bitmap-packing.h b/cogl/cogl-bitmap-packing.h
index 181c502..d2fc4fb 100644
--- a/cogl/cogl-bitmap-packing.h
+++ b/cogl/cogl-bitmap-packing.h
@@ -371,7 +371,6 @@ G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
       G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_DEPTH_16:
-    case COGL_PIXEL_FORMAT_DEPTH_24:
     case COGL_PIXEL_FORMAT_DEPTH_32:
     case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8:
     case COGL_PIXEL_FORMAT_ANY:
@@ -716,7 +715,6 @@ G_PASTE (_cogl_pack_, component_type) (CoglPixelFormat format,
       G_PASTE (_cogl_pack_abgr_2101010_, component_type) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_DEPTH_16:
-    case COGL_PIXEL_FORMAT_DEPTH_24:
     case COGL_PIXEL_FORMAT_DEPTH_32:
     case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8:
     case COGL_PIXEL_FORMAT_ANY:
diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h
index d86539c..f24b987 100644
--- a/cogl/cogl-types.h
+++ b/cogl/cogl-types.h
@@ -312,7 +312,6 @@ typedef enum { /*< prefix=COGL_PIXEL_FORMAT >*/
   COGL_PIXEL_FORMAT_ABGR_2101010_PRE = (COGL_PIXEL_FORMAT_ABGR_2101010 | COGL_PREMULT_BIT),
 
   COGL_PIXEL_FORMAT_DEPTH_16  = (9 | COGL_DEPTH_BIT),
-  COGL_PIXEL_FORMAT_DEPTH_24  = (2 | COGL_DEPTH_BIT),
   COGL_PIXEL_FORMAT_DEPTH_32  = (3 | COGL_DEPTH_BIT),
 
   COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8 = (3 | COGL_DEPTH_BIT | COGL_STENCIL_BIT)
diff --git a/cogl/driver/gl/cogl-gl.c b/cogl/driver/gl/cogl-gl.c
index 7ec437d..e734805 100644
--- a/cogl/driver/gl/cogl-gl.c
+++ b/cogl/driver/gl/cogl-gl.c
@@ -204,11 +204,6 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
       glformat = GL_DEPTH_COMPONENT;
       gltype = GL_UNSIGNED_SHORT;
       break;
-    case COGL_PIXEL_FORMAT_DEPTH_24:
-      glintformat = GL_DEPTH_COMPONENT24;
-      glformat = GL_DEPTH_COMPONENT;
-      gltype = GL_UNSIGNED_INT;
-      break;
     case COGL_PIXEL_FORMAT_DEPTH_32:
       glintformat = GL_DEPTH_COMPONENT32;
       glformat = GL_DEPTH_COMPONENT;
diff --git a/cogl/driver/gles/cogl-gles.c b/cogl/driver/gles/cogl-gles.c
index 599eb05..d0c96b8 100644
--- a/cogl/driver/gles/cogl-gles.c
+++ b/cogl/driver/gles/cogl-gles.c
@@ -149,11 +149,6 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
       glformat = GL_DEPTH_COMPONENT;
       gltype = GL_UNSIGNED_SHORT;
       break;
-    case COGL_PIXEL_FORMAT_DEPTH_24:
-      glintformat = GL_DEPTH_COMPONENT;
-      glformat = GL_DEPTH_COMPONENT;
-      gltype = GL_UNSIGNED_INT;
-      break;
     case COGL_PIXEL_FORMAT_DEPTH_32:
       glintformat = GL_DEPTH_COMPONENT;
       glformat = GL_DEPTH_COMPONENT;
-- 
1.7.7.6



More information about the Cogl mailing list