summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-16 10:55:32 -0700
committerIan Romanick <[email protected]>2012-01-27 17:43:22 -0800
commitc8562a6ed39287582c4a484e19c4efd62dd5df2f (patch)
treeac1f50eefb986a06c644290aa5984a1076650194 /src/mesa/swrast
parent48173180b55241d0536999a90a3c1a000ce35500 (diff)
swrast: use gl_renderbuffer::StrideInBytes in depth/stencil code
(cherry picked from commit b766d4bb43b2c8271413c1efafe3590fa75efc3c)
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_depth.c8
-rw-r--r--src/mesa/swrast/s_stencil.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 440c43ffa41..0788644b76d 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -217,7 +217,7 @@ get_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint i;
if (rb->Format == MESA_FORMAT_Z32) {
- const GLint rowStride = rb->RowStride * 4;
+ const GLint rowStride = rb->RowStrideBytes;
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 +226,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->RowStride * bpp;
+ const GLint rowStride = rb->RowStrideBytes;
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;
@@ -251,7 +251,7 @@ put_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint i;
if (rb->Format == MESA_FORMAT_Z32) {
- const GLuint rowStride = rb->RowStride * 4;
+ const GLuint rowStride = rb->RowStrideBytes;
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 +262,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->RowStride * bpp;
+ const GLint rowStride = rb->RowStrideBytes;
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;
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index 98af928208c..005423e836c 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -297,7 +297,7 @@ get_s8_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint i;
if (rb->Format == MESA_FORMAT_S8) {
- const GLint rowStride = rb->RowStride;
+ const GLint rowStride = rb->RowStrideBytes;
for (i = 0; i < count; i++) {
if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
stencil[i] = *(map + y[i] * rowStride + x[i]);
@@ -306,7 +306,7 @@ get_s8_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
}
else {
const GLint bpp = _mesa_get_format_bytes(rb->Format);
- const GLint rowStride = rb->RowStride * bpp;
+ const GLint rowStride = rb->RowStrideBytes;
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;