Module: wine
Branch: master
Commit: dbedc885daf37b53400485d6c936a9a2349fc836
URL: http://source.winehq.org/git/wine.git/?a=commit;h=dbedc885daf37b53400485d6c…
Author: Jonathan Ernst <jonathan(a)ernstfamily.ch>
Date: Sun Jan 7 00:01:47 2007 +0100
localspl: Added French translation.
---
dlls/localspl/localspl.rc | 1 +
dlls/localspl/spl_Fr.rc | 28 ++++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/dlls/localspl/localspl.rc b/dlls/localspl/localspl.rc
index a9ca999..73d58d8 100644
--- a/dlls/localspl/localspl.rc
+++ b/dlls/localspl/localspl.rc
@@ -38,5 +38,6 @@
#include "spl_En.rc"
#include "spl_De.rc"
+#include "spl_Fr.rc"
#include "spl_Ko.rc"
#include "spl_No.rc"
diff --git a/dlls/localspl/spl_Fr.rc b/dlls/localspl/spl_Fr.rc
new file mode 100644
index 0000000..cafe232
--- /dev/null
+++ b/dlls/localspl/spl_Fr.rc
@@ -0,0 +1,28 @@
+/*
+ * French resources for localspl
+ *
+ * Copyright 2007 Jonathan Ernst
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
+
+STRINGTABLE DISCARDABLE
+{
+ IDS_LOCALPORT "Port local"
+ IDS_LOCALMONITOR "Moniteur local"
+ IDS_NOTHINGTOCONFIG "Ce port n'a pas d'option � configurer"
+}
Module: wine
Branch: master
Commit: 9f2e0fa2e09345a93fbdee852b933937c6ef98f2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9f2e0fa2e09345a93fbdee852…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Sat Jan 6 18:41:43 2007 +0100
wined3d: Do not try to read the vertex decl when the stateblock isn't finalized.
---
dlls/wined3d/drawprim.c | 6 ++++++
dlls/wined3d/vertexbuffer.c | 15 ++++++++++++++-
dlls/wined3d/wined3d_private.h | 1 +
3 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 129c42e..cf47106 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -1247,6 +1247,9 @@ void drawPrimitive(IWineD3DDevice *iface
DWORD dirtyState, idx;
BYTE shift;
+ /* Signals other modules that a drawing is in progress and the stateblock finalized */
+ This->isInDraw = TRUE;
+
/* Invalidate the back buffer memory so LockRect will read it the next time */
for(i = 0; i < IWineD3DDevice_GetNumberOfSwapChains(iface); i++) {
IWineD3DDevice_GetSwapChain(iface, i, (IWineD3DSwapChain **) &swapchain);
@@ -1340,4 +1343,7 @@ void drawPrimitive(IWineD3DDevice *iface
++primCounter;
}
#endif
+
+ /* Control goes back to the device, stateblock values may change again */
+ This->isInDraw = FALSE;
}
diff --git a/dlls/wined3d/vertexbuffer.c b/dlls/wined3d/vertexbuffer.c
index b89d922..181c244 100644
--- a/dlls/wined3d/vertexbuffer.c
+++ b/dlls/wined3d/vertexbuffer.c
@@ -258,7 +258,20 @@ static void WINAPI IWineD3DVertexBuf
return; /* Not doing any conversion */
}
- declChanged = IWineD3DVertexBufferImpl_FindDecl(This);
+ /* Reading the declaration makes only sense if the stateblock is finalized and the buffer bound to a stream */
+ if(This->resource.wineD3DDevice->isInDraw && This->Flags & VBFLAG_STREAM) {
+ declChanged = IWineD3DVertexBufferImpl_FindDecl(This);
+ } else if(This->Flags & VBFLAG_HASDESC) {
+ /* Reuse the declaration stored in the buffer. It will most likely not change, and if it does
+ * the stream source state handler will call PreLoad again and the change will be cought
+ */
+ } else {
+ /* Cannot get a declaration, and no declaration is stored in the buffer. It is pointless to preload
+ * now. When the buffer is used, PreLoad will be called by the stream source state handler and a valid
+ * declaration for the buffer can be found
+ */
+ return;
+ }
/* If applications change the declaration over and over, reconverting all the time is a huge
* performance hit. So count the declaration changes and release the VBO if there are too much
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e8b60de..f50182a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -588,6 +588,7 @@ typedef struct IWineD3DDeviceImpl
BOOL isRecordingState;
IWineD3DStateBlockImpl *stateBlock;
IWineD3DStateBlockImpl *updateStateBlock;
+ BOOL isInDraw;
/* Internal use fields */
WINED3DDEVICE_CREATION_PARAMETERS createParms;
Module: wine
Branch: master
Commit: d47ec212807e2e7a4e9ba47b5fc4a0082dc0f966
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d47ec212807e2e7a4e9ba47b5…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Sat Jan 6 18:31:43 2007 +0100
wined3d: Vertex buffers can use the declaration from the device.
---
dlls/wined3d/drawprim.c | 39 +++++++++++++++++++++++++++++++-
dlls/wined3d/vertexbuffer.c | 51 ++++++++++++++++---------------------------
2 files changed, 56 insertions(+), 34 deletions(-)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 3b14c4a..129c42e 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -219,6 +219,10 @@ void primitiveDeclarationConvertToStride
WINED3DVERTEXELEMENT *element;
DWORD stride;
int reg;
+ char isPreLoaded[MAX_STREAMS];
+ DWORD preLoadStreams[MAX_STREAMS], numPreloadStreams = 0;
+
+ memset(isPreLoaded, 0, sizeof(isPreLoaded));
/* Locate the vertex declaration */
if (This->stateBlock->vertexShader && ((IWineD3DVertexShaderImpl *)This->stateBlock->vertexShader)->vertexDeclaration) {
@@ -249,7 +253,11 @@ void primitiveDeclarationConvertToStride
if(fixup && *fixup) FIXME("Missing fixed and unfixed vertices, expect graphics glitches\n");
} else {
TRACE("Stream isn't up %d, %p\n", element->Stream, This->stateBlock->streamSource[element->Stream]);
- IWineD3DVertexBuffer_PreLoad(This->stateBlock->streamSource[element->Stream]);
+ if(!isPreLoaded[element->Stream]) {
+ preLoadStreams[numPreloadStreams] = element->Stream;
+ numPreloadStreams++;
+ isPreLoaded[element->Stream] = 1;
+ }
data = IWineD3DVertexBufferImpl_GetMemory(This->stateBlock->streamSource[element->Stream], 0, &streamVBO);
if(fixup) {
if( streamVBO != 0) *fixup = TRUE;
@@ -287,6 +295,17 @@ void primitiveDeclarationConvertToStride
}
}
};
+ /* Now call PreLoad on all the vertex buffers. In the very rare case
+ * that the buffers stopps converting PreLoad will dirtify the VDECL again.
+ * The vertex buffer can now use the strided structure in the device instead of finding its
+ * own again.
+ *
+ * NULL streams won't be recorded in the array, UP streams won't be either. A stream is only
+ * once in there.
+ */
+ for(i=0; i < numPreloadStreams; i++) {
+ IWineD3DVertexBuffer_PreLoad(This->stateBlock->streamSource[preLoadStreams[i]]);
+ }
}
void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDirect3DVertexStridedData *strided, GLint streamVBO) {
@@ -413,6 +432,7 @@ void primitiveConvertToStridedData(IWine
short LoopThroughTo = 0;
short nStream;
GLint streamVBO = 0;
+ DWORD preLoadStreams[MAX_STREAMS], numPreloadStreams = 0;
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
@@ -443,7 +463,11 @@ void primitiveConvertToStridedData(IWine
streamVBO = 0;
data = (BYTE *)This->stateBlock->streamSource[nStream];
} else {
- IWineD3DVertexBuffer_PreLoad(This->stateBlock->streamSource[nStream]);
+ /* The for loop should iterate through here only once per stream, so we don't need magic to prevent double loading
+ * buffers
+ */
+ preLoadStreams[numPreloadStreams] = nStream;
+ numPreloadStreams++;
/* GetMemory binds the VBO */
data = IWineD3DVertexBufferImpl_GetMemory(This->stateBlock->streamSource[nStream], 0, &streamVBO);
if(fixup) {
@@ -462,6 +486,17 @@ void primitiveConvertToStridedData(IWine
/* Now convert the stream into pointers */
primitiveConvertFVFtoOffset(thisFVF, stride, data, strided, streamVBO);
}
+ /* Now call PreLoad on all the vertex buffers. In the very rare case
+ * that the buffers stopps converting PreLoad will dirtify the VDECL again.
+ * The vertex buffer can now use the strided structure in the device instead of finding its
+ * own again.
+ *
+ * NULL streams won't be recorded in the array, UP streams won't be either. A stream is only
+ * once in there.
+ */
+ for(nStream=0; nStream < numPreloadStreams; nStream++) {
+ IWineD3DVertexBuffer_PreLoad(This->stateBlock->streamSource[preLoadStreams[nStream]]);
+ }
}
#if 0 /* TODO: Software Shaders */
diff --git a/dlls/wined3d/vertexbuffer.c b/dlls/wined3d/vertexbuffer.c
index 2f8a4f7..b89d922 100644
--- a/dlls/wined3d/vertexbuffer.c
+++ b/dlls/wined3d/vertexbuffer.c
@@ -164,7 +164,6 @@ inline BOOL WINAPI IWineD3DVertexBufferI
{
WineDirect3DVertexStridedData strided;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
- BOOL ret;
memset(&strided, 0, sizeof(strided));
/* There are certain vertex data types that need to be fixed up. The Vertex Buffers FVF doesn't
@@ -191,38 +190,18 @@ inline BOOL WINAPI IWineD3DVertexBufferI
* FALSE: otherwise
*/
- if(device->stateBlock->vertexShader != NULL && wined3d_settings.vs_mode != VS_NONE
- &&((IWineD3DVertexShaderImpl *)device->stateBlock->vertexShader)->baseShader.function != NULL
- && GL_SUPPORT(ARB_VERTEX_PROGRAM)) {
- /* Case 1: Vertex Shader: No conversion */
- TRACE("Vertex Shader, no conversion needed\n");
- } else if(device->stateBlock->vertexDecl || device->stateBlock->vertexShader) {
- /* Case 2: Vertex Declaration */
- TRACE("Using vertex declaration\n");
-
- This->Flags |= VBFLAG_LOAD;
- primitiveDeclarationConvertToStridedData((IWineD3DDevice *) device,
- FALSE,
- &strided,
- &ret /* buffer contains fixed data, ignored here */);
- This->Flags &= ~VBFLAG_LOAD;
-
+ if(device->stateBlock->vertexShader && ((IWineD3DVertexShaderImpl *) device->stateBlock->vertexShader)->baseShader.function) {
+ /* Assume no conversion */
+ memset(&strided, 0, sizeof(strided));
} else {
- /* Case 3: FVF */
- if(!(This->Flags & VBFLAG_STREAM) ) {
- TRACE("No vertex decl used and buffer is not bound to a stream\n");
- /* No reload needed */
- return FALSE;
- } else {
- This->Flags |= VBFLAG_LOAD;
- primitiveConvertFVFtoOffset(device->stateBlock->fvf,
- device->stateBlock->streamStride[This->stream],
- NULL,
- &strided,
- This->vbo);
- This->Flags &= ~VBFLAG_LOAD;
- /* Data can only come from this buffer */
- }
+ /* we need a copy because we modify some params */
+ memcpy(&strided, &device->strided_streams, sizeof(strided));
+
+ /* Filter out data that does not come from this VBO */
+ if(strided.u.s.position.VBO != This->vbo) memset(&strided.u.s.position, 0, sizeof(strided.u.s.position));
+ if(strided.u.s.diffuse.VBO != This->vbo) memset(&strided.u.s.diffuse, 0, sizeof(strided.u.s.diffuse));
+ if(strided.u.s.specular.VBO != This->vbo) memset(&strided.u.s.specular, 0, sizeof(strided.u.s.specular));
+ if(strided.u.s.position2.VBO != This->vbo) memset(&strided.u.s.position2, 0, sizeof(strided.u.s.position2));
}
/* Filter out data that does not come from this VBO */
@@ -297,6 +276,14 @@ static void WINAPI IWineD3DVertexBuf
checkGLcall("glDeleteBuffersARB");
LEAVE_GL();
This->vbo = 0;
+
+ /* The stream source state handler might have read the memory of the vertex buffer already
+ * and got the memory in the vbo which is not valid any longer. Dirtify the stream source
+ * to force a reload. This happens only once per changed vertexbuffer and should occur rather
+ * rarely
+ */
+ IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_STREAMSRC);
+
return;
}
/* Otherwise do not bother to release the VBO. If we're doing direct locking now,