Commit b310e986 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Clean up drawprim a bit.

parent 4e8e47fc
...@@ -1092,29 +1092,6 @@ void drawStridedSoftwareVS(IWineD3DDevice *iface, WineDirect3DVertexStridedData ...@@ -1092,29 +1092,6 @@ void drawStridedSoftwareVS(IWineD3DDevice *iface, WineDirect3DVertexStridedData
#endif #endif
inline static void drawPrimitiveDrawStrided(
IWineD3DDevice *iface,
BOOL useVertexShaderFunction,
BOOL usePixelShaderFunction,
WineDirect3DVertexStridedData *dataLocations,
ULONG baseVIndex,
UINT numberOfvertices,
UINT numberOfIndicies,
GLenum glPrimType,
const void *idxData,
short idxSize,
int minIndex,
long StartIdx) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
/* Draw vertex-by-vertex */
if (This->useDrawStridedSlow)
drawStridedSlow(iface, dataLocations, numberOfIndicies, glPrimType, idxData, idxSize, minIndex, StartIdx, baseVIndex);
else
drawStridedFast(iface, numberOfIndicies, glPrimType, idxData, idxSize, minIndex, StartIdx, baseVIndex);
}
static void check_fbo_status(IWineD3DDevice *iface) { static void check_fbo_status(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
...@@ -1230,23 +1207,11 @@ void drawPrimitive(IWineD3DDevice *iface, ...@@ -1230,23 +1207,11 @@ void drawPrimitive(IWineD3DDevice *iface,
int minIndex) { int minIndex) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
BOOL useVertexShaderFunction = FALSE;
BOOL usePixelShaderFunction = FALSE;
IWineD3DSwapChainImpl *swapchain; IWineD3DSwapChainImpl *swapchain;
int i; int i;
DWORD dirtyState, idx; DWORD dirtyState, idx;
BYTE shift; BYTE shift;
/* Shaders can be implemented using ARB_PROGRAM, GLSL, or software -
* here simply check whether a shader was set, or the user disabled shaders */
if (This->vs_selected_mode != SHADER_NONE && This->stateBlock->vertexShader &&
((IWineD3DVertexShaderImpl *)This->stateBlock->vertexShader)->baseShader.function != NULL)
useVertexShaderFunction = TRUE;
if (This->ps_selected_mode != SHADER_NONE && This->stateBlock->pixelShader &&
((IWineD3DPixelShaderImpl *)This->stateBlock->pixelShader)->baseShader.function)
usePixelShaderFunction = TRUE;
/* Invalidate the back buffer memory so LockRect will read it the next time */ /* Invalidate the back buffer memory so LockRect will read it the next time */
for(i = 0; i < IWineD3DDevice_GetNumberOfSwapChains(iface); i++) { for(i = 0; i < IWineD3DDevice_GetNumberOfSwapChains(iface); i++) {
IWineD3DDevice_GetSwapChain(iface, i, (IWineD3DSwapChain **) &swapchain); IWineD3DDevice_GetSwapChain(iface, i, (IWineD3DSwapChain **) &swapchain);
...@@ -1289,9 +1254,12 @@ void drawPrimitive(IWineD3DDevice *iface, ...@@ -1289,9 +1254,12 @@ void drawPrimitive(IWineD3DDevice *iface,
if (numberOfVertices == 0 ) if (numberOfVertices == 0 )
numberOfVertices = calculatedNumberOfindices; numberOfVertices = calculatedNumberOfindices;
drawPrimitiveDrawStrided(iface, useVertexShaderFunction, usePixelShaderFunction, if (This->useDrawStridedSlow)
&This->strided_streams, StartVertexIndex, numberOfVertices, calculatedNumberOfindices, glPrimType, drawStridedSlow(iface, &This->strided_streams, calculatedNumberOfindices,
idxData, idxSize, minIndex, StartIdx); glPrimType, idxData, idxSize, minIndex, StartIdx, StartVertexIndex);
else
drawStridedFast(iface, calculatedNumberOfindices, glPrimType,
idxData, idxSize, minIndex, StartIdx, StartVertexIndex);
} }
/* Finshed updating the screen, restore lock */ /* Finshed updating the screen, restore lock */
......
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