i965: Fix context initialization after 2f896627175384fd5
authorEric Anholt <eric@anholt.net>
Mon, 4 Nov 2013 23:49:52 +0000 (15:49 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 5 Nov 2013 23:39:44 +0000 (15:39 -0800)
You can't return stack-initialized values and expect anything good to
happen.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_context.c

index 1f4fbbfb653789e4384102b3eaacf4e74d6c1bc0..ab420fbfe2008d128718044736c501a25080ad57 100644 (file)
@@ -275,12 +275,15 @@ brw_init_driver_functions(struct brw_context *brw,
 static const int*
 brw_supported_msaa_modes(const struct brw_context *brw)
 {
+   static const int gen7_samples[] = {8, 4, 0};
+   static const int gen6_samples[] = {4, 0};
+   static const int gen4_samples[] = {0};
    if (brw->gen >= 7) {
-      return (int[]){8, 4, 0};
+      return gen7_samples;
    } else if (brw->gen == 6) {
-      return (int[]){4, 0};
+      return gen6_samples;
    } else {
-      return (int[]){0};
+      return gen4_samples;
    }
 }