projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e4ed63
)
fix xm_buffer_data
author
Brian
<brian.paul@tungstengraphics.com>
Sat, 18 Aug 2007 08:22:15 +0000
(09:22 +0100)
committer
Brian
<brian.paul@tungstengraphics.com>
Sat, 18 Aug 2007 08:22:15 +0000
(09:22 +0100)
src/mesa/drivers/x11/xm_softpipe.c
patch
|
blob
|
history
diff --git
a/src/mesa/drivers/x11/xm_softpipe.c
b/src/mesa/drivers/x11/xm_softpipe.c
index 09edea6265e4c80b89b69e6aebf164e1e641c74e..432f306e94ea5a283a9e51fb9c3acdecd9d59252 100644
(file)
--- a/
src/mesa/drivers/x11/xm_softpipe.c
+++ b/
src/mesa/drivers/x11/xm_softpipe.c
@@
-51,6
+51,7
@@
struct xm_softpipe_winsys
struct xm_buffer
{
int refcount;
+ int size;
void *data;
void *mapped;
};
@@
-129,8
+130,12
@@
xm_buffer_data(struct pipe_winsys *pws, struct pipe_buffer_handle *buf,
unsigned size, const void *data )
{
struct xm_buffer *xm_buf = xm_bo(buf);
- assert(!xm_buf->data);
- xm_buf->data = malloc(size);
+ if (xm_buf->size != size) {
+ if (xm_buf->data)
+ free(xm_buf->data);
+ xm_buf->data = malloc(size);
+ xm_buf->size = size;
+ }
if (data)
memcpy(xm_buf->data, data, size);
}