summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-18 17:47:32 -0700
committerBrian Paul <[email protected]>2012-01-24 14:12:38 -0700
commit89bb19adb08caaefc01e613e9bbfbdd1f366ddab (patch)
tree22b5e32beb3976d1e6be210c404dcd31a563742c
parent4baf90353dee771e553c552674616b93aedeaecf (diff)
intel: use swrast code to map/unmap renderbuffers for swrast rendering
-rw-r--r--src/mesa/drivers/dri/intel/intel_span.c81
1 files changed, 2 insertions, 79 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
index 2090e51d40c..3645720c060 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -110,77 +110,6 @@ intel_offset_S8(uint32_t stride, uint32_t x, uint32_t y)
return u;
}
-static void
-intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb)
-{
- struct gl_context *ctx = &intel->ctx;
- struct intel_renderbuffer *irb = intel_renderbuffer(rb);
- GLubyte *map;
- int stride;
-
- if (!irb)
- return;
-
- if (irb->Base.Map) {
- /* Renderbuffer is already mapped. This usually happens when a single
- * buffer is attached to the framebuffer's depth and stencil attachment
- * points.
- */
- return;
- }
-
- ctx->Driver.MapRenderbuffer(ctx, rb, 0, 0, rb->Width, rb->Height,
- GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,
- &map, &stride);
- irb->Base.Map = map;
- irb->Base.RowStride = stride;
-}
-
-static void
-intel_renderbuffer_unmap(struct intel_context *intel,
- struct gl_renderbuffer *rb)
-{
- struct gl_context *ctx = &intel->ctx;
- struct intel_renderbuffer *irb = intel_renderbuffer(rb);
-
- if (!irb)
- return;
-
- if (!irb->Base.Map) {
- /* Renderbuffer is already unmapped. This usually happens when a single
- * buffer is attached to the framebuffer's depth and stencil attachment
- * points.
- */
- return;
- }
-
- ctx->Driver.UnmapRenderbuffer(ctx, rb);
-
- irb->Base.Map = NULL;
- irb->Base.RowStride = 0;
-}
-
-static void
-intel_framebuffer_map(struct intel_context *intel, struct gl_framebuffer *fb)
-{
- int i;
-
- for (i = 0; i < BUFFER_COUNT; i++) {
- intel_renderbuffer_map(intel, fb->Attachment[i].Renderbuffer);
- }
-
- intel_check_front_buffer_rendering(intel);
-}
-
-static void
-intel_framebuffer_unmap(struct intel_context *intel, struct gl_framebuffer *fb)
-{
- int i;
-
- for (i = 0; i < BUFFER_COUNT; i++) {
- intel_renderbuffer_unmap(intel, fb->Attachment[i].Renderbuffer);
- }
-}
/**
* Resolve all buffers that will be mapped by intelSpanRenderStart().
@@ -236,10 +165,7 @@ intel_span_map_buffers(struct intel_context *intel)
GL_MAP_READ_BIT | GL_MAP_WRITE_BIT);
}
- intel_framebuffer_map(intel, ctx->DrawBuffer);
- if (ctx->ReadBuffer != ctx->DrawBuffer) {
- intel_framebuffer_map(intel, ctx->ReadBuffer);
- }
+ _swrast_map_renderbuffers(ctx);
}
/**
@@ -279,10 +205,7 @@ intelSpanRenderFinish(struct gl_context * ctx)
}
}
- intel_framebuffer_unmap(intel, ctx->DrawBuffer);
- if (ctx->ReadBuffer != ctx->DrawBuffer) {
- intel_framebuffer_unmap(intel, ctx->ReadBuffer);
- }
+ _swrast_unmap_renderbuffers(ctx);
}