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

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


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

Remove COGL_PIXEL_FORMAT_DEPTH_ANY. COGL_PIXEL_FORMAT_ANY can be used as
an internal format also in conjunction with depth formats so
COGL_PIXEL_FORMAT_DEPTH_ANY is redundant.

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 9d06bd7..4d4d35a 100644
--- a/cogl/cogl-bitmap-conversion.c
+++ b/cogl/cogl-bitmap-conversion.c
@@ -306,7 +306,6 @@ _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
      floats */
   switch (format)
     {
-    case COGL_PIXEL_FORMAT_DEPTH_ANY:
     case COGL_PIXEL_FORMAT_DEPTH_16:
     case COGL_PIXEL_FORMAT_DEPTH_24:
     case COGL_PIXEL_FORMAT_DEPTH_32:
diff --git a/cogl/cogl-bitmap-packing.h b/cogl/cogl-bitmap-packing.h
index aa79f05..181c502 100644
--- a/cogl/cogl-bitmap-packing.h
+++ b/cogl/cogl-bitmap-packing.h
@@ -370,7 +370,6 @@ G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
     case COGL_PIXEL_FORMAT_ABGR_2101010_PRE:
       G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (src, dst, width);
       break;
-    case COGL_PIXEL_FORMAT_DEPTH_ANY:
     case COGL_PIXEL_FORMAT_DEPTH_16:
     case COGL_PIXEL_FORMAT_DEPTH_24:
     case COGL_PIXEL_FORMAT_DEPTH_32:
@@ -716,7 +715,6 @@ G_PASTE (_cogl_pack_, component_type) (CoglPixelFormat format,
     case COGL_PIXEL_FORMAT_ABGR_2101010_PRE:
       G_PASTE (_cogl_pack_abgr_2101010_, component_type) (src, dst, width);
       break;
-    case COGL_PIXEL_FORMAT_DEPTH_ANY:
     case COGL_PIXEL_FORMAT_DEPTH_16:
     case COGL_PIXEL_FORMAT_DEPTH_24:
     case COGL_PIXEL_FORMAT_DEPTH_32:
diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h
index f7529ff..d86539c 100644
--- a/cogl/cogl-types.h
+++ b/cogl/cogl-types.h
@@ -311,7 +311,6 @@ typedef enum { /*< prefix=COGL_PIXEL_FORMAT >*/
   COGL_PIXEL_FORMAT_ARGB_2101010_PRE = (COGL_PIXEL_FORMAT_ARGB_2101010 | COGL_PREMULT_BIT),
   COGL_PIXEL_FORMAT_ABGR_2101010_PRE = (COGL_PIXEL_FORMAT_ABGR_2101010 | COGL_PREMULT_BIT),
 
-  COGL_PIXEL_FORMAT_DEPTH_ANY = (0 | COGL_DEPTH_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),
diff --git a/cogl/driver/gl/cogl-gl.c b/cogl/driver/gl/cogl-gl.c
index 58ce284..7ec437d 100644
--- a/cogl/driver/gl/cogl-gl.c
+++ b/cogl/driver/gl/cogl-gl.c
@@ -199,11 +199,6 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
       gltype = GL_UNSIGNED_SHORT_5_5_5_1;
       break;
 
-    case COGL_PIXEL_FORMAT_DEPTH_ANY:
-      glintformat = GL_DEPTH_COMPONENT;
-      glformat = GL_DEPTH_COMPONENT;
-      gltype = GL_UNSIGNED_BYTE;
-      break;
     case COGL_PIXEL_FORMAT_DEPTH_16:
       glintformat = GL_DEPTH_COMPONENT16;
       glformat = GL_DEPTH_COMPONENT;
diff --git a/cogl/driver/gles/cogl-gles.c b/cogl/driver/gles/cogl-gles.c
index c1440a6..599eb05 100644
--- a/cogl/driver/gles/cogl-gles.c
+++ b/cogl/driver/gles/cogl-gles.c
@@ -144,11 +144,6 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
       gltype = GL_UNSIGNED_SHORT_5_5_5_1;
       break;
 
-    case COGL_PIXEL_FORMAT_DEPTH_ANY:
-      glintformat = GL_DEPTH_COMPONENT;
-      glformat = GL_DEPTH_COMPONENT;
-      gltype = GL_UNSIGNED_BYTE;
-      break;
     case COGL_PIXEL_FORMAT_DEPTH_16:
       glintformat = GL_DEPTH_COMPONENT;
       glformat = GL_DEPTH_COMPONENT;
-- 
1.7.7.6



More information about the Cogl mailing list