[9/16] WineD3D: Move decoding the vertex declaration to the device

Ivan Gyurdiev ivg231 at gmail.com
Mon Jan 1 22:38:27 CST 2007


+    if (stateblock->wineD3DDevice->vs_selected_mode != SHADER_NONE && stateblock->vertexShader && 
+       ((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.function != NULL) 

+        memcpy(&stateblock->wineD3DDevice->strided_streams, stateblock->wineD3DDevice->up_strided, sizeof(stateblock->wineD3DDevice->strided_streams));

+            primitiveDeclarationConvertToStridedData((IWineD3DDevice *) stateblock->wineD3DDevice, useVertexShaderFunction, 
+                &stateblock->wineD3DDevice->strided_streams, &stateblock->wineD3DDevice->streamFixedUp);

My eyes hurt - can we *please* store the device in a local variable.

Also, I am not sure how we got to the point where this many upward references to the device from the stateblock are necessary - there has to be something wrong with that: a stateblock captures the state of a device, so why is it referring back to its parent device and looking up state there? This type of thing was introduced into the shader code as well, and IIRC it was wrong there too.

Also, all this transient data from the drawprim codepath moved into the device - can you explain again why that's necessary, does it really need to persist after the drawprim call?




More information about the wine-patches mailing list