summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorPatrice Mandin <pmandin@caramail.com>2007-02-20 23:13:48 +0100
committerPatrice Mandin <pmandin@caramail.com>2007-02-20 23:13:48 +0100
commit79870d100f90555b520af342cf59496236ff8f20 (patch)
tree46439441f2994ef7c67e47674180ed813d5c98e9 /src/mesa/drivers/dri
parent102ad2e066b7a6fcd893db58c64ca685e49a3dfd (diff)
nouveau: nv10: also check ctx->DrawBuffer in nv10ViewportScale
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state.c b/src/mesa/drivers/dri/nouveau/nv10_state.c
index 09fc07556d..e204eba6ba 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state.c
@@ -41,13 +41,18 @@ static void nv10ViewportScale(nouveauContextPtr nmesa)
GLuint h = ctx->Viewport.Height;
GLfloat max_depth = (ctx->Viewport.Near + ctx->Viewport.Far) * 0.5;
- switch (ctx->DrawBuffer->_DepthBuffer->DepthBits) {
- case 16:
- max_depth *= 32767.0;
- break;
- case 24:
- max_depth *= 16777215.0;
- break;
+ if (ctx->DrawBuffer) {
+ switch (ctx->DrawBuffer->_DepthBuffer->DepthBits) {
+ case 16:
+ max_depth *= 32767.0;
+ break;
+ case 24:
+ max_depth *= 16777215.0;
+ break;
+ }
+ } else {
+ /* Default to 24 bits range */
+ max_depth *= 16777215.0;
}
BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_SCALE_X, 4);