winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1085 discussions
Start a n
N
ew thread
Stefan Dösinger : wined3d: Non-primary stateblocks also hold an internal reference to buffers.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: d170aabe2087c969dd7f2711c10810bf4895481b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d170aabe2087c969dd7f2711c…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Aug 19 20:40:44 2007 +0200 wined3d: Non-primary stateblocks also hold an internal reference to buffers. --- dlls/wined3d/device.c | 21 +++++++++++++++++++++ dlls/wined3d/stateblock.c | 32 ++++++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 2b2dac5..6b53729 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -514,6 +514,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, } } + for(i = 0; i < MAX_STREAMS; i++) { + if(object->streamSource[i]) { + IWineD3DVertexBuffer_AddRef(object->streamSource[i]); + } + } + } else if (Type == WINED3DSBT_PIXELSTATE) { TRACE("PIXELSTATE => Pretend all pixel shates have changed\n"); @@ -560,6 +566,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, } } + /* Pixel state blocks do not contain vertex buffers. Set them to NULL to avoid wrong refcounting + * on them. This makes releasing the buffer easier + */ + for(i = 0; i < MAX_STREAMS; i++) { + object->streamSource[i] = NULL; + } + } else if (Type == WINED3DSBT_VERTEXSTATE) { TRACE("VERTEXSTATE => Pretend all vertex shates have changed\n"); @@ -613,6 +626,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, light->enabledChanged = TRUE; } } + + for(i = 0; i < MAX_STREAMS; i++) { + if(object->streamSource[i]) { + IWineD3DVertexBuffer_AddRef(object->streamSource[i]); + } + } } else { FIXME("Unrecognized state block type %d\n", Type); } @@ -2237,6 +2256,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSource(IWineD3DDevice *iface, /* Handle recording of state blocks */ if (This->isRecordingState) { TRACE("Recording... not performing anything\n"); + if(pStreamData) IWineD3DVertexBuffer_AddRef(pStreamData); + if(oldSrc) IWineD3DVertexBuffer_Release(oldSrc); return WINED3D_OK; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index dfe62c9..0362053 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -262,15 +262,15 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) { } } } - for (counter = 0; counter < MAX_STREAMS; counter++) { - if(This->streamSource[counter]) { - if(0 != IWineD3DVertexBuffer_Release(This->streamSource[counter])) { - TRACE("Vertex buffer still referenced by stateblock, applications has leaked Stream %u, buffer %p\n", counter, This->streamSource[counter]); - } - } - } if(This->pIndexData) IWineD3DIndexBuffer_Release(This->pIndexData); + } + for (counter = 0; counter < MAX_STREAMS; counter++) { + if(This->streamSource[counter]) { + if(0 != IWineD3DVertexBuffer_Release(This->streamSource[counter])) { + TRACE("Vertex buffer still referenced by stateblock, applications has leaked Stream %u, buffer %p\n", counter, This->streamSource[counter]); + } + } } for(counter = 0; counter < LIGHTMAP_SIZE; counter++) { @@ -532,6 +532,8 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) TRACE("Updating stream source %d to %p, stride to %d\n", i, targetStateBlock->streamSource[i], targetStateBlock->streamStride[i]); This->streamStride[i] = targetStateBlock->streamStride[i]; + if(targetStateBlock->streamSource[i]) IWineD3DVertexBuffer_AddRef(targetStateBlock->streamSource[i]); + if(This->streamSource[i]) IWineD3DVertexBuffer_Release(This->streamSource[i]); This->streamSource[i] = targetStateBlock->streamSource[i]; } @@ -600,7 +602,6 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) memcpy(This->vertexShaderConstantF, targetStateBlock->vertexShaderConstantF, sizeof(float) * GL_LIMITS(vshader_constantsF) * 4); memcpy(This->streamStride, targetStateBlock->streamStride, sizeof(This->streamStride)); memcpy(This->streamOffset, targetStateBlock->streamOffset, sizeof(This->streamOffset)); - memcpy(This->streamSource, targetStateBlock->streamSource, sizeof(This->streamSource)); memcpy(This->streamFreq, targetStateBlock->streamFreq, sizeof(This->streamFreq)); memcpy(This->streamFlags, targetStateBlock->streamFlags, sizeof(This->streamFlags)); This->pIndexData = targetStateBlock->pIndexData; @@ -621,6 +622,14 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) memcpy(This->textureState, targetStateBlock->textureState, sizeof(This->textureState)); memcpy(This->samplerState, targetStateBlock->samplerState, sizeof(This->samplerState)); This->scissorRect = targetStateBlock->scissorRect; + + for(i = 0; i < MAX_STREAMS; i++) { + if(targetStateBlock->streamSource[i] != This->streamSource[i]) { + if(targetStateBlock->streamSource[i]) IWineD3DVertexBuffer_AddRef(targetStateBlock->streamSource[i]); + if(This->streamSource[i]) IWineD3DVertexBuffer_Release(This->streamSource[i]); + This->streamSource[i] = targetStateBlock->streamSource[i]; + } + } } else if(This->blockType == WINED3DSBT_VERTEXSTATE) { This->vertexShader = targetStateBlock->vertexShader; memcpy(This->vertexShaderConstantB, targetStateBlock->vertexShaderConstantB, sizeof(This->vertexShaderConstantI)); @@ -640,6 +649,13 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) This->textureState[j][SavedVertexStates_R[i]] = targetStateBlock->textureState[j][SavedVertexStates_R[i]]; } } + for(i = 0; i < MAX_STREAMS; i++) { + if(targetStateBlock->streamSource[i] != This->streamSource[i]) { + if(targetStateBlock->streamSource[i]) IWineD3DVertexBuffer_AddRef(targetStateBlock->streamSource[i]); + if(This->streamSource[i]) IWineD3DVertexBuffer_Release(This->streamSource[i]); + This->streamSource[i] = targetStateBlock->streamSource[i]; + } + } } else if(This->blockType == WINED3DSBT_PIXELSTATE) { This->pixelShader = targetStateBlock->pixelShader; memcpy(This->pixelShaderConstantB, targetStateBlock->pixelShaderConstantB, sizeof(This->pixelShaderConstantI));
1
0
0
0
Stefan Dösinger : wined3d: Add the copied light to the right stateblock.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: f7530729d5854e3cc1750efc4882c9f154352835 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f7530729d5854e3cc1750efc4…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Thu Aug 16 13:30:42 2007 +0200 wined3d: Add the copied light to the right stateblock. --- dlls/wined3d/stateblock.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 6ab6247..dfe62c9 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -186,8 +186,8 @@ void stateblock_copy( PLIGHTINFOEL *light = LIST_ENTRY(e1, PLIGHTINFOEL, entry), *light2; light2 = HeapAlloc(GetProcessHeap(), 0, sizeof(*light)); memcpy(light2, light, sizeof(*light)); - list_add_tail(&This->lightMap[l], &light2->entry); - if(light2->glIndex != -1) This->activeLights[light2->glIndex] = light2; + list_add_tail(&Dest->lightMap[l], &light2->entry); + if(light2->glIndex != -1) Dest->activeLights[light2->glIndex] = light2; } }
1
0
0
0
Stefan Dösinger : wined3d: BaseVertexIndex can be negative.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 6ec6c941fabbbb7cbfedce17017bee40ded16709 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ec6c941fabbbb7cbfedce170…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Aug 25 00:09:33 2007 +0200 wined3d: BaseVertexIndex can be negative. --- dlls/d3d8/device.c | 9 ++++++++- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/drawprim.c | 20 ++++++++++++++++++-- dlls/wined3d/wined3d_private.h | 4 ++-- include/wine/wined3d_interface.h | 4 ++-- 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 74a0d13..205120e 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1803,6 +1803,12 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, I TRACE("(%p) Relay\n", This); EnterCriticalSection(&d3d8_cs); + /* WineD3D takes an INT(due to d3d9), but d3d8 uses UINTs. Do I have to add a check here that + * the UINT doesn't cause an overflow in the INT? It seems rather unlikely because such large + * vertex buffers can't be created to address them with an index that requires the 32nd bit + * (4 Byte minimum vertex size * 2^31-1 -> 8 gb buffer. The index sign would be the least + * problem) + */ IWineD3DDevice_SetBaseVertexIndex(This->WineD3DDevice, baseVertexIndex); hr = IWineD3DDevice_SetIndices(This->WineD3DDevice, pIndexData ? ((IDirect3DIndexBuffer8Impl *)pIndexData)->wineD3DIndexBuffer : NULL); @@ -1822,7 +1828,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, I } EnterCriticalSection(&d3d8_cs); - IWineD3DDevice_GetBaseVertexIndex(This->WineD3DDevice, pBaseVertexIndex); + /* The case from UINT to INT is safe because d3d8 will never set negative values */ + IWineD3DDevice_GetBaseVertexIndex(This->WineD3DDevice, (INT *) pBaseVertexIndex); rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData); if (SUCCEEDED(rc) && retIndexData) { IWineD3DIndexBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 425ffe2..2b2dac5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2829,7 +2829,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetIndices(IWineD3DDevice *iface, IWine } /* Method to offer d3d9 a simple way to set the base vertex index without messing with the index buffer */ -static HRESULT WINAPI IWineD3DDeviceImpl_SetBaseVertexIndex(IWineD3DDevice *iface, UINT BaseIndex) { +static HRESULT WINAPI IWineD3DDeviceImpl_SetBaseVertexIndex(IWineD3DDevice *iface, INT BaseIndex) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; TRACE("(%p)->(%d)\n", This, BaseIndex); @@ -2849,7 +2849,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetBaseVertexIndex(IWineD3DDevice *ifac return WINED3D_OK; } -static HRESULT WINAPI IWineD3DDeviceImpl_GetBaseVertexIndex(IWineD3DDevice *iface, UINT* base_index) { +static HRESULT WINAPI IWineD3DDeviceImpl_GetBaseVertexIndex(IWineD3DDevice *iface, INT* base_index) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; TRACE("(%p) : base_index %p\n", This, base_index); diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 3a47912..2dcaa5d 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -178,6 +178,7 @@ void primitiveDeclarationConvertToStridedData( if (This->stateBlock->streamSource[element->Stream] == NULL) continue; + stride = This->stateBlock->streamStride[element->Stream]; if (This->stateBlock->streamIsUP) { TRACE("Stream is up %d, %p\n", element->Stream, This->stateBlock->streamSource[element->Stream]); streamVBO = 0; @@ -185,6 +186,22 @@ void primitiveDeclarationConvertToStridedData( } else { TRACE("Stream isn't up %d, %p\n", element->Stream, This->stateBlock->streamSource[element->Stream]); data = IWineD3DVertexBufferImpl_GetMemory(This->stateBlock->streamSource[element->Stream], 0, &streamVBO); + + /* Can't use vbo's if the base vertex index is negative. OpenGL doesn't accept negative offsets + * (or rather offsets bigger than the vbo, because the pointer is unsigned), so use system memory + * sources. In most sane cases the pointer - offset will still be > 0, otherwise it will wrap + * around to some big value. Hope that with the indices, the driver wraps it back internally. If + * not, drawStridedSlow is needed, including a vertex buffer path. + */ + if(This->stateBlock->loadBaseVertexIndex < 0) { + WARN("loadBaseVertexIndex is < 0 (%d), not using vbos\n", This->stateBlock->loadBaseVertexIndex); + streamVBO = 0; + data = ((IWineD3DVertexBufferImpl *) This->stateBlock->streamSource[element->Stream])->resource.allocatedMemory; + if(data + This->stateBlock->loadBaseVertexIndex * stride < 0) { + FIXME("System memory vertex data load offset is negative!\n"); + } + } + if(fixup) { if( streamVBO != 0) *fixup = TRUE; else if(*fixup && !useVertexShaderFunction && @@ -195,7 +212,6 @@ void primitiveDeclarationConvertToStridedData( } } } - stride = This->stateBlock->streamStride[element->Stream]; data += element->Offset; reg = element->Reg; @@ -284,7 +300,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData DWORD specularColor = 0; /* Specular Color */ IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; UINT *streamOffset = This->stateBlock->streamOffset; - DWORD SkipnStrides = startVertex + This->stateBlock->loadBaseVertexIndex; + long SkipnStrides = startVertex + This->stateBlock->loadBaseVertexIndex; BYTE *texCoords[WINED3DDP_MAXTEXCOORD]; BYTE *diffuse = NULL, *specular = NULL, *normal = NULL, *position = NULL; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 0328780..61a6385 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1343,8 +1343,8 @@ struct IWineD3DStateBlockImpl /* Indices */ IWineD3DIndexBuffer* pIndexData; - UINT baseVertexIndex; - UINT loadBaseVertexIndex; /* non-indexed drawing needs 0 here, indexed baseVertexIndex */ + INT baseVertexIndex; + INT loadBaseVertexIndex; /* non-indexed drawing needs 0 here, indexed baseVertexIndex */ /* Transform */ WINED3DMATRIX transforms[HIGHEST_TRANSFORMSTATE + 1]; diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index 35430b9..603eeb5 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -405,8 +405,8 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain, WINED3DGAMMARAMP* pRamp) PURE; STDMETHOD(SetIndices)(THIS_ struct IWineD3DIndexBuffer * pIndexData) PURE; STDMETHOD(GetIndices)(THIS_ struct IWineD3DIndexBuffer ** ppIndexData) PURE; - STDMETHOD(SetBaseVertexIndex)(THIS_ UINT baseIndex); - STDMETHOD(GetBaseVertexIndex)(THIS_ UINT *baseIndex); + STDMETHOD(SetBaseVertexIndex)(THIS_ INT baseIndex); + STDMETHOD(GetBaseVertexIndex)(THIS_ INT *baseIndex); STDMETHOD(SetLight)(THIS_ DWORD Index,CONST WINED3DLIGHT * pLight) PURE; STDMETHOD(GetLight)(THIS_ DWORD Index,WINED3DLIGHT * pLight) PURE; STDMETHOD(SetLightEnable)(THIS_ DWORD Index,BOOL Enable) PURE;
1
0
0
0
Stefan Dösinger : d3d9: Return the correct return value in GetDepthStencilSurface.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: cc563b9c6965714f196388a80b7e9cc7ee4c519e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cc563b9c6965714f196388a80…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Aug 14 20:23:52 2007 +0200 d3d9: Return the correct return value in GetDepthStencilSurface. --- dlls/d3d9/device.c | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index aa65c7e..d48587f 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -593,16 +593,19 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDepthStencilSurface(LPDIRECT3DDE } EnterCriticalSection(&d3d9_cs); - hr=IWineD3DDevice_GetDepthStencilSurface(This->WineD3DDevice,&pZStencilSurface); - if(hr == D3D_OK && pZStencilSurface != NULL){ - IWineD3DSurface_GetParent(pZStencilSurface,(IUnknown**)ppZStencilSurface); - IWineD3DSurface_Release(pZStencilSurface); - }else{ - FIXME("Call to IWineD3DDevice_GetRenderTarget failed\n"); - *ppZStencilSurface = NULL; + hr = IWineD3DDevice_GetDepthStencilSurface(This->WineD3DDevice,&pZStencilSurface); + if(hr == D3D_OK) { + if(pZStencilSurface != NULL){ + IWineD3DSurface_GetParent(pZStencilSurface,(IUnknown**)ppZStencilSurface); + IWineD3DSurface_Release(pZStencilSurface); + } else { + *ppZStencilSurface = NULL; + } + } else { + WARN("Call to IWineD3DDevice_GetDepthStencilSurface failed\n"); } LeaveCriticalSection(&d3d9_cs); - return D3D_OK; + return hr; } static HRESULT WINAPI IDirect3DDevice9Impl_BeginScene(LPDIRECT3DDEVICE9 iface) {
1
0
0
0
Stefan Dösinger : wined3d: Disable specular color when blitting.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 6857fc6b61567b51da158f98d18c09d56c78c31d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6857fc6b61567b51da158f98d…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Aug 14 16:32:35 2007 +0200 wined3d: Disable specular color when blitting. --- dlls/wined3d/context.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index ab1d91c..6dce228 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -588,6 +588,16 @@ static inline void SetupForBlit(IWineD3DDeviceImpl *This, WineD3DContext *contex glColorMask(GL_TRUE, GL_TRUE,GL_TRUE,GL_TRUE); checkGLcall("glColorMask"); Context_MarkStateDirty(context, STATE_RENDER(WINED3DRS_CLIPPING)); + if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { + glDisable(GL_COLOR_SUM_EXT); + Context_MarkStateDirty(context, STATE_RENDER(WINED3DRS_SPECULARENABLE)); + checkGLcall("glDisable(GL_COLOR_SUM_EXT)"); + } + if (GL_SUPPORT(NV_REGISTER_COMBINERS)) { + GL_EXTCALL(glFinalCombinerInputNV(GL_VARIABLE_B_NV, GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB)); + Context_MarkStateDirty(context, STATE_RENDER(WINED3DRS_SPECULARENABLE)); + checkGLcall("glFinalCombinerInputNV"); + } /* Setup transforms */ glMatrixMode(GL_MODELVIEW);
1
0
0
0
Juan Lang : wintrust: Test and correct alloc and free functions in WintrustLoadFunctionPointers.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: e8cc4db1c75694ea3f887cea46ff0e53a1a2eb13 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8cc4db1c75694ea3f887cea4…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Aug 24 15:07:41 2007 -0700 wintrust: Test and correct alloc and free functions in WintrustLoadFunctionPointers. --- dlls/wintrust/register.c | 14 ++++++++++++-- dlls/wintrust/tests/register.c | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/wintrust/register.c b/dlls/wintrust/register.c index d16b186..517359f 100644 --- a/dlls/wintrust/register.c +++ b/dlls/wintrust/register.c @@ -812,6 +812,16 @@ error_close_key: return Func; } +static void * WINAPI WINTRUST_Alloc(DWORD cb) +{ + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb); +} + +static void WINAPI WINTRUST_Free(void *p) +{ + HeapFree(GetProcessHeap(), 0, p); +} + /*********************************************************************** * WintrustLoadFunctionPointers (WINTRUST.@) */ @@ -834,8 +844,8 @@ BOOL WINAPI WintrustLoadFunctionPointers( GUID* pgActionID, WINTRUST_Guid2Wstr( pgActionID, GuidString); /* Get the function pointers from the registry, where applicable */ - pPfns->pfnAlloc = NULL; - pPfns->pfnFree = NULL; + pPfns->pfnAlloc = WINTRUST_Alloc; + pPfns->pfnFree = WINTRUST_Free; pPfns->pfnAddStore2Chain = NULL; pPfns->pfnAddSgnr2Chain = NULL; pPfns->pfnAddCert2Chain = NULL; diff --git a/dlls/wintrust/tests/register.c b/dlls/wintrust/tests/register.c index 6e6ed20..f4aef92 100644 --- a/dlls/wintrust/tests/register.c +++ b/dlls/wintrust/tests/register.c @@ -284,6 +284,8 @@ static void test_LoadFunctionPointers(void) funcs.cbStruct = sizeof(funcs); ret = pWintrustLoadFunctionPointers(&action, &funcs); ok(ret, "WintrustLoadFunctionPointers failed: %d\n", GetLastError()); + ok(funcs.pfnAlloc != NULL, "Expected a pointer\n"); + ok(funcs.pfnFree != NULL, "Expected a pointer\n"); } static void test_RegPolicyFlags(void)
1
0
0
0
Juan Lang : crypt32: Partially implement CMSG_CTRL_VERIFY_SIGNATURE_EX.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: ff26d428e3e59ed4e8e1a04411ed692c47254cb4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ff26d428e3e59ed4e8e1a0441…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Aug 24 15:20:13 2007 -0700 crypt32: Partially implement CMSG_CTRL_VERIFY_SIGNATURE_EX. --- dlls/crypt32/msg.c | 101 +++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 77 insertions(+), 24 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 7cf1a30..4e608bc 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -2087,6 +2087,38 @@ static BOOL CDecodeHashMsg_VerifyHash(CDecodeMsg *msg) return ret; } +static BOOL CDecodeSignedMsg_VerifySignatureWithKey(CDecodeMsg *msg, + HCRYPTPROV prov, DWORD signerIndex, PCERT_PUBLIC_KEY_INFO keyInfo) +{ + HCRYPTKEY key; + BOOL ret; + + if (!prov) + prov = msg->crypt_prov; + ret = CryptImportPublicKeyInfo(prov, X509_ASN_ENCODING, keyInfo, &key); + if (ret) + { + HCRYPTHASH hash; + CRYPT_HASH_BLOB reversedHash; + + if (msg->u.signed_data.info->rgSignerInfo[signerIndex].AuthAttrs.cAttr) + hash = msg->u.signed_data.signerHandles[signerIndex].authAttrHash; + else + hash = msg->u.signed_data.signerHandles[signerIndex].contentHash; + ret = CRYPT_ConstructBlob(&reversedHash, + &msg->u.signed_data.info->rgSignerInfo[signerIndex].EncryptedHash); + if (ret) + { + CRYPT_ReverseBytes(&reversedHash); + ret = CryptVerifySignatureW(hash, reversedHash.pbData, + reversedHash.cbData, key, NULL, 0); + CryptMemFree(reversedHash.pbData); + } + CryptDestroyKey(key); + } + return ret; +} + static BOOL CDecodeSignedMsg_VerifySignature(CDecodeMsg *msg, PCERT_INFO info) { BOOL ret = FALSE; @@ -2106,35 +2138,45 @@ static BOOL CDecodeSignedMsg_VerifySignature(CDecodeMsg *msg, PCERT_INFO info) } } if (ret) - { - HCRYPTKEY key; + ret = CDecodeSignedMsg_VerifySignatureWithKey(msg, 0, i, + &info->SubjectPublicKeyInfo); + else + SetLastError(CRYPT_E_SIGNER_NOT_FOUND); - ret = CryptImportPublicKeyInfo(msg->crypt_prov, X509_ASN_ENCODING, - &info->SubjectPublicKeyInfo, &key); - if (ret) + return ret; +} + +static BOOL CDecodeSignedMsg_VerifySignatureEx(CDecodeMsg *msg, + PCMSG_CTRL_VERIFY_SIGNATURE_EX_PARA para) +{ + BOOL ret = FALSE; + + if (para->cbSize != sizeof(CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA)) + SetLastError(ERROR_INVALID_PARAMETER); + else if (para->dwSignerIndex >= msg->u.signed_data.info->cSignerInfo) + SetLastError(CRYPT_E_SIGNER_NOT_FOUND); + else + { + switch (para->dwSignerType) + { + case CMSG_VERIFY_SIGNER_PUBKEY: + ret = CDecodeSignedMsg_VerifySignatureWithKey(msg, + para->hCryptProv, para->dwSignerIndex, + (PCERT_PUBLIC_KEY_INFO)para->pvSigner); + break; + case CMSG_VERIFY_SIGNER_CERT: { - HCRYPTHASH hash; - CRYPT_HASH_BLOB reversedHash; + PCCERT_CONTEXT cert = (PCCERT_CONTEXT)para->pvSigner; - if (msg->u.signed_data.info->rgSignerInfo[i].AuthAttrs.cAttr) - hash = msg->u.signed_data.signerHandles[i].authAttrHash; - else - hash = msg->u.signed_data.signerHandles[i].contentHash; - ret = CRYPT_ConstructBlob(&reversedHash, - &msg->u.signed_data.info->rgSignerInfo[i].EncryptedHash); - if (ret) - { - CRYPT_ReverseBytes(&reversedHash); - ret = CryptVerifySignatureW(hash, reversedHash.pbData, - reversedHash.cbData, key, NULL, 0); - CryptMemFree(reversedHash.pbData); - } - CryptDestroyKey(key); + ret = CDecodeSignedMsg_VerifySignatureWithKey(msg, para->hCryptProv, + para->dwSignerIndex, &cert->pCertInfo->SubjectPublicKeyInfo); + break; + } + default: + FIXME("unimplemented for signer type %d\n", para->dwSignerType); + SetLastError(CRYPT_E_SIGNER_NOT_FOUND); } } - else - SetLastError(CRYPT_E_SIGNER_NOT_FOUND); - return ret; } @@ -2173,6 +2215,17 @@ static BOOL CDecodeMsg_Control(HCRYPTMSG hCryptMsg, DWORD dwFlags, SetLastError(CRYPT_E_INVALID_MSG_TYPE); } break; + case CMSG_CTRL_VERIFY_SIGNATURE_EX: + switch (msg->type) + { + case CMSG_SIGNED: + ret = CDecodeSignedMsg_VerifySignatureEx(msg, + (PCMSG_CTRL_VERIFY_SIGNATURE_EX_PARA)pvCtrlPara); + break; + default: + SetLastError(CRYPT_E_INVALID_MSG_TYPE); + } + break; default: SetLastError(CRYPT_E_CONTROL_TYPE); }
1
0
0
0
Roderick Colenbrander : wined3d: Improve pixelformat selection code.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 318f6068699e7d8b548f1753c014244effe2f746 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=318f6068699e7d8b548f1753c…
Author: Roderick Colenbrander <thunderbird2k(a)gmx.net> Date: Sat Aug 25 00:18:54 2007 +0200 wined3d: Improve pixelformat selection code. --- dlls/wined3d/context.c | 78 ++++++++++++++++++++++++++++++------------------ 1 files changed, 49 insertions(+), 29 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 2507835..ab1d91c 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -131,6 +131,8 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar TRACE("(%p): Creating a %s context for render target %p\n", This, create_pbuffer ? "offscreen" : "onscreen", target); +#define PUSH1(att) attribs[nAttribs++] = (att); +#define PUSH2(att,value) attribs[nAttribs++] = (att); attribs[nAttribs++] = (value); if(create_pbuffer) { HDC hdc_parent = GetDC(win_handle); int iPixelFormat = 0; @@ -144,9 +146,6 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar int nAttribs = 0; unsigned int nFormats; -#define PUSH1(att) attribs[nAttribs++] = (att); -#define PUSH2(att,value) attribs[nAttribs++] = (att); attribs[nAttribs++] = (value); - /* Retrieve the specifications for the pixelformat from the backbuffer / stencilbuffer */ getColorBits(target->resource.format, &red, &green, &blue, &alphaBits, &colorBits); getDepthStencilBits(StencilBufferFormat, &depthBits, &stencilBits); @@ -158,9 +157,6 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar PUSH2(WGL_STENCIL_BITS_ARB, stencilBits); PUSH1(0); /* end the list */ -#undef PUSH1 -#undef PUSH2 - /* Try to find a pixelformat that matches exactly. If that fails let ChoosePixelFormat try to find a close match */ if(!GL_EXTCALL(wglChoosePixelFormatARB(hdc_parent, (const int*)&attribs, NULL, 1, &iPixelFormat, &nFormats))) { @@ -205,10 +201,12 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar } else { PIXELFORMATDESCRIPTOR pfd; int iPixelFormat; - short red, green, blue, alpha; - short colorBits; - short depthBits, stencilBits; + short redBits, greenBits, blueBits, alphaBits, colorBits; + short depthBits=0, stencilBits=0; int res; + int attribs[256]; + int nAttribs = 0; + unsigned int nFormats; hdc = GetDC(win_handle); if(hdc == NULL) { @@ -217,36 +215,56 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar } /* PixelFormat selection */ - /* TODO: fill cColorBits/cDepthBits with target->resource.format */ - ZeroMemory(&pfd, sizeof(pfd)); - pfd.nSize = sizeof(pfd); - pfd.nVersion = 1; - pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW;/*PFD_GENERIC_ACCELERATED*/ - pfd.iPixelType = PFD_TYPE_RGBA; - pfd.cColorBits = 32; - pfd.cDepthBits = 0; - pfd.cStencilBits = 0; - pfd.iLayerType = PFD_MAIN_PLANE; - - /* Try to match the colorBits of the d3d format */ - if(getColorBits(target->resource.format, &red, &green, &blue, &alpha, &colorBits)) - pfd.cColorBits = colorBits; + PUSH2(WGL_DRAW_TO_WINDOW_ARB, GL_TRUE); /* We want to draw to a window */ + PUSH2(WGL_DOUBLE_BUFFER_ARB, GL_TRUE); + PUSH2(WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB); /* Make sure we don't get a float or color index format */ + + if(!getColorBits(target->resource.format, &redBits, &greenBits, &blueBits, &alphaBits, &colorBits)) { + ERR("Unable to get color bits for format %#x!\n", target->resource.format); + return FALSE; + } + PUSH2(WGL_COLOR_BITS_ARB, colorBits); + PUSH2(WGL_RED_BITS_ARB, redBits); + PUSH2(WGL_GREEN_BITS_ARB, greenBits); + PUSH2(WGL_BLUE_BITS_ARB, blueBits); + PUSH2(WGL_ALPHA_BITS_ARB, alphaBits); /* Retrieve the depth stencil format from the present parameters. * The choice of the proper format can give a nice performance boost * in case of GPU limited programs. */ if(pPresentParms->EnableAutoDepthStencil) { TRACE("pPresentParms->EnableAutoDepthStencil=enabled; using AutoDepthStencilFormat=%s\n", debug_d3dformat(pPresentParms->AutoDepthStencilFormat)); - if(getDepthStencilBits(pPresentParms->AutoDepthStencilFormat, &depthBits, &stencilBits)) { - pfd.cDepthBits = depthBits; - pfd.cStencilBits = stencilBits; + if(!getDepthStencilBits(pPresentParms->AutoDepthStencilFormat, &depthBits, &stencilBits)) { + ERR("Unable to get depth / stencil bits for AutoDepthStencilFormat %#x!\n", pPresentParms->AutoDepthStencilFormat); + return FALSE; } + PUSH2(WGL_DEPTH_BITS_ARB, depthBits); + PUSH2(WGL_STENCIL_BITS_ARB, stencilBits); } + PUSH1(0); /* end the list */ iPixelFormat = ChoosePixelFormat(hdc, &pfd); - if(!iPixelFormat) { - /* If this happens something is very wrong as ChoosePixelFormat barely fails */ - ERR("Can't find a suitable iPixelFormat\n"); + + /* In case of failure hope that standard ChooosePixelFormat will find something suitable */ + if(!GL_EXTCALL(wglChoosePixelFormatARB(hdc, (const int*)&attribs, NULL, 1, &iPixelFormat, &nFormats))) + { + /* PixelFormat selection */ + ZeroMemory(&pfd, sizeof(pfd)); + pfd.nSize = sizeof(pfd); + pfd.nVersion = 1; + pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW;/*PFD_GENERIC_ACCELERATED*/ + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.cAlphaBits = alphaBits; + pfd.cColorBits = colorBits; + pfd.cDepthBits = depthBits; + pfd.cStencilBits = stencilBits; + pfd.iLayerType = PFD_MAIN_PLANE; + + iPixelFormat = ChoosePixelFormat(hdc, &pfd); + if(!iPixelFormat) { + /* If this happens something is very wrong as ChoosePixelFormat barely fails */ + ERR("Can't find a suitable iPixelFormat\n"); + } } DescribePixelFormat(hdc, iPixelFormat, sizeof(pfd), &pfd); @@ -265,6 +283,8 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar } } } +#undef PUSH1 +#undef PUSH2 ctx = pwglCreateContext(hdc); if(This->numContexts) pwglShareLists(This->contexts[0]->glCtx, ctx);
1
0
0
0
Roderick Colenbrander : wined3d: Override backbufferformat in window mode.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 308408151966ba92756b70faec1da302647e4d13 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=308408151966ba92756b70fae…
Author: Roderick Colenbrander <thunderbird2k(a)gmx.net> Date: Fri Aug 24 23:44:00 2007 +0200 wined3d: Override backbufferformat in window mode. --- dlls/wined3d/device.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 60f310a..425ffe2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1336,6 +1336,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic pPresentationParameters->BackBufferHeight = Rect.bottom; TRACE("Updating height to %d\n", pPresentationParameters->BackBufferHeight); } + if (pPresentationParameters->BackBufferFormat == WINED3DFMT_UNKNOWN) { + pPresentationParameters->BackBufferFormat = object->orig_fmt; + TRACE("Updating format to %s\n", debug_d3dformat(object->orig_fmt)); + } } /* Put the correct figures in the presentation parameters */
1
0
0
0
Roderick Colenbrander : wined3d: Add Geforce8 device ids.
by Alexandre Julliard
27 Aug '07
27 Aug '07
Module: wine Branch: master Commit: 925e8964f17244783e5d8e9f2fdcf56891b18d7e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=925e8964f17244783e5d8e9f2…
Author: Roderick Colenbrander <thunderbird2k(a)gmx.net> Date: Fri Aug 24 21:17:57 2007 +0200 wined3d: Add Geforce8 device ids. --- include/wine/wined3d_gl.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h index 7348b83..e98049c 100644 --- a/include/wine/wined3d_gl.h +++ b/include/wine/wined3d_gl.h @@ -3067,6 +3067,9 @@ typedef enum _GL_Cards { CARD_NVIDIA_GEFORCE_6600GT = 0x0140, CARD_NVIDIA_GEFORCE_6800 = 0x0041, CARD_NVIDIA_GEFORCE_7800GT = 0x0092, + CARD_NVIDIA_GEFORCE_8300GS = 0x0423, + CARD_NVIDIA_GEFORCE_8600GT = 0x0402, + CARD_NVIDIA_GEFORCE_8800GTS = 0x0193, CARD_INTEL_845G = 0x2562, CARD_INTEL_I830G = 0x3577,
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
109
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Results per page:
10
25
50
100
200