summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe/sp_texture.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2007-12-07 12:30:35 +0100
committerMichel Dänzer <[email protected]>2007-12-07 12:30:35 +0100
commitb859cdf6f191b4d8b56537c8dc30082a7e2d94b3 (patch)
tree4bd3149cc81a2fb6434282a70b34361f94710cfd /src/mesa/pipe/softpipe/sp_texture.c
parent987d59bb83e9e08192563e5f1b52949c5511053c (diff)
Eliminate struct pipe_region.
Directly use struct pipe_buffer_handle for storage and struct pipe_surface for (un)mapping.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_texture.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_texture.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mesa/pipe/softpipe/sp_texture.c b/src/mesa/pipe/softpipe/sp_texture.c
index 2f9a1e9837b..53486f9bba5 100644
--- a/src/mesa/pipe/softpipe/sp_texture.c
+++ b/src/mesa/pipe/softpipe/sp_texture.c
@@ -32,6 +32,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
+#include "pipe/p_inlines.h"
#include "pipe/p_util.h"
#include "pipe/p_winsys.h"
@@ -380,13 +381,18 @@ softpipe_texture_create(struct pipe_context *pipe, struct pipe_texture **pt)
sizeof(struct softpipe_texture) - sizeof(struct pipe_texture));
if (softpipe_mipmap_tree_layout(pipe, spt)) {
- spt->region = pipe->winsys->region_alloc(pipe->winsys,
- spt->pitch * (*pt)->cpp *
- spt->total_height,
- PIPE_SURFACE_FLAG_TEXTURE);
+ spt->buffer = pipe->winsys->buffer_create(pipe->winsys,
+ PIPE_SURFACE_FLAG_TEXTURE);
+
+ if (spt->buffer) {
+ pipe->winsys->buffer_data(pipe->winsys, spt->buffer,
+ spt->pitch * (*pt)->cpp *
+ spt->total_height, NULL,
+ PIPE_BUFFER_USAGE_PIXEL);
+ }
}
- if (!spt->region) {
+ if (!spt->buffer) {
FREE(spt);
spt = NULL;
}
@@ -413,7 +419,7 @@ softpipe_texture_release(struct pipe_context *pipe, struct pipe_texture **pt)
DBG("%s deleting %p\n", __FUNCTION__, (void *) spt);
*/
- pipe->winsys->region_release(pipe->winsys, &spt->region);
+ pipe->winsys->buffer_reference(pipe->winsys, &spt->buffer, NULL);
for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++)
if (spt->image_offset[i])