summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2012-01-09 15:17:27 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2012-01-09 15:17:27 +0100
commitb0d7f4ddd94154491d04dcb9698d63d61e9240dc (patch)
tree73b39b42d38a12ef7af043035bd4db3951de5958
parent3d9f6b32e0ad72dc8c7db07d039d87e83d8fdb1d (diff)
dri2: CreateBuffer format may be 0, use depth in that case
-rw-r--r--src/nouveau_dri2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index 979216d..3aa5ec5 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -49,8 +49,8 @@ nouveau_dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment,
int bpp;
unsigned int usage_hint = NOUVEAU_CREATE_PIXMAP_TILED;
- /* 'format' is just depth */
- bpp = round_up_pow2(format);
+ /* 'format' is just depth (or 0, or maybe it depends on the caller) */
+ bpp = round_up_pow2(format ? format : pDraw->depth);
if (attachment == DRI2BufferDepth ||
attachment == DRI2BufferDepthStencil)