diff options
author | Patrice Mandin <[email protected]> | 2007-02-03 13:20:16 +0100 |
---|---|---|
committer | Patrice Mandin <[email protected]> | 2007-02-03 13:20:16 +0100 |
commit | 1c25561e30ada8036d00aa84344377aa2a4f791a (patch) | |
tree | 559f12c2561fdcbcd31f410a95e092db489d3990 /src | |
parent | 2a441c488f4bcf11fe032ea7ba448bbfb7449c66 (diff) |
nouveau: use color pitch as depth pitch if depth disabled
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv10_state.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state.c b/src/mesa/drivers/dri/nouveau/nv10_state.c index f6e47b7f480..055f538a3a0 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state.c @@ -667,7 +667,7 @@ static GLboolean nv10BindBuffers(nouveauContextPtr nmesa, int num_color, nouveau_renderbuffer *depth) { GLuint x, y, w, h; - GLuint pitch, format; + GLuint pitch, format, depth_pitch; w = color[0]->mesa.Width; h = color[0]->mesa.Height; @@ -680,10 +680,8 @@ static GLboolean nv10BindBuffers(nouveauContextPtr nmesa, int num_color, BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_HORIZ, 6); OUT_RING_CACHE((w << 16) | x); OUT_RING_CACHE((h << 16) | y); - pitch = color[0]->pitch; - if (depth) { - pitch |= (depth->pitch << 16); - } + depth_pitch = (depth ? depth->pitch : color[0]->pitch); + pitch = (depth_pitch<<16) | color[0]->pitch; format = 0x108; if (color[0]->mesa._ActualFormat != GL_RGBA8) { format = 0x103; /* R5G6B5 color buffer */ |