wined3d: Make use_vs() safe to call from IWineD3DDeviceImpl_FindTexUnitMap().

This commit is contained in:
Henri Verbeet 2009-08-19 10:55:35 +02:00 committed by Alexandre Julliard
parent 43a35958f6
commit 92b66ac82c
1 changed files with 5 additions and 1 deletions

View File

@ -2885,8 +2885,12 @@ const struct GlPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const stru
static inline BOOL use_vs(IWineD3DStateBlockImpl *stateblock)
{
/* Check stateblock->vertexDecl to allow this to be used from
* IWineD3DDeviceImpl_FindTexUnitMap(). This is safe because
* stateblock->vertexShader implies a vertex declaration instead of ddraw
* style strided data. */
return (stateblock->vertexShader
&& !stateblock->wineD3DDevice->strided_streams.position_transformed
&& !((IWineD3DVertexDeclarationImpl *)stateblock->vertexDecl)->position_transformed
&& stateblock->wineD3DDevice->vs_selected_mode != SHADER_NONE);
}