From 68da4b50e9b6aa72a9b155f650952620063e1b94 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 23 Oct 2011 10:44:47 -0600 Subject: 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. --- src/mesa/swrast/s_context.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/mesa/swrast/s_context.h') diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 55f7c31ce51..a83ac614560 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -144,6 +144,9 @@ struct swrast_texture_image each 2D slice in 'Data', in texels */ GLubyte *Data; /**< Image data, accessed via FetchTexel() */ + /** Malloc'd texure memory */ + GLubyte *Buffer; + FetchTexelFunc FetchTexel; StoreTexelFunc Store; }; @@ -333,6 +336,31 @@ swrast_render_finish(struct gl_context *ctx) } +extern void +_swrast_span_render_start(struct gl_context *ctx); + +extern void +_swrast_span_render_finish(struct gl_context *ctx); + +extern void +_swrast_map_textures(struct gl_context *ctx); + +extern void +_swrast_unmap_textures(struct gl_context *ctx); + +extern void +_swrast_map_texture(struct gl_context *ctx, struct gl_texture_object *texObj); + +extern void +_swrast_unmap_texture(struct gl_context *ctx, struct gl_texture_object *texObj); + + +extern void +_swrast_map_renderbuffers(struct gl_context *ctx); + +extern void +_swrast_unmap_renderbuffers(struct gl_context *ctx); + /** * Size of an RGBA pixel, in bytes, for given datatype. -- cgit v1.2.3