wined3d: Add a parameter for SetRenderTarget viewport setup.
This commit is contained in:
parent
1f2611607f
commit
90e443758a
|
@ -1005,7 +1005,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetRenderTarget(LPDIRECT3DDEVICE8 ifa
|
||||||
{
|
{
|
||||||
hr = IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, pZSurface ? pZSurface->wineD3DSurface : NULL);
|
hr = IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, pZSurface ? pZSurface->wineD3DSurface : NULL);
|
||||||
if (SUCCEEDED(hr) && pSurface)
|
if (SUCCEEDED(hr) && pSurface)
|
||||||
hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, 0, pSurface->wineD3DSurface);
|
hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, 0, pSurface->wineD3DSurface, TRUE);
|
||||||
if (FAILED(hr)) IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, original_ds);
|
if (FAILED(hr)) IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, original_ds);
|
||||||
}
|
}
|
||||||
if (original_ds) IWineD3DSurface_Release(original_ds);
|
if (original_ds) IWineD3DSurface_Release(original_ds);
|
||||||
|
|
|
@ -1042,7 +1042,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9EX
|
||||||
}
|
}
|
||||||
|
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, RenderTargetIndex, pSurface ? pSurface->wineD3DSurface : NULL);
|
hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, RenderTargetIndex, pSurface ? pSurface->wineD3DSurface : NULL, TRUE);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
|
@ -348,7 +348,8 @@ IDirect3DDeviceImpl_7_Release(IDirect3DDevice7 *iface)
|
||||||
* vanish soon.
|
* vanish soon.
|
||||||
*/
|
*/
|
||||||
IWineD3DDevice_SetRenderTarget(This->wineD3DDevice, 0,
|
IWineD3DDevice_SetRenderTarget(This->wineD3DDevice, 0,
|
||||||
This->ddraw->d3d_target->WineD3DSurface);
|
This->ddraw->d3d_target->WineD3DSurface,
|
||||||
|
FALSE);
|
||||||
/* This->target is the offscreen target.
|
/* This->target is the offscreen target.
|
||||||
* This->ddraw->d3d_target is the target used by DDraw
|
* This->ddraw->d3d_target is the target used by DDraw
|
||||||
*/
|
*/
|
||||||
|
@ -1984,7 +1985,8 @@ IDirect3DDeviceImpl_7_SetRenderTarget(IDirect3DDevice7 *iface,
|
||||||
|
|
||||||
hr = IWineD3DDevice_SetRenderTarget(This->wineD3DDevice,
|
hr = IWineD3DDevice_SetRenderTarget(This->wineD3DDevice,
|
||||||
0,
|
0,
|
||||||
Target ? Target->WineD3DSurface : NULL);
|
Target ? Target->WineD3DSurface : NULL,
|
||||||
|
FALSE);
|
||||||
if(hr != D3D_OK)
|
if(hr != D3D_OK)
|
||||||
{
|
{
|
||||||
LeaveCriticalSection(&ddraw_cs);
|
LeaveCriticalSection(&ddraw_cs);
|
||||||
|
|
|
@ -865,7 +865,6 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
|
||||||
if(!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) &&
|
if(!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) &&
|
||||||
(This->d3d_target != target))
|
(This->d3d_target != target))
|
||||||
{
|
{
|
||||||
WINED3DVIEWPORT vp;
|
|
||||||
TRACE("(%p) Using %p as front buffer, %p as back buffer\n", This, This->d3d_target, target);
|
TRACE("(%p) Using %p as front buffer, %p as back buffer\n", This, This->d3d_target, target);
|
||||||
hr = IWineD3DDevice_SetFrontBackBuffers(This->wineD3DDevice,
|
hr = IWineD3DDevice_SetFrontBackBuffers(This->wineD3DDevice,
|
||||||
This->d3d_target->WineD3DSurface,
|
This->d3d_target->WineD3DSurface,
|
||||||
|
@ -875,17 +874,8 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
|
||||||
|
|
||||||
/* Render to the back buffer */
|
/* Render to the back buffer */
|
||||||
IWineD3DDevice_SetRenderTarget(This->wineD3DDevice, 0,
|
IWineD3DDevice_SetRenderTarget(This->wineD3DDevice, 0,
|
||||||
target->WineD3DSurface);
|
target->WineD3DSurface,
|
||||||
|
TRUE);
|
||||||
vp.X = 0;
|
|
||||||
vp.Y = 0;
|
|
||||||
vp.Width = target->surface_desc.dwWidth;
|
|
||||||
vp.Height = target->surface_desc.dwHeight;
|
|
||||||
vp.MinZ = 0.0;
|
|
||||||
vp.MaxZ = 1.0;
|
|
||||||
IWineD3DDevice_SetViewport(This->wineD3DDevice,
|
|
||||||
&vp);
|
|
||||||
|
|
||||||
object->OffScreenTarget = TRUE;
|
object->OffScreenTarget = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -6184,9 +6184,9 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
|
||||||
context_release(context);
|
context_release(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface, DWORD RenderTargetIndex, IWineD3DSurface *pRenderTarget) {
|
static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface, DWORD RenderTargetIndex, IWineD3DSurface *pRenderTarget,
|
||||||
|
BOOL set_viewport) {
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||||
int dxVersion = ( (IWineD3DImpl *) This->wineD3D)->dxVersion;
|
|
||||||
|
|
||||||
TRACE("(%p) : Setting rendertarget %d to %p\n", This, RenderTargetIndex, pRenderTarget);
|
TRACE("(%p) : Setting rendertarget %d to %p\n", This, RenderTargetIndex, pRenderTarget);
|
||||||
|
|
||||||
|
@ -6220,7 +6220,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface,
|
||||||
This->render_targets[RenderTargetIndex] = pRenderTarget;
|
This->render_targets[RenderTargetIndex] = pRenderTarget;
|
||||||
|
|
||||||
/* Render target 0 is special */
|
/* Render target 0 is special */
|
||||||
if(RenderTargetIndex == 0 && dxVersion > 7) {
|
if(RenderTargetIndex == 0 && set_viewport) {
|
||||||
/* Finally, reset the viewport and scissor rect as the MSDN states.
|
/* Finally, reset the viewport and scissor rect as the MSDN states.
|
||||||
* Tests show that stateblock recording is ignored, the change goes
|
* Tests show that stateblock recording is ignored, the change goes
|
||||||
* directly into the primary stateblock.
|
* directly into the primary stateblock.
|
||||||
|
|
|
@ -3205,7 +3205,8 @@ interface IWineD3DDevice : IWineD3DBase
|
||||||
);
|
);
|
||||||
HRESULT SetRenderTarget(
|
HRESULT SetRenderTarget(
|
||||||
[in] DWORD render_target_idx,
|
[in] DWORD render_target_idx,
|
||||||
[in] IWineD3DSurface *render_target
|
[in] IWineD3DSurface *render_target,
|
||||||
|
[in] BOOL set_viewport
|
||||||
);
|
);
|
||||||
HRESULT GetRenderTarget(
|
HRESULT GetRenderTarget(
|
||||||
[in] DWORD render_target_idx,
|
[in] DWORD render_target_idx,
|
||||||
|
|
Loading…
Reference in New Issue