summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-07-30 13:46:00 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-07-30 13:46:00 -0600
commit7baa0865b114776cc1672c5e97e63c282e25285f (patch)
tree535d69ff7cd50c61475fd6831b4a6cc8b91a743a /src/mesa/pipe/softpipe
parent75b8a396e5b29e2ee86ab3a5c9590e6db5d28155 (diff)
parent3a35ce336458352653329426c550bfce1ffc3f66 (diff)
Merge branch 'softpipe_0_1_branch' of git+ssh://brianp@git.freedesktop.org/git/mesa/mesa into softpipe_0_1_branch
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c31
-rw-r--r--src/mesa/pipe/softpipe/sp_prim_setup.c9
2 files changed, 31 insertions, 9 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 3bb04a6835..6b44fabfa4 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -32,12 +32,40 @@
#include "main/imports.h"
#include "main/macros.h"
#include "pipe/draw/draw_context.h"
+#include "pipe/p_defines.h"
#include "sp_context.h"
#include "sp_clear.h"
#include "sp_state.h"
+#include "sp_surface.h"
#include "sp_prim_setup.h"
+static void map_surfaces(struct softpipe_context *sp)
+{
+ GLuint i;
+
+ for (i = 0; i < sp->framebuffer.num_cbufs; i++) {
+ struct softpipe_surface *sps = softpipe_surface(sp->framebuffer.cbufs[i]);
+ struct pipe_buffer *buf = &sps->surface.buffer;
+ buf->map(buf, PIPE_MAP_READ_WRITE);
+ }
+ /* XXX depth & stencil bufs */
+}
+
+
+static void unmap_surfaces(struct softpipe_context *sp)
+{
+ GLuint i;
+
+ for (i = 0; i < sp->framebuffer.num_cbufs; i++) {
+ struct softpipe_surface *sps = softpipe_surface(sp->framebuffer.cbufs[i]);
+ struct pipe_buffer *buf = &sps->surface.buffer;
+ buf->unmap(buf);
+ }
+ /* XXX depth & stencil bufs */
+}
+
+
static void softpipe_destroy( struct pipe_context *pipe )
{
struct softpipe_context *softpipe = softpipe_context( pipe );
@@ -56,7 +84,10 @@ static void softpipe_draw_vb( struct pipe_context *pipe,
if (softpipe->dirty)
softpipe_update_derived( softpipe );
+ /* XXX move mapping/unmapping to higher/coarser level? */
+ map_surfaces(softpipe);
draw_vb( softpipe->draw, VB );
+ unmap_surfaces(softpipe);
}
diff --git a/src/mesa/pipe/softpipe/sp_prim_setup.c b/src/mesa/pipe/softpipe/sp_prim_setup.c
index 57b7d73415..4e66f40e47 100644
--- a/src/mesa/pipe/softpipe/sp_prim_setup.c
+++ b/src/mesa/pipe/softpipe/sp_prim_setup.c
@@ -1010,20 +1010,11 @@ static void setup_begin( struct draw_stage *stage )
struct setup_stage *setup = setup_stage(stage);
setup->quad.nr_attrs = setup->softpipe->nr_frag_attrs;
-
- /*
- * XXX this is where we might map() the renderbuffers to begin
- * s/w rendering.
- */
}
static void setup_end( struct draw_stage *stage )
{
- /*
- * XXX this is where we might unmap() the renderbuffers after
- * s/w rendering.
- */
}