summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-10-23 10:44:47 -0600
committerBrian Paul <[email protected]>2011-10-23 10:44:47 -0600
commit68da4b50e9b6aa72a9b155f650952620063e1b94 (patch)
tree369f3d98b315e6a000f3d45ad96b006aebc310e0 /src/mesa/swrast/s_context.c
parent66681b4c8cb1ef16f42c1591298cb30c83bca09b (diff)
mesa: add swrast_texture_image::Buffer
In the past, swrast_texture_image::Data has been overloaded. It could either point to malloc'd memory storing texture data, or it could point to a current mapping of GPU memory. Now, Buffer always points to malloc'd memory (if we're not using GPU memory) and Data always points to mapped memory. The next step would be to rename Data -> Map. This change also involves adding swrast functions for mapping textures and renderbuffers prior to rendering to setup the Data pointer. Plus, corresponding functions to unmap texures and renderbuffers. This is very much like similar code in the dri drivers.
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 5287671d780..9112cf30d81 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -747,6 +747,12 @@ _swrast_CreateContext( struct gl_context *ctx )
swrast->AllowVertexFog = GL_TRUE;
swrast->AllowPixelFog = GL_TRUE;
+ swrast->Driver.SpanRenderStart = _swrast_span_render_start;
+ swrast->Driver.SpanRenderFinish = _swrast_span_render_finish;
+
+ ctx->Driver.MapTexture = _swrast_map_texture;
+ ctx->Driver.UnmapTexture = _swrast_unmap_texture;
+
/* Optimized Accum buffer */
swrast->_IntegerAccumMode = GL_FALSE;
swrast->_IntegerAccumScaler = 0.0;
@@ -837,6 +843,24 @@ _swrast_render_primitive( struct gl_context *ctx, GLenum prim )
}
+/** called via swrast->Driver.SpanRenderStart() */
+void
+_swrast_span_render_start(struct gl_context *ctx)
+{
+ _swrast_map_textures(ctx);
+ _swrast_map_renderbuffers(ctx);
+}
+
+
+/** called via swrast->Driver.SpanRenderFinish() */
+void
+_swrast_span_render_finish(struct gl_context *ctx)
+{
+ _swrast_unmap_textures(ctx);
+ _swrast_unmap_renderbuffers(ctx);
+}
+
+
void
_swrast_render_start( struct gl_context *ctx )
{