Henri Verbeet : wined3d: Always use the same formats in context_create() when "always_offscreen" is enabled.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Nov 4 09:40:40 CST 2015


Module: wine
Branch: master
Commit: c92451f295242110bf016facf0e80564f3643d94
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c92451f295242110bf016facf0e80564f3643d94

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Nov  4 00:02:48 2015 +0100

wined3d: Always use the same formats in context_create() when "always_offscreen" is enabled.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/context.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index e97206e..13b8471 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1557,6 +1557,20 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
     if (color_format->id == WINED3DFMT_P8_UINT)
         color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM);
 
+    /* When "always_offscreen" is enabled, we only use the drawable for
+     * presentation blits, and don't do any rendering to it. That means we
+     * don't need depth or stencil buffers, and can mostly ignore the render
+     * target format. This wouldn't necessarily be quite correct for 10bpc
+     * display modes, but we don't currently support those.
+     * Using the same format regardless of the color/depth/stencil targets
+     * makes it much less likely that different wined3d instances will set
+     * conflicting pixel formats. */
+    if (wined3d_settings.always_offscreen)
+    {
+        color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM);
+        ds_format = wined3d_get_format(gl_info, WINED3DFMT_UNKNOWN);
+    }
+
     /* Try to find a pixel format which matches our requirements. */
     pixel_format = context_choose_pixel_format(device, hdc, color_format, ds_format, auxBuffers, FALSE);
 




More information about the wine-cvs mailing list