Commit cc447eac authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Move position_transformed out of u.s in struct WineDirect3DVertexStridedData.

parent 1a1f5ec6
......@@ -4003,9 +4003,9 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface,
if (VertexType & D3DFVF_XYZRHW)
{
WineD3DStrided.u.s.position.dwType = WINED3DDECLTYPE_FLOAT4;
WineD3DStrided.u.s.position_transformed = TRUE;
WineD3DStrided.position_transformed = TRUE;
} else
WineD3DStrided.u.s.position_transformed = FALSE;
WineD3DStrided.position_transformed = FALSE;
}
if(VertexType & D3DFVF_NORMAL)
......@@ -4181,9 +4181,9 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface,
if (VertexType & D3DFVF_XYZRHW)
{
WineD3DStrided.u.s.position.dwType = WINED3DDECLTYPE_FLOAT4;
WineD3DStrided.u.s.position_transformed = TRUE;
WineD3DStrided.position_transformed = TRUE;
} else
WineD3DStrided.u.s.position_transformed = FALSE;
WineD3DStrided.position_transformed = FALSE;
}
if(VertexType & D3DFVF_NORMAL)
......
......@@ -152,7 +152,7 @@ void primitiveDeclarationConvertToStridedData(
const DWORD *streams = vertexDeclaration->streams;
/* Check for transformed vertices, disable vertex shader if present */
strided->u.s.position_transformed = vertexDeclaration->position_transformed;
strided->position_transformed = vertexDeclaration->position_transformed;
if(vertexDeclaration->position_transformed) {
useVertexShaderFunction = FALSE;
}
......@@ -861,8 +861,9 @@ void drawPrimitive(IWineD3DDevice *iface, int PrimitiveType, long NumPrimitives,
if (!use_vs(This->stateBlock))
{
if(!This->strided_streams.u.s.position_transformed && This->activeContext->num_untracked_materials &&
This->stateBlock->renderState[WINED3DRS_LIGHTING]) {
if (!This->strided_streams.position_transformed && This->activeContext->num_untracked_materials
&& This->stateBlock->renderState[WINED3DRS_LIGHTING])
{
static BOOL warned;
if (!warned) {
FIXME("Using software emulation because not all material properties could be tracked\n");
......@@ -1027,9 +1028,8 @@ HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This,
vtxStride * info->StartVertexOffsetWidth;
/* Not entirely sure about what happens with transformed vertices */
if(strided.u.s.position_transformed) {
FIXME("Transformed position in rectpatch generation\n");
}
if (strided.position_transformed) FIXME("Transformed position in rectpatch generation\n");
if(vtxStride % sizeof(GLfloat)) {
/* glMap2f reads vertex sizes in GLfloats, the d3d stride is in bytes.
* I don't see how the stride could not be a multiple of 4, but make sure
......
......@@ -477,7 +477,8 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp
}
if (shader->baseShader.reg_maps.shader_version >= WINED3DPS_VERSION(3,0))
{
if(((IWineD3DDeviceImpl *) shader->baseShader.device)->strided_streams.u.s.position_transformed) {
if (((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.position_transformed)
{
args->vp_mode = pretransformed;
}
else if (use_vs(stateblock))
......@@ -492,7 +493,7 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp
if(stateblock->renderState[WINED3DRS_FOGENABLE]) {
switch(stateblock->renderState[WINED3DRS_FOGTABLEMODE]) {
case WINED3DFOG_NONE:
if (((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.u.s.position_transformed
if (((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.position_transformed
|| use_vs(stateblock))
{
args->fog = FOG_LINEAR;
......
......@@ -95,7 +95,7 @@ static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
transformed = ((stateblock->wineD3DDevice->strided_streams.u.s.position.lpData != NULL ||
stateblock->wineD3DDevice->strided_streams.u.s.position.VBO != 0) &&
stateblock->wineD3DDevice->strided_streams.u.s.position_transformed) ? TRUE : FALSE;
stateblock->wineD3DDevice->strided_streams.position_transformed) ? TRUE : FALSE;
if (stateblock->renderState[WINED3DRS_LIGHTING] && !transformed) {
glEnable(GL_LIGHTING);
......@@ -4321,9 +4321,7 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
useVertexShaderFunction, dataLocations, &fixup);
}
if (dataLocations->u.s.position_transformed) {
useVertexShaderFunction = FALSE;
}
if (dataLocations->position_transformed) useVertexShaderFunction = FALSE;
if(useVertexShaderFunction) {
if(((IWineD3DVertexDeclarationImpl *) stateblock->vertexDecl)->half_float_conv_needed && !fixup) {
......@@ -4403,7 +4401,7 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W
updateFog = TRUE;
}
transformed = device->strided_streams.u.s.position_transformed;
transformed = device->strided_streams.position_transformed;
if(transformed != context->last_was_rhw && !useVertexShaderFunction) {
updateFog = TRUE;
}
......
......@@ -2454,7 +2454,7 @@ const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt,
static inline BOOL use_vs(IWineD3DStateBlockImpl *stateblock)
{
return (stateblock->vertexShader
&& !stateblock->wineD3DDevice->strided_streams.u.s.position_transformed
&& !stateblock->wineD3DDevice->strided_streams.position_transformed
&& stateblock->wineD3DDevice->vs_selected_mode != SHADER_NONE);
}
......
......@@ -1879,10 +1879,11 @@ typedef struct WineDirect3DVertexStridedData
WineDirect3DStridedData sample;
/* Add fields here */
BOOL position_transformed;
} s;
WineDirect3DStridedData input[16]; /* Indexed by constants in D3DVSDE_REGISTER */
} u;
BOOL position_transformed;
} WineDirect3DVertexStridedData;
typedef struct _WINED3DVSHADERCAPS2_0
......
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