From 4617981ec72f7985941bee4b03c534d97ff96bc6 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 5 Feb 2009 19:41:18 +0100 Subject: gallium: No longer allow CPU mapping surfaces directly. Instead, a new pipe_transfer object has to be created and mapped for transferring data between the CPU and a texture. This gives the driver more flexibility for textures in address spaces that aren't CPU accessible. This is a first pass; softpipe/xlib builds and runs glxgears, but it only shows a black window. Looks like something's off related to the Z buffer, so the depth test always fails. --- src/gallium/auxiliary/draw/draw_pipe_pstipple.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/gallium/auxiliary/draw/draw_pipe_pstipple.c') diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index b764d9c518..41910c6165 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -372,7 +372,7 @@ pstip_update_texture(struct pstip_stage *pstip) static const uint bit31 = 1 << 31; struct pipe_context *pipe = pstip->pipe; struct pipe_screen *screen = pipe->screen; - struct pipe_surface *surface; + struct pipe_transfer *transfer; const uint *stipple = pstip->state.stipple->stipple; uint i, j; ubyte *data; @@ -381,10 +381,9 @@ pstip_update_texture(struct pstip_stage *pstip) */ pipe->flush( pipe, PIPE_FLUSH_TEXTURE_CACHE, NULL ); - surface = screen->get_tex_surface(screen, pstip->texture, 0, 0, 0, - PIPE_BUFFER_USAGE_CPU_WRITE); - data = screen->surface_map(screen, surface, - PIPE_BUFFER_USAGE_CPU_WRITE); + transfer = screen->get_tex_transfer(screen, pstip->texture, 0, 0, 0, + PIPE_TRANSFER_WRITE, 0, 0, 32, 32); + data = screen->transfer_map(screen, transfer); /* * Load alpha texture. @@ -396,18 +395,18 @@ pstip_update_texture(struct pstip_stage *pstip) for (j = 0; j < 32; j++) { if (stipple[i] & (bit31 >> j)) { /* fragment "on" */ - data[i * surface->stride + j] = 0; + data[i * transfer->stride + j] = 0; } else { /* fragment "off" */ - data[i * surface->stride + j] = 255; + data[i * transfer->stride + j] = 255; } } } /* unmap */ - screen->surface_unmap(screen, surface); - screen->tex_surface_release(screen, &surface); + screen->transfer_unmap(screen, transfer); + screen->tex_transfer_release(screen, &transfer); } -- cgit v1.2.3