wined3d: Add a registry key to disable rendering swapchains onscreen.

We'll probably want to make this default to TRUE at some point, but at least
for the moment there still seem to be some performance advantages to rendering
onscreen in most cases.
This commit is contained in:
Henri Verbeet 2011-08-23 20:08:06 +02:00 committed by Alexandre Julliard
parent 4b1ba0e02d
commit 620c81dc76
3 changed files with 10 additions and 1 deletions

View File

@ -824,7 +824,8 @@ void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain)
swapchain->presentParms.BackBufferHeight, swapchain->presentParms.BackBufferHeight,
client_rect.right, client_rect.bottom); client_rect.right, client_rect.bottom);
if (swapchain->presentParms.BackBufferWidth == client_rect.right if (!wined3d_settings.always_offscreen
&& swapchain->presentParms.BackBufferWidth == client_rect.right
&& swapchain->presentParms.BackBufferHeight == client_rect.bottom) && swapchain->presentParms.BackBufferHeight == client_rect.bottom)
{ {
TRACE("Backbuffer dimensions match window dimensions, rendering onscreen.\n"); TRACE("Backbuffer dimensions match window dimensions, rendering onscreen.\n");

View File

@ -86,6 +86,7 @@ struct wined3d_settings wined3d_settings =
NULL, /* No wine logo by default */ NULL, /* No wine logo by default */
FALSE, /* Disable multisampling for now due to Nvidia driver bugs which happens for some users */ FALSE, /* Disable multisampling for now due to Nvidia driver bugs which happens for some users */
FALSE, /* No strict draw ordering. */ FALSE, /* No strict draw ordering. */
FALSE, /* Try to render onscreen by default. */
}; };
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
@ -340,6 +341,12 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL)
TRACE("Enforcing strict draw ordering.\n"); TRACE("Enforcing strict draw ordering.\n");
wined3d_settings.strict_draw_ordering = TRUE; wined3d_settings.strict_draw_ordering = TRUE;
} }
if (!get_config_key(hkey, appkey, "AlwaysOffscreen", buffer, size)
&& !strcmp(buffer,"enabled"))
{
TRACE("Always rendering backbuffers offscreen.\n");
wined3d_settings.always_offscreen = TRUE;
}
} }
if (wined3d_settings.vs_mode == VS_HW) if (wined3d_settings.vs_mode == VS_HW)
TRACE("Allow HW vertex shaders\n"); TRACE("Allow HW vertex shaders\n");

View File

@ -271,6 +271,7 @@ struct wined3d_settings
char *logo; char *logo;
int allow_multisampling; int allow_multisampling;
BOOL strict_draw_ordering; BOOL strict_draw_ordering;
BOOL always_offscreen;
}; };
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;