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

wined3d: Flip the scissor rect when rendering offscreen.

parent 4194d784
...@@ -700,6 +700,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf ...@@ -700,6 +700,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
Context_MarkStateDirty(context, WINED3DTS_PROJECTION); Context_MarkStateDirty(context, WINED3DTS_PROJECTION);
Context_MarkStateDirty(context, STATE_VDECL); Context_MarkStateDirty(context, STATE_VDECL);
Context_MarkStateDirty(context, STATE_VIEWPORT); Context_MarkStateDirty(context, STATE_VIEWPORT);
Context_MarkStateDirty(context, STATE_SCISSORRECT);
} }
} else { } else {
...@@ -787,6 +788,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf ...@@ -787,6 +788,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
Context_MarkStateDirty(context, WINED3DTS_PROJECTION); Context_MarkStateDirty(context, WINED3DTS_PROJECTION);
Context_MarkStateDirty(context, STATE_VDECL); Context_MarkStateDirty(context, STATE_VDECL);
Context_MarkStateDirty(context, STATE_VIEWPORT); Context_MarkStateDirty(context, STATE_VIEWPORT);
Context_MarkStateDirty(context, STATE_SCISSORRECT);
} }
} }
if (readTexture) { if (readTexture) {
......
...@@ -4509,11 +4509,18 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun ...@@ -4509,11 +4509,18 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun
if (!curRect) { if (!curRect) {
/* In drawable flag is set below */ /* In drawable flag is set below */
if (This->render_offscreen) {
glScissor(This->stateBlock->viewport.X,
This->stateBlock->viewport.Y,
This->stateBlock->viewport.Width,
This->stateBlock->viewport.Height);
} else {
glScissor(This->stateBlock->viewport.X, glScissor(This->stateBlock->viewport.X,
(((IWineD3DSurfaceImpl *)This->render_targets[0])->currentDesc.Height - (((IWineD3DSurfaceImpl *)This->render_targets[0])->currentDesc.Height -
(This->stateBlock->viewport.Y + This->stateBlock->viewport.Height)), (This->stateBlock->viewport.Y + This->stateBlock->viewport.Height)),
This->stateBlock->viewport.Width, This->stateBlock->viewport.Width,
This->stateBlock->viewport.Height); This->stateBlock->viewport.Height);
}
checkGLcall("glScissor"); checkGLcall("glScissor");
glClear(glMask); glClear(glMask);
checkGLcall("glClear"); checkGLcall("glClear");
......
...@@ -3442,7 +3442,12 @@ static void scissorrect(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D ...@@ -3442,7 +3442,12 @@ static void scissorrect(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
winHeight = windowRect.bottom - windowRect.top; winHeight = windowRect.bottom - windowRect.top;
TRACE("(%p) Setting new Scissor Rect to %d:%d-%d:%d\n", stateblock->wineD3DDevice, pRect->left, pRect->bottom - winHeight, TRACE("(%p) Setting new Scissor Rect to %d:%d-%d:%d\n", stateblock->wineD3DDevice, pRect->left, pRect->bottom - winHeight,
pRect->right - pRect->left, pRect->bottom - pRect->top); pRect->right - pRect->left, pRect->bottom - pRect->top);
if (stateblock->wineD3DDevice->render_offscreen) {
glScissor(pRect->left, pRect->top, pRect->right - pRect->left, pRect->bottom - pRect->top);
} else {
glScissor(pRect->left, winHeight - pRect->bottom, pRect->right - pRect->left, pRect->bottom - pRect->top); glScissor(pRect->left, winHeight - pRect->bottom, pRect->right - pRect->left, pRect->bottom - pRect->top);
}
checkGLcall("glScissor"); checkGLcall("glScissor");
} }
......
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