[8/8] wined3d: Set the initial FBO depth stencil when creating the device

H. Verbeet hverbeet at gmail.com
Mon Nov 27 13:51:11 CST 2006


The depth stencil is shared between onscreen and offscreen rendering,
so when creating the initial depth stencil we should also attach it to
the FBO.

Changelog:
  - Set the initial FBO depth stencil when creating the device
-------------- next part --------------
---

 dlls/wined3d/device.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index f06b9cb..caac5a1 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -79,6 +79,8 @@ static void WINAPI IWineD3DDeviceImpl_Ad
 
 static void WINAPI IWineD3DDeviceImpl_ApplyTextureUnitState(IWineD3DDevice *iface, DWORD Stage, WINED3DTEXTURESTAGESTATETYPE Type);
 
+static void set_depth_stencil_fbo(IWineD3DDevice *iface, IWineD3DSurface *depth_stencil);
+
 /* helper macros */
 #define D3DMEMCHECK(object, ppResult) if(NULL == object) { *ppResult = NULL; WARN("Out of memory\n"); return WINED3DERR_OUTOFVIDEOMEMORY;}
 
@@ -2090,6 +2092,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     IWineD3DSurface_AddRef(This->renderTarget);
     /* Depth Stencil support */
     This->stencilBufferTarget = This->depthStencilBuffer;
+    if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) {
+        set_depth_stencil_fbo(iface, This->depthStencilBuffer);
+    }
     if (NULL != This->stencilBufferTarget) {
         IWineD3DSurface_AddRef(This->stencilBufferTarget);
     }


More information about the wine-patches mailing list