diff options
author | Brian Paul <[email protected]> | 2012-01-16 10:55:25 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-01-24 14:12:14 -0700 |
commit | 7d1ddec92168e9b6ead0da80b18364a75f9a85e6 (patch) | |
tree | b6ea2d9bad4e6401f9dda0b205484a4759bdabb4 /src/mesa/drivers | |
parent | 14da67d9b9b9e30740ef1687c3952a0b5e8b0a54 (diff) |
mesa: use gl_renderbuffer::Map for all depth/stencil accesses
Instead of using the obsolete gl_renderbuffer::Data field.
Color buffer are still accessed through GetRow/PutRow().
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_span.c | 14 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_span.c | 10 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index d4d3bf970dd..506c295ec7d 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -60,8 +60,8 @@ intel_set_span_functions(struct intel_context *intel, int minx = 0, miny = 0; \ int maxx = rb->Width; \ int maxy = rb->Height; \ - int pitch = rb->RowStride * irb->mt->region->cpp; \ - void *buf = rb->Data; \ + int pitch = rb->RowStrideBytes; \ + void *buf = rb->Map; \ GLuint p; \ (void) p; @@ -189,7 +189,7 @@ intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb) if (!irb) return; - if (rb->Data) { + if (rb->Map) { /* Renderbuffer is already mapped. This usually happens when a single * buffer is attached to the framebuffer's depth and stencil attachment * points. @@ -200,8 +200,9 @@ intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb) ctx->Driver.MapRenderbuffer(ctx, rb, 0, 0, rb->Width, rb->Height, GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, &map, &stride); - rb->Data = map; + rb->Map = map; rb->RowStride = stride / _mesa_get_format_bytes(rb->Format); + rb->RowStrideBytes = stride; intel_set_span_functions(intel, rb); } @@ -216,7 +217,7 @@ intel_renderbuffer_unmap(struct intel_context *intel, if (!irb) return; - if (!rb->Data) { + if (!rb->Map) { /* Renderbuffer is already unmapped. This usually happens when a single * buffer is attached to the framebuffer's depth and stencil attachment * points. @@ -228,8 +229,9 @@ intel_renderbuffer_unmap(struct intel_context *intel, rb->GetRow = NULL; rb->PutRow = NULL; - rb->Data = NULL; + rb->Map = NULL; rb->RowStride = 0; + rb->RowStrideBytes = 0; } static void diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index e3bdc36f954..569aca92ce4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -74,8 +74,8 @@ static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb); int minx = 0, miny = 0; \ int maxx = rb->Width; \ int maxy = rb->Height; \ - void *buf = rb->Data; \ - int pitch = rb->RowStride * rrb->cpp; \ + void *buf = rb->Map; \ + int pitch = rb->RowStrideBytes; \ GLuint p; \ (void)p; @@ -178,8 +178,9 @@ radeon_renderbuffer_map(struct gl_context *ctx, struct gl_renderbuffer *rb) GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, &map, &stride); - rb->Data = map; + rb->Map = map; rb->RowStride = stride / _mesa_get_format_bytes(rb->Format); + rb->RowStrideBytes = stride; radeonSetSpanFunctions(rrb); } @@ -195,8 +196,9 @@ radeon_renderbuffer_unmap(struct gl_context *ctx, struct gl_renderbuffer *rb) rb->GetRow = NULL; rb->PutRow = NULL; - rb->Data = NULL; + rb->Map = NULL; rb->RowStride = 0; + rb->RowStrideBytes = 0; } static void |