summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_miptree.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-06-13 10:58:27 +1000
committerBen Skeggs <[email protected]>2008-06-29 15:46:18 +1000
commit101305f37f7268354a50b825bcb66894e4a0b777 (patch)
tree839ec3a4755c32bd115aab5ac427775697c34c42 /src/gallium/drivers/nv50/nv50_miptree.c
parent2fdeb4d5a5cc8b93bf885ba646e3a29a68c755ed (diff)
nv50: flag to indicate to winsys we want a surface for use as a zeta buffer
NVIDIA love to make life difficult.. we need different flags in PTEs for zeta.. yay.. not.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_miptree.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_miptree.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index be85c3fd5ce..459e0ff9dd6 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -21,6 +21,7 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
{
struct pipe_winsys *ws = pscreen->winsys;
struct nv50_miptree *mt = CALLOC_STRUCT(nv50_miptree);
+ unsigned usage;
NOUVEAU_ERR("unimplemented\n");
@@ -28,7 +29,17 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
mt->base.refcount = 1;
mt->base.screen = pscreen;
- mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
+ usage = PIPE_BUFFER_USAGE_PIXEL;
+ switch (pt->format) {
+ case PIPE_FORMAT_Z24S8_UNORM:
+ case PIPE_FORMAT_Z16_UNORM:
+ usage |= NOUVEAU_BUFFER_USAGE_ZETA;
+ break;
+ default:
+ break;
+ }
+
+ mt->buffer = ws->buffer_create(ws, 256, usage,
pt->width[0] * pt->cpp * pt->height[0]);
if (!mt->buffer) {
FREE(mt);