Commit 577dbb57 authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

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

Use the render target index rather than hardcoding 0.
parent 8355b1a5
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment