aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-11-04 15:49:52 -0800
committerEric Anholt <[email protected]>2013-11-05 15:39:44 -0800
commit3f319eef76a31776085accb38c06851bc04f64b8 (patch)
tree39c48cfdb1ae1c86d6e5d082b1ab0840b1ef958d /src/mesa
parent5ae31d7e1d3d51c7843571c63aa228f8ca9b879f (diff)
i965: Fix context initialization after 2f896627175384fd5
You can't return stack-initialized values and expect anything good to happen. Reviewed-by: Chad Versace <[email protected] Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 1f4fbbfb653..ab420fbfe20 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -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;
}
}