summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_miptree.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-07-11 22:45:11 +1000
committerBen Skeggs <[email protected]>2008-07-11 22:46:07 +1000
commit9b0add0be4a3ba7fc72779daf8361d8cd98d9f64 (patch)
treede5ce8244c8ead44b6f1ef3c5a8eaf8643ba0f6c /src/gallium/drivers/nv50/nv50_miptree.c
parent5180a668a7da627a40e024a2ed765458d5bac43e (diff)
nv50: quick hack to get textures untiled on map, and tiled on unmap
progs/fp/tri-tex is all good now rather than all scrambled :)
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_miptree.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_miptree.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index 8b61ca2a1fa..a02ad41885b 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -82,9 +82,14 @@ nv50_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
{
struct pipe_winsys *ws = pscreen->winsys;
struct nv50_miptree *mt = nv50_miptree(pt);
+ struct nv50_surface *s;
struct pipe_surface *ps;
- ps = CALLOC_STRUCT(pipe_surface);
+ s = CALLOC_STRUCT(nv50_surface);
+ if (!s)
+ return NULL;
+ ps = &s->base;
+
ps->refcount = 1;
ps->winsys = ws;
ps->format = pt->format;
@@ -109,14 +114,15 @@ nv50_miptree_surface_del(struct pipe_screen *pscreen,
struct pipe_surface **psurface)
{
struct pipe_winsys *ws = pscreen->winsys;
- struct pipe_surface *surf = *psurface;
+ struct pipe_surface *ps = *psurface;
+ struct nv50_surface *s = nv50_surface(ps);
*psurface = NULL;
- if (--surf->refcount <= 0) {
- pipe_texture_reference(&surf->texture, NULL);
- pipe_buffer_reference(ws, &surf->buffer, NULL);
- FREE(surf);
+ if (--ps->refcount <= 0) {
+ pipe_texture_reference(&ps->texture, NULL);
+ pipe_buffer_reference(ws, &ps->buffer, NULL);
+ FREE(s);
}
}