Module: wine
Branch: master
Commit: a9d681c3ad26a4ee9a1d8536116044a3352f8f9b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a9d681c3ad26a4ee9a1d85361…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Mon Feb 19 15:26:31 2007 +0100
wined3d: With FVFs only one stream is used.
---
dlls/wined3d/drawprim.c | 83 +++++++++++++---------------------------------
1 files changed, 24 insertions(+), 59 deletions(-)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 7cf6877..9162c01 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -365,74 +365,39 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi
}
void primitiveConvertToStridedData(IWineD3DDevice *iface, WineDirect3DVertexStridedData *strided, BOOL *fixup) {
-
- short LoopThroughTo = 0;
- short nStream;
+ IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
GLint streamVBO = 0;
- DWORD preLoadStreams[MAX_STREAMS], numPreloadStreams = 0;
-
- IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
-
- /* OK, Now to setup the data locations
- For the non-created vertex shaders, the VertexShader var holds the real
- FVF and only stream 0 matters
- For the created vertex shaders, there is an FVF per stream */
- if (!This->stateBlock->streamIsUP && !(This->stateBlock->vertexShader == NULL)) {
- LoopThroughTo = MAX_STREAMS;
+ DWORD stride = This->stateBlock->streamStride[0];
+ BYTE *data = NULL;
+ DWORD thisFVF = 0;
+
+ /* Retrieve appropriate FVF */
+ thisFVF = This->stateBlock->fvf;
+ /* Handle memory passed directly as well as vertex buffers */
+ if (This->stateBlock->streamIsUP) {
+ streamVBO = 0;
+ data = (BYTE *)This->stateBlock->streamSource[0];
} else {
- LoopThroughTo = 1;
+ /* The for loop should iterate through here only once per stream, so we don't need magic to prevent double loading
+ * buffers
+ */
+ data = IWineD3DVertexBufferImpl_GetMemory(This->stateBlock->streamSource[0], 0, &streamVBO);
+ if(fixup) {
+ if(streamVBO != 0 ) *fixup = TRUE;
+ }
}
+ VTRACE(("FVF for stream 0 is %lx\n", thisFVF));
- /* Work through stream by stream */
- for (nStream=0; nStream<LoopThroughTo; ++nStream) {
- DWORD stride = This->stateBlock->streamStride[nStream];
- BYTE *data = NULL;
- DWORD thisFVF = 0;
-
- /* Skip empty streams */
- if (This->stateBlock->streamSource[nStream] == NULL) continue;
-
- /* Retrieve appropriate FVF */
- if (LoopThroughTo == 1) { /* Use FVF, not vertex shader */
- thisFVF = This->stateBlock->fvf;
- /* Handle memory passed directly as well as vertex buffers */
- if (This->stateBlock->streamIsUP) {
- streamVBO = 0;
- data = (BYTE *)This->stateBlock->streamSource[nStream];
- } else {
- /* 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) {
- if(streamVBO != 0 ) *fixup = TRUE;
- }
- }
- } else {
-#if 0 /* TODO: Vertex shader support */
- thisFVF = This->stateBlock->vertexShaderDecl->fvf[nStream];
- data = IWineD3DVertexBufferImpl_GetMemory(This->stateBlock->streamSource[nStream], 0);
-#endif
- }
- VTRACE(("FVF for stream %d is %lx\n", nStream, thisFVF));
- if (thisFVF == 0) continue;
+ /* Now convert the stream into pointers */
+ primitiveConvertFVFtoOffset(thisFVF, stride, data, strided, streamVBO, 0);
- /* Now convert the stream into pointers */
- primitiveConvertFVFtoOffset(thisFVF, stride, data, strided, streamVBO, nStream);
- }
- /* Now call PreLoad on all the vertex buffers. In the very rare case
+ /* Now call PreLoad on the vertex buffer. 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(!This->stateBlock->streamIsUP) {
+ IWineD3DVertexBuffer_PreLoad(This->stateBlock->streamSource[0]);
}
}
Module: wine
Branch: master
Commit: 1f1d0cda22804132807a2c5272575c998bb29d7d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1f1d0cda22804132807a2c527…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Mon Feb 19 15:24:26 2007 +0100
wined3d: Misc comment updates.
---
dlls/wined3d/device.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 3e66075..333e79b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2021,16 +2021,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetStreamSource(IWineD3DDevice *iface,
return WINED3D_OK;
}
-/*Should be quite easy, just an extension of vertexdata
-ref...
-http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c_Summer_04/directx/graphics/programmingguide/advancedtopics/DrawingMultipleInstances.asp
-
-The divider is a bit odd though
-
-VertexOffset = StartVertex / Divider * StreamStride +
- VertexIndex / Divider * StreamStride + StreamOffset
-
-*/
static HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSourceFreq(IWineD3DDevice *iface, UINT StreamNumber, UINT Divider) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
UINT oldFlags = This->updateStateBlock->streamFlags[StreamNumber];
@@ -2150,8 +2140,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_MultiplyTransform(IWineD3DDevice *iface
*****/
/* Note lights are real special cases. Although the device caps state only eg. 8 are supported,
you can reference any indexes you want as long as that number max are enabled at any
- one point in time! Therefore since the indexes can be anything, we need a linked list of them.
- However, this causes stateblock problems. When capturing the state block, I duplicate the list,
+ one point in time! Therefore since the indexes can be anything, we need a hashmap of them.
+ However, this causes stateblock problems. When capturing the state block, I duplicate the hashmap,
but when recording, just build a chain pretty much of commands to be replayed. */
static HRESULT WINAPI IWineD3DDeviceImpl_SetLight(IWineD3DDevice *iface, DWORD Index, CONST WINED3DLIGHT* pLight) {