diff options
author | Eric Anholt <[email protected]> | 2014-03-21 16:36:22 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-03-24 11:15:04 -0700 |
commit | 41033509f2fc714442a222b46068ade4380f9b08 (patch) | |
tree | c0275c7484aac5e0761831ec0d3be8458d551772 /src/mesa | |
parent | 764e25d79dad3096274ab2df04f5aa3ffb232119 (diff) |
i965: Add an env var for forcing window system MSAA.
Sometimes it would be nice to benchmark some app with MSAA versus not, but
it doesn't offer the controls you want. Just provide a handy knob to
force the issue.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 15 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 4e9a77594b3..0788a1b8e5f 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -975,6 +975,11 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, _mesa_initialize_window_framebuffer(fb, mesaVis); + if (screen->winsys_msaa_samples_override != -1) { + num_samples = screen->winsys_msaa_samples_override; + fb->Visual.samples = num_samples; + } + if (mesaVis->redBits == 5) rgbFormat = MESA_FORMAT_B5G6R5_UNORM; else if (mesaVis->sRGBCapable) @@ -1335,6 +1340,16 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) intelScreen->hw_has_swizzling = intel_detect_swizzling(intelScreen); + const char *force_msaa = getenv("INTEL_FORCE_MSAA"); + if (force_msaa) { + intelScreen->winsys_msaa_samples_override = + intel_quantize_num_samples(intelScreen, atoi(force_msaa)); + printf("Forcing winsys sample count to %d\n", + intelScreen->winsys_msaa_samples_override); + } else { + intelScreen->winsys_msaa_samples_override = -1; + } + set_max_gl_versions(intelScreen); /* Notification of GPU resets requires hardware contexts and a kernel new diff --git a/src/mesa/drivers/dri/i965/intel_screen.h b/src/mesa/drivers/dri/i965/intel_screen.h index 09690215ded..945f6f5f43f 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.h +++ b/src/mesa/drivers/dri/i965/intel_screen.h @@ -62,6 +62,8 @@ struct intel_screen */ unsigned program_id; + int winsys_msaa_samples_override; + struct { struct ra_regs *regs; |