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_texture.c | |
parent | 797c18be1f907337ebd85b18ce43dfa0b056f492 (diff) |
swrast: use swrast_renderbuffer instead of gl_renderbuffer
Diffstat (limited to 'src/mesa/swrast/s_texture.c')
-rw-r--r-- | src/mesa/swrast/s_texture.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 0453640c0df..0a87b7327e0 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -322,6 +322,7 @@ map_attachment(struct gl_context *ctx, { struct gl_texture_object *texObj = fb->Attachment[buffer].Texture; struct gl_renderbuffer *rb = fb->Attachment[buffer].Renderbuffer; + struct swrast_renderbuffer *srb = swrast_renderbuffer(rb); if (texObj) { const GLuint level = fb->Attachment[buffer].TextureLevel; @@ -333,20 +334,20 @@ map_attachment(struct gl_context *ctx, /* XXX we'll eventually call _swrast_map_teximage() here */ swImage->Map = swImage->Buffer; - if (rb) { - rb->Map = swImage->Buffer; - rb->RowStrideBytes = swImage->RowStride * + if (srb) { + srb->Map = swImage->Buffer; + srb->RowStride = swImage->RowStride * _mesa_get_format_bytes(swImage->Base.TexFormat); } } } else if (rb) { /* Map ordinary renderbuffer */ - ctx->Driver.MapRenderbuffer(ctx, rb, - 0, 0, rb->Width, rb->Height, - GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, - &rb->Map, &rb->RowStrideBytes); - assert(rb->Map); + ctx->Driver.MapRenderbuffer(ctx, rb, + 0, 0, rb->Width, rb->Height, + GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, + &srb->Map, &srb->RowStride); + assert(srb->Map); } } @@ -358,6 +359,7 @@ unmap_attachment(struct gl_context *ctx, { struct gl_texture_object *texObj = fb->Attachment[buffer].Texture; struct gl_renderbuffer *rb = fb->Attachment[buffer].Renderbuffer; + struct swrast_renderbuffer *srb = swrast_renderbuffer(rb); if (texObj) { const GLuint level = fb->Attachment[buffer].TextureLevel; @@ -373,7 +375,7 @@ unmap_attachment(struct gl_context *ctx, ctx->Driver.UnmapRenderbuffer(ctx, rb); } - rb->Map = NULL; + srb->Map = NULL; } |