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