diff options
author | Brian Paul <[email protected]> | 2012-01-16 13:02:19 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-01-24 14:12:32 -0700 |
commit | 0c1862851f27c428a18ba5509636efcc2f0084f8 (patch) | |
tree | 29052f5a725fab48742c42fc7807f0ed37588d5c /src/mesa/swrast/s_depth.c | |
parent | 797c18be1f907337ebd85b18ce43dfa0b056f492 (diff) |
swrast: use swrast_renderbuffer instead of gl_renderbuffer
Diffstat (limited to 'src/mesa/swrast/s_depth.c')
-rw-r--r-- | src/mesa/swrast/s_depth.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 0788644b76d..1336407c4b7 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -212,12 +212,13 @@ get_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], GLuint zbuffer[]) { + struct swrast_renderbuffer *srb = swrast_renderbuffer(rb); const GLint w = rb->Width, h = rb->Height; const GLubyte *map = _swrast_pixel_address(rb, 0, 0); GLuint i; if (rb->Format == MESA_FORMAT_Z32) { - const GLint rowStride = rb->RowStrideBytes; + const GLint rowStride = srb->RowStride; for (i = 0; i < count; i++) { if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) { zbuffer[i] = *((GLuint *) (map + y[i] * rowStride + x[i] * 4)); @@ -226,7 +227,7 @@ get_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb, } else { const GLint bpp = _mesa_get_format_bytes(rb->Format); - const GLint rowStride = rb->RowStrideBytes; + const GLint rowStride = srb->RowStride; for (i = 0; i < count; i++) { if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) { const GLubyte *src = map + y[i] * rowStride+ x[i] * bpp; @@ -246,12 +247,13 @@ put_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], const GLuint zvalues[], const GLubyte mask[]) { + struct swrast_renderbuffer *srb = swrast_renderbuffer(rb); const GLint w = rb->Width, h = rb->Height; GLubyte *map = _swrast_pixel_address(rb, 0, 0); GLuint i; if (rb->Format == MESA_FORMAT_Z32) { - const GLuint rowStride = rb->RowStrideBytes; + const GLuint rowStride = srb->RowStride; for (i = 0; i < count; i++) { if (mask[i] && x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) { GLuint *dst = (GLuint *) (map + y[i] * rowStride + x[i] * 4); @@ -262,7 +264,7 @@ put_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb, else { gl_pack_uint_z_func packZ = _mesa_get_pack_uint_z_func(rb->Format); const GLint bpp = _mesa_get_format_bytes(rb->Format); - const GLint rowStride = rb->RowStrideBytes; + const GLint rowStride = srb->RowStride; for (i = 0; i < count; i++) { if (mask[i] && x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) { void *dst = map + y[i] * rowStride + x[i] * bpp; |