[Mesa-dev] [PATCH 19/24] swrast: Remove dead _swrast_read_depth_span_uint().

Eric Anholt eric at anholt.net
Fri Oct 28 12:50:09 PDT 2011


All the code using it is converted to MapRenderbuffer and the core
unpack functions.
---
 src/mesa/swrast/s_depth.c |   83 ---------------------------------------------
 src/mesa/swrast/s_depth.h |    5 ---
 2 files changed, 0 insertions(+), 88 deletions(-)

diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 58440cb..6ffa0a3 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -1313,89 +1313,6 @@ _swrast_read_depth_span_float( struct gl_context *ctx, struct gl_renderbuffer *r
    }
 }
 
-
-/**
- * As above, but return 32-bit GLuint values.
- */
-void
-_swrast_read_depth_span_uint( struct gl_context *ctx, struct gl_renderbuffer *rb,
-                              GLint n, GLint x, GLint y, GLuint depth[] )
-{
-   GLuint depthBits;
-
-   if (!rb) {
-      /* really only doing this to prevent FP exceptions later */
-      memset(depth, 0, n * sizeof(GLuint));
-      return;
-   }
-
-   depthBits = _mesa_get_format_bits(rb->Format, GL_DEPTH_BITS);
-
-   ASSERT(rb->_BaseFormat == GL_DEPTH_COMPONENT);
-
-   if (y < 0 || y >= (GLint) rb->Height ||
-       x + n <= 0 || x >= (GLint) rb->Width) {
-      /* span is completely outside framebuffer */
-      memset(depth, 0, n * sizeof(GLfloat));
-      return;
-   }
-
-   if (x < 0) {
-      GLint dx = -x;
-      GLint i;
-      for (i = 0; i < dx; i++)
-         depth[i] = 0;
-      x = 0;
-      n -= dx;
-      depth += dx;
-   }
-   if (x + n > (GLint) rb->Width) {
-      GLint dx = x + n - (GLint) rb->Width;
-      GLint i;
-      for (i = 0; i < dx; i++)
-         depth[n - i - 1] = 0;
-      n -= dx;
-   }
-   if (n <= 0) {
-      return;
-   }
-
-   if (rb->DataType == GL_UNSIGNED_INT) {
-      rb->GetRow(ctx, rb, n, x, y, depth);
-      if (depthBits < 32) {
-         GLuint shift = 32 - depthBits;
-         GLint i;
-         for (i = 0; i < n; i++) {
-            GLuint z = depth[i];
-            depth[i] = z << shift; /* XXX lsb bits? */
-         }
-      }
-   }
-   else if (rb->DataType == GL_UNSIGNED_SHORT) {
-      GLushort temp[MAX_WIDTH];
-      GLint i;
-      rb->GetRow(ctx, rb, n, x, y, temp);
-      if (depthBits == 16) {
-         for (i = 0; i < n; i++) {
-            GLuint z = temp[i];
-            depth[i] = (z << 16) | z;
-         }
-      }
-      else {
-         GLuint shift = 16 - depthBits;
-         for (i = 0; i < n; i++) {
-            GLuint z = temp[i];
-            depth[i] = (z << (shift + 16)) | (z << shift); /* XXX lsb bits? */
-         }
-      }
-   }
-   else {
-      _mesa_problem(ctx, "Invalid depth renderbuffer data type");
-   }
-}
-
-
-
 /**
  * Clear the given z/depth renderbuffer.
  */
diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h
index 8d5cdfa..2caea82 100644
--- a/src/mesa/swrast/s_depth.h
+++ b/src/mesa/swrast/s_depth.h
@@ -48,11 +48,6 @@ extern void
 _swrast_read_depth_span_float( struct gl_context *ctx, struct gl_renderbuffer *rb,
                                GLint n, GLint x, GLint y, GLfloat depth[] );
 
-
-extern void
-_swrast_read_depth_span_uint( struct gl_context *ctx, struct gl_renderbuffer *rb,
-                              GLint n, GLint x, GLint y, GLuint depth[] );
-
 extern void
 _swrast_clear_depth_buffer( struct gl_context *ctx, struct gl_renderbuffer *rb );
 
-- 
1.7.7



More information about the mesa-dev mailing list