summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-02-05 19:41:18 +0100
committerMichel Dänzer <daenzer@vmware.com>2009-02-05 19:41:18 +0100
commit4617981ec72f7985941bee4b03c534d97ff96bc6 (patch)
treec3c8fb33499227cf4e3e905b3c04ff6599666663 /src/gallium/auxiliary/draw/draw_pipe_pstipple.c
parente0c3b4970da052308bf7b4e5cbe9186a4b8321db (diff)
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.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_pstipple.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_pstipple.c17
1 files changed, 8 insertions, 9 deletions
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);
}