[Mesa-dev] [PATCH 1/4] i965: Add an env var for forcing window system MSAA.
Kenneth Graunke
kenneth at whitecape.org
Mon Mar 24 02:28:44 PDT 2014
On 03/21/2014 05:45 PM, Eric Anholt wrote:
> 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.
> ---
> src/mesa/drivers/dri/i965/intel_screen.c | 15 +++++++++++++++
> src/mesa/drivers/dri/i965/intel_screen.h | 2 ++
> 2 files changed, 17 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
> index 4e9a775..0788a1b 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 0969021..945f6f5 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;
>
>
These four are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140324/8dcd11f2/attachment.sig>
More information about the mesa-dev
mailing list