wined3d: Move storing the render target from ActiveRender to SetRenderTarget.

Use the render target index rather than hardcoding 0.
This commit is contained in:
H. Verbeet 2006-12-19 19:25:29 +01:00 committed by Alexandre Julliard
parent 8355b1a501
commit 577dbb578b
1 changed files with 6 additions and 7 deletions

View File

@ -5871,6 +5871,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface,
implementations that use separate pbuffers for different swapchains or rendertargets will have to duplicate the
stencil buffer and incure an extra memory overhead */
hr = IWineD3DDeviceImpl_ActiveRender(iface, pRenderTarget);
/* Replace the render target */
if (This->render_targets[RenderTargetIndex]) IWineD3DSurface_Release(This->render_targets[RenderTargetIndex]);
This->render_targets[RenderTargetIndex] = pRenderTarget;
if (pRenderTarget) IWineD3DSurface_AddRef(pRenderTarget);
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) {
set_render_target_fbo(iface, pRenderTarget);
}
@ -6352,13 +6358,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ActiveRender(IWineD3DDevice* iface,
device_render_to_texture(This, TRUE);
}
/* Replace the render target */
if (This->render_targets[0] != RenderSurface) {
IWineD3DSurface_Release(This->render_targets[0]);
This->render_targets[0] = RenderSurface;
IWineD3DSurface_AddRef(RenderSurface);
}
if (cfgs != NULL) XFree(cfgs);
if (implicitSwapchain != NULL) IWineD3DSwapChain_Release(implicitSwapchain);
if (currentSwapchain != NULL) IWineD3DSwapChain_Release(currentSwapchain);