H. Verbeet : wined3d: Call ActivateContext regardless of WINED3DCREATE_MULTITHREADED.
Alexandre Julliard
julliard at winehq.org
Thu Jan 3 06:43:39 CST 2008
Module: wine
Branch: master
Commit: c46c53a12c1cacb11435442156831ff4d48f9b9c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c46c53a12c1cacb11435442156831ff4d48f9b9c
Author: H. Verbeet <hverbeet at gmail.com>
Date: Wed Jan 2 19:51:51 2008 +0100
wined3d: Call ActivateContext regardless of WINED3DCREATE_MULTITHREADED.
---
dlls/wined3d/device.c | 12 +++---------
dlls/wined3d/indexbuffer.c | 4 +---
dlls/wined3d/surface.c | 5 ++---
3 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 9ebce5e..30f7b61 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4246,12 +4246,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface,
ERR("Output vertex declaration not implemented yet\n");
}
- /* Need any context to write to the vbo. In a non-multithreaded environment a context is there anyway,
- * and this call is quite performance critical, so don't call needlessly
- */
- if(This->createParms.BehaviorFlags & WINED3DCREATE_MULTITHREADED) {
- ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
- }
+ /* Need any context to write to the vbo. */
+ ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
/* ProcessVertices reads from vertex buffers, which have to be assigned. DrawPrimitive and DrawPrimitiveUP
* control the streamIsUP flag, thus restore it afterwards.
@@ -4741,9 +4737,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EndScene(IWineD3DDevice *iface) {
return WINED3DERR_INVALIDCALL;
}
- if(This->createParms.BehaviorFlags & WINED3DCREATE_MULTITHREADED) {
- ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
- }
+ ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
/* We only have to do this if we need to read the, swapbuffers performs a flush for us */
ENTER_GL();
glFlush();
diff --git a/dlls/wined3d/indexbuffer.c b/dlls/wined3d/indexbuffer.c
index 62d90d1..bcfb0e6 100644
--- a/dlls/wined3d/indexbuffer.c
+++ b/dlls/wined3d/indexbuffer.c
@@ -158,9 +158,7 @@ static HRESULT WINAPI IWineD3DIndexBufferImpl_Unlock(IWineD3DIndexBuffer *iface)
if(locks == 0 && This->vbo && (This->dirtyend - This->dirtystart) > 0) {
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
- if(device->createParms.BehaviorFlags & WINED3DCREATE_MULTITHREADED) {
- ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
- }
+ ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
ENTER_GL();
GL_EXTCALL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, This->vbo));
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 489f72e..29bc21c 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -44,9 +44,8 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) {
return;
}
- if(myDevice->createParms.BehaviorFlags & WINED3DCREATE_MULTITHREADED) {
- ActivateContext(myDevice, myDevice->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
- }
+ ActivateContext(myDevice, myDevice->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
+
if(This->Flags & SFLAG_CONVERTED) {
FIXME("Read back converted textures unsupported, format=%s\n", debug_d3dformat(This->resource.format));
return;
More information about the wine-cvs
mailing list