i965: Fix error path for MCS allocation.
authorEric Anholt <eric@anholt.net>
Thu, 11 Apr 2013 17:08:56 +0000 (10:08 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 12 Apr 2013 23:32:12 +0000 (16:32 -0700)
Asserts don't stop execution in release builds, so we would continue on to
use an uninitialized format value.  Just take the failure path, which
appears to continue up the call stack for a while.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/intel/intel_mipmap_tree.c

index d7908c11516d2f9ff90a79298f59eec4bd7d8bc1..7da020103e2a6188cbd1510abe42943ce31ad07f 100644 (file)
@@ -976,7 +976,7 @@ intel_miptree_alloc_mcs(struct intel_context *intel,
       break;
    default:
       assert(!"Unrecognized sample count in intel_miptree_alloc_mcs");
-      break;
+      return false;
    };
 
    /* From the Ivy Bridge PRM, Vol4 Part1 p76, "MCS Base Address":