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
January 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
4 participants
893 discussions
Start a n
N
ew thread
Stefan Dösinger : wined3d: Do not keep internal references on index buffers.
by Alexandre Julliard
08 Jan '07
08 Jan '07
Module: wine Branch: master Commit: 478d22f74221c13d17e359760c146aae829ad00f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=478d22f74221c13d17e359760…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Jan 6 18:26:49 2007 +0100 wined3d: Do not keep internal references on index buffers. --- dlls/wined3d/device.c | 11 ----------- dlls/wined3d/stateblock.c | 6 ------ 2 files changed, 0 insertions(+), 17 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e43a2e6..5957c52 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2999,13 +2999,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl return WINED3D_OK; } - if (NULL != pIndexData) { - IWineD3DIndexBuffer_AddRef(pIndexData); - } - if (NULL != oldIdxs) { - IWineD3DIndexBuffer_Release(oldIdxs); - } - /* So far only the base vertex index is tracked */ if(BaseVertexIndex != oldBaseIndex) { IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC); @@ -4770,10 +4763,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl idxStride = 4; } - if (This->stateBlock->pIndexData) { - IWineD3DIndexBuffer_Release(This->stateBlock->pIndexData); - } - /* Note in the following, it's not this type, but that's the purpose of streamIsUP */ This->stateBlock->streamSource[0] = (IWineD3DVertexBuffer *)pVertexStreamZeroData; This->stateBlock->streamIsUP = TRUE; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 0b3f6e8..dba9e8a 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -233,12 +233,6 @@ static ULONG WINAPI IWineD3DStateBlockI int counter; FIXME("Releasing primary stateblock\n"); - /* free any index data */ - if (This->pIndexData) { - IWineD3DIndexBuffer_Release(This->pIndexData); - This->pIndexData = NULL; - } - /* NOTE: according to MSDN: The application is responsible for making sure the texture references are cleared down */ for (counter = 0; counter < GL_LIMITS(sampler_stages); counter++) { if (This->textures[counter]) {
1
0
0
0
Stefan Dösinger : wined3d: Do not keep internal references on vertex buffers.
by Alexandre Julliard
08 Jan '07
08 Jan '07
Module: wine Branch: master Commit: 3581d8e8d8f610adc1f36816ee4549f8ffb93fc6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3581d8e8d8f610adc1f36816e…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Jan 6 18:26:08 2007 +0100 wined3d: Do not keep internal references on vertex buffers. --- dlls/ddraw/ddraw_private.h | 3 ++- dlls/ddraw/device.c | 7 ++++++- dlls/ddraw/direct3d.c | 1 + dlls/ddraw/vertexbuffer.c | 26 ++++++++++++++++++++++++++ dlls/wined3d/device.c | 11 ----------- dlls/wined3d/stateblock.c | 7 ------- 6 files changed, 35 insertions(+), 20 deletions(-) diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index ca3bc76..b05e15a 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -578,8 +578,9 @@ struct IDirect3DVertexBufferImpl ICOM_VFIELD_MULTI(IDirect3DVertexBuffer); LONG ref; - /*** WineD3D link ***/ + /*** WineD3D and ddraw links ***/ IWineD3DVertexBuffer *wineD3DVertexBuffer; + IDirectDrawImpl *ddraw; /*** Storage for D3D7 specific things ***/ DWORD Caps; diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 90835a7..4ba3154 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -288,7 +288,7 @@ IDirect3DDeviceImpl_7_Release(IDirect3DD IParent *IndexBufferParent; DWORD i; - /* Free the index buffer */ + /* Free the index buffer. */ IWineD3DDevice_SetIndices(This->wineD3DDevice, NULL, 0); @@ -300,6 +300,11 @@ IDirect3DDeviceImpl_7_Release(IDirect3DD ERR(" (%p) Something is still holding the index buffer parent %p\n", This, IndexBufferParent); } + /* There is no need to unset the vertex buffer here, IWineD3DDevice_Uninit3D will do that when + * destroying the primary stateblock. If a vertex buffer is destroyed while it is bound + * IDirect3DVertexBuffer::Release will unset it. + */ + /* Restore the render targets */ if(This->OffScreenTarget) { diff --git a/dlls/ddraw/direct3d.c b/dlls/ddraw/direct3d.c index 8de0c1c..4896ba7 100644 --- a/dlls/ddraw/direct3d.c +++ b/dlls/ddraw/direct3d.c @@ -997,6 +997,7 @@ IDirect3DImpl_7_CreateVertexBuffer(IDire ICOM_INIT_INTERFACE(object, IDirect3DVertexBuffer, IDirect3DVertexBuffer1_Vtbl); object->Caps = Desc->dwCaps; + object->ddraw = This; hr = IWineD3DDevice_CreateVertexBuffer(This->wineD3DDevice, get_flexible_vertex_size(Desc->dwFVF) * Desc->dwNumVertices, diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c index 8dda6dc..46a9c31 100644 --- a/dlls/ddraw/vertexbuffer.c +++ b/dlls/ddraw/vertexbuffer.c @@ -164,6 +164,32 @@ IDirect3DVertexBufferImpl_Release(IDirec if (ref == 0) { + IWineD3DVertexBuffer *curVB = NULL; + UINT offset, stride; + + /* D3D7 Vertex buffers don't stay bound in the device, they are passed as a parameter + * to drawPrimitiveVB. DrawPrimitiveVB sets them as the stream source in wined3d, + * and they should get unset there before they are destroyed + */ + IWineD3DDevice_GetStreamSource(This->ddraw->wineD3DDevice, + 0 /* Stream number */, + &curVB, + &offset, + &stride); + if(curVB == This->wineD3DVertexBuffer) + { + IWineD3DDevice_SetStreamSource(This->ddraw->wineD3DDevice, + 0 /* Steam number */, + NULL /* stream data */, + 0 /* Offset */, + 0 /* stride */); + } + if(curVB) + { + IWineD3DVertexBuffer_Release(curVB); /* For the GetStreamSource */ + } + + IWineD3DVertexBuffer_Release(This->wineD3DVertexBuffer); HeapFree(GetProcessHeap(), 0, This); return 0; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 1a71afa..e43a2e6 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2248,11 +2248,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl } vbImpl->stream = StreamNumber; vbImpl->Flags |= VBFLAG_STREAM; - IWineD3DVertexBuffer_AddRef(pStreamData); } if (oldSrc != NULL) { ((IWineD3DVertexBufferImpl *) oldSrc)->Flags &= ~VBFLAG_STREAM; - IWineD3DVertexBuffer_Release(oldSrc); } IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC); @@ -4731,11 +4729,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl debug_d3dprimitivetype(PrimitiveType), PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride); - /* release the stream source */ - if (This->stateBlock->streamSource[0] != NULL) { - IWineD3DVertexBuffer_Release(This->stateBlock->streamSource[0]); - } - /* Note in the following, it's not this type, but that's the purpose of streamIsUP */ This->stateBlock->streamSource[0] = (IWineD3DVertexBuffer *)pVertexStreamZeroData; This->stateBlock->streamStride[0] = VertexStreamZeroStride; @@ -4777,10 +4770,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl idxStride = 4; } - /* release the stream and index data */ - if (This->stateBlock->streamSource[0] != NULL) { - IWineD3DVertexBuffer_Release(This->stateBlock->streamSource[0]); - } if (This->stateBlock->pIndexData) { IWineD3DIndexBuffer_Release(This->stateBlock->pIndexData); } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 439f0d2..0b3f6e8 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -232,13 +232,6 @@ static ULONG WINAPI IWineD3DStateBlockI if (This->blockType == WINED3DSBT_INIT) { int counter; FIXME("Releasing primary stateblock\n"); - /* Free any streams still bound */ - for (counter = 0 ; counter < MAX_STREAMS ; counter++) { - if (This->streamSource[counter] != NULL) { - IWineD3DVertexBuffer_Release(This->streamSource[counter]); - This->streamSource[counter] = NULL; - } - } /* free any index data */ if (This->pIndexData) {
1
0
0
0
Stefan Dösinger : wined3d: Do not keep internal references on pixel shaders.
by Alexandre Julliard
08 Jan '07
08 Jan '07
Module: wine Branch: master Commit: 467fa4e702ff11728cc5d7c335a3b89fa821ec52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=467fa4e702ff11728cc5d7c33…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Jan 6 18:25:47 2007 +0100 wined3d: Do not keep internal references on pixel shaders. --- dlls/wined3d/device.c | 7 ------- dlls/wined3d/stateblock.c | 11 ----------- 2 files changed, 0 insertions(+), 18 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index acc3bbb..1a71afa 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3531,13 +3531,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl TRACE("Recording... not performing anything\n"); } - if (NULL != pShader) { - IWineD3DPixelShader_AddRef(pShader); - } - if (NULL != oldShader) { - IWineD3DPixelShader_Release(oldShader); - } - if (This->isRecordingState) { TRACE("Recording... not performing anything\n"); return WINED3D_OK; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 5e36c5d..439f0d2 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -246,10 +246,6 @@ static ULONG WINAPI IWineD3DStateBlockI This->pIndexData = NULL; } - if (NULL != This->pixelShader) { - IWineD3DPixelShader_Release(This->pixelShader); - } - /* NOTE: according to MSDN: The application is responsible for making sure the texture references are cleared down */ for (counter = 0; counter < GL_LIMITS(sampler_stages); counter++) { if (This->textures[counter]) { @@ -414,13 +410,6 @@ static HRESULT WINAPI IWineD3DStateBloc if (This->pixelShader != targetStateBlock->pixelShader) { TRACE("Updating pixel shader from %p to %p\n", This->pixelShader, targetStateBlock->pixelShader); - if (targetStateBlock->pixelShader) { - IWineD3DPixelShader_AddRef(targetStateBlock->pixelShader); - } - if (This->pixelShader) { - IWineD3DPixelShader_Release(This->pixelShader); - } - This->pixelShader = targetStateBlock->pixelShader; }
1
0
0
0
Stefan Dösinger : wined3d: Do not keep internal references on vertex shaders.
by Alexandre Julliard
08 Jan '07
08 Jan '07
Module: wine Branch: master Commit: 7123d617a4a525ee509d28d74ab417ed865bfaf0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7123d617a4a525ee509d28d74…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Jan 6 18:25:19 2007 +0100 wined3d: Do not keep internal references on vertex shaders. --- dlls/wined3d/device.c | 7 ------- dlls/wined3d/stateblock.c | 11 ----------- 2 files changed, 0 insertions(+), 18 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 8354114..acc3bbb 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3270,13 +3270,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl return WINED3D_OK; } - if (NULL != pShader) { - IWineD3DVertexShader_AddRef(pShader); - } - if (NULL != oldShader) { - IWineD3DVertexShader_Release(oldShader); - } - TRACE("(%p) : setting pShader(%p)\n", This, pShader); IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VSHADER); diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index ca28027..5e36c5d 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -250,10 +250,6 @@ static ULONG WINAPI IWineD3DStateBlockI IWineD3DPixelShader_Release(This->pixelShader); } - if (NULL != This->vertexShader) { - IWineD3DVertexShader_Release(This->vertexShader); - } - /* NOTE: according to MSDN: The application is responsible for making sure the texture references are cleared down */ for (counter = 0; counter < GL_LIMITS(sampler_stages); counter++) { if (This->textures[counter]) { @@ -337,13 +333,6 @@ static HRESULT WINAPI IWineD3DStateBloc if (This->vertexShader != targetStateBlock->vertexShader) { TRACE("Updating vertex shader from %p to %p\n", This->vertexShader, targetStateBlock->vertexShader); - if (targetStateBlock->vertexShader) { - IWineD3DVertexShader_AddRef(targetStateBlock->vertexShader); - } - if (This->vertexShader) { - IWineD3DVertexShader_Release(This->vertexShader); - } - This->vertexShader = targetStateBlock->vertexShader; }
1
0
0
0
Stefan Dösinger : wined3d: Do not keep internal references to the vertex declaration.
by Alexandre Julliard
08 Jan '07
08 Jan '07
Module: wine Branch: master Commit: 15f91b4ad3b20f28f304b0e9b4caa0bd64eaae31 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=15f91b4ad3b20f28f304b0e9b…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Jan 6 18:24:47 2007 +0100 wined3d: Do not keep internal references to the vertex declaration. --- dlls/wined3d/device.c | 6 ------ dlls/wined3d/stateblock.c | 11 ----------- 2 files changed, 0 insertions(+), 17 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index b13854b..8354114 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3239,12 +3239,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl return WINED3D_OK; } - if (NULL != pDecl) { - IWineD3DVertexDeclaration_AddRef(pDecl); - } - if (NULL != oldDecl) { - IWineD3DVertexDeclaration_Release(oldDecl); - } IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VDECL); return WINED3D_OK; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 33d42ad..ca28027 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -254,10 +254,6 @@ static ULONG WINAPI IWineD3DStateBlockI IWineD3DVertexShader_Release(This->vertexShader); } - if (NULL != This->vertexDecl) { - IWineD3DVertexDeclaration_Release(This->vertexDecl); - } - /* NOTE: according to MSDN: The application is responsible for making sure the texture references are cleared down */ for (counter = 0; counter < GL_LIMITS(sampler_stages); counter++) { if (This->textures[counter]) { @@ -502,13 +498,6 @@ static HRESULT WINAPI IWineD3DStateBloc if(This->set.vertexDecl && This->vertexDecl != targetStateBlock->vertexDecl){ TRACE("Updating vertex declaration from %p to %p\n", This->vertexDecl, targetStateBlock->vertexDecl); - if (targetStateBlock->vertexDecl) { - IWineD3DVertexDeclaration_AddRef(targetStateBlock->vertexDecl); - } - if (This->vertexDecl) { - IWineD3DVertexDeclaration_Release(This->vertexDecl); - } - This->vertexDecl = targetStateBlock->vertexDecl; }
1
0
0
0
Stefan Dösinger : wined3d: Do not activate vertex shaders needlessly.
by Alexandre Julliard
08 Jan '07
08 Jan '07
Module: wine Branch: master Commit: fdb62cbaebb68a784993276cb80de1f73f6466b1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fdb62cbaebb68a784993276cb…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Jan 6 18:21:35 2007 +0100 wined3d: Do not activate vertex shaders needlessly. --- dlls/wined3d/state.c | 21 ++++++++++++--------- dlls/wined3d/wined3d_private.h | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index cdb250e..0e36a08 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -2675,19 +2675,22 @@ static void vertexdeclaration(DWORD stat IWineD3DVertexShader_CompileShader(stateblock->vertexShader); } - /* Vertex and pixel shaders are applied together for now, so let the last dirty state do the - * application - */ - if(!isStateDirty(device, STATE_PIXELSHADER)) { + if(useVertexShaderFunction || device->last_was_vshader) { BOOL usePixelShaderFunction = device->ps_selected_mode != SHADER_NONE && - stateblock->pixelShader && - ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function; + stateblock->pixelShader && + ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function; - device->shader_backend->shader_select((IWineD3DDevice *) device, usePixelShaderFunction, useVertexShaderFunction); + /* Vertex and pixel shaders are applied together for now, so let the last dirty state do the + * application + */ + if(!isStateDirty(device, STATE_PIXELSHADER)) { + device->shader_backend->shader_select((IWineD3DDevice *) device, usePixelShaderFunction, useVertexShaderFunction); - if(!isStateDirty(stateblock->wineD3DDevice, STATE_VERTEXSHADERCONSTANT) && (useVertexShaderFunction || usePixelShaderFunction)) { - shaderconstant(STATE_VERTEXSHADERCONSTANT, stateblock); + if(!isStateDirty(stateblock->wineD3DDevice, STATE_VERTEXSHADERCONSTANT) && (useVertexShaderFunction || usePixelShaderFunction)) { + shaderconstant(STATE_VERTEXSHADERCONSTANT, stateblock); + } } + device->last_was_vshader = useVertexShaderFunction; } if(updateFog) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 27f95c8..83a8f17 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -583,6 +583,7 @@ typedef struct IWineD3DDeviceImpl BOOL last_was_notclipped; BOOL untransformed; BOOL last_was_pshader; + BOOL last_was_vshader; BOOL last_was_foggy_shader; BOOL namedArraysLoaded, numberedArraysLoaded;
1
0
0
0
Stefan Dösinger : wined3d: Avoid negative draw start indices.
by Alexandre Julliard
08 Jan '07
08 Jan '07
Module: wine Branch: master Commit: 09ab812e79328aca3ee630846f1b80a41fa3bdb9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09ab812e79328aca3ee630846…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Jan 6 18:19:55 2007 +0100 wined3d: Avoid negative draw start indices. --- dlls/wined3d/device.c | 23 ++++++++++++++++++----- dlls/wined3d/drawprim.c | 6 +++--- dlls/wined3d/state.c | 28 ++++++++++++++-------------- dlls/wined3d/wined3d_private.h | 3 ++- 4 files changed, 37 insertions(+), 23 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=09ab812e79328aca3ee63…
1
0
0
0
Stefan Dösinger : wined3d: Move applying shader constants to the state table.
by Alexandre Julliard
08 Jan '07
08 Jan '07
Module: wine Branch: master Commit: 8e37fcd266ad0bfd445f09be74b176dc32e72d6e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8e37fcd266ad0bfd445f09be7…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Jan 6 18:17:27 2007 +0100 wined3d: Move applying shader constants to the state table. --- dlls/wined3d/device.c | 12 ++++++++++ dlls/wined3d/drawprim.c | 6 +---- dlls/wined3d/state.c | 47 ++++++++++++++++++++++++++++++++------- dlls/wined3d/wined3d_private.h | 7 +++++- 4 files changed, 57 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 14e305a..e955a8b 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3328,6 +3328,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl This->updateStateBlock->set.vertexShaderConstantsB[i] = TRUE; } + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VERTEXSHADERCONSTANT); + return WINED3D_OK; } @@ -3375,6 +3377,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl This->updateStateBlock->set.vertexShaderConstantsI[i] = TRUE; } + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VERTEXSHADERCONSTANT); + return WINED3D_OK; } @@ -3427,6 +3431,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl This->updateStateBlock->changed.vertexShaderConstantsF[i] = TRUE; } + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VERTEXSHADERCONSTANT); + return WINED3D_OK; } @@ -3606,6 +3612,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl This->updateStateBlock->set.pixelShaderConstantsB[i] = TRUE; } + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_PIXELSHADERCONSTANT); + return WINED3D_OK; } @@ -3653,6 +3661,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl This->updateStateBlock->set.pixelShaderConstantsI[i] = TRUE; } + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_PIXELSHADERCONSTANT); + return WINED3D_OK; } @@ -3705,6 +3715,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl This->updateStateBlock->changed.pixelShaderConstantsF[i] = TRUE; } + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_PIXELSHADERCONSTANT); + return WINED3D_OK; } diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 33c7480..54db1e7 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -1106,10 +1106,7 @@ inline static void drawPrimitiveDrawStri int minIndex, long StartIdx) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - - /* Load any global constants/uniforms that may have been set by the application */ - This->shader_backend->shader_load_constants(iface, usePixelShaderFunction, useVertexShaderFunction); + IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; /* Draw vertex-by-vertex */ if (This->useDrawStridedSlow) @@ -1272,7 +1269,6 @@ void drawPrimitive(IWineD3DDevice *iface } This->numDirtyEntries = 0; /* This makes the whole list clean */ - if (TRACE_ON(d3d_draw) && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { check_fbo_status(iface); } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 70a374f..768bd12 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1810,6 +1810,22 @@ static void sampler(DWORD state, IWineD3 } } +static void shaderconstant(DWORD state, IWineD3DStateBlockImpl *stateblock) { + IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; + + /* Vertex and pixel shader states will call a shader upload, don't do anything as long one of them + * has an update pending + */ + if(isStateDirty(device, STATE_VDECL) || + isStateDirty(device, STATE_PIXELSHADER)) { + return; + } + + device->shader_backend->shader_load_constants((IWineD3DDevice *) device, + stateblock->pixelShader && ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function, + stateblock->vertexShader && ((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.function); +} + static void pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock) { int i; @@ -1838,6 +1854,10 @@ static void pixelshader(DWORD state, IWi (IWineD3DDevice *) stateblock->wineD3DDevice, TRUE, !stateblock->vertexShader ? FALSE : ((IWineD3DVertexShaderImpl *) stateblock->vertexShader)->baseShader.function != NULL); + + if(!isStateDirty(stateblock->wineD3DDevice, STATE_VERTEXSHADERCONSTANT)) { + shaderconstant(STATE_VERTEXSHADERCONSTANT, stateblock); + } } stateblock->wineD3DDevice->last_was_pshader = TRUE; } else { @@ -1856,6 +1876,10 @@ static void pixelshader(DWORD state, IWi (IWineD3DDevice *) stateblock->wineD3DDevice, FALSE, !stateblock->vertexShader ? FALSE : ((IWineD3DVertexShaderImpl *) stateblock->vertexShader)->baseShader.function != NULL); + + if(!isStateDirty(stateblock->wineD3DDevice, STATE_VERTEXSHADERCONSTANT)) { + shaderconstant(STATE_VERTEXSHADERCONSTANT, stateblock); + } } } } @@ -2649,16 +2673,20 @@ static void vertexdeclaration(DWORD stat * in order to determine if we need to do any swizzling for D3DCOLOR * registers. If the shader is already compiled this call will do nothing. */ IWineD3DVertexShader_CompileShader(stateblock->vertexShader); + } - /* Vertex and pixel shaders are applied together for now, so let the last dirty state do the - * application - */ - if(!isStateDirty(device, STATE_PIXELSHADER)) { - BOOL usePixelShaderFunction = device->ps_selected_mode != SHADER_NONE && - stateblock->pixelShader && - ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function; + /* Vertex and pixel shaders are applied together for now, so let the last dirty state do the + * application + */ + if(!isStateDirty(device, STATE_PIXELSHADER)) { + BOOL usePixelShaderFunction = device->ps_selected_mode != SHADER_NONE && + stateblock->pixelShader && + ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function; + + device->shader_backend->shader_select((IWineD3DDevice *) device, usePixelShaderFunction, useVertexShaderFunction); - device->shader_backend->shader_select((IWineD3DDevice *) device, usePixelShaderFunction, useVertexShaderFunction); + if(!isStateDirty(stateblock->wineD3DDevice, STATE_VERTEXSHADERCONSTANT) && (useVertexShaderFunction || usePixelShaderFunction)) { + shaderconstant(STATE_VERTEXSHADERCONSTANT, stateblock); } } @@ -3704,5 +3732,6 @@ const struct StateEntry StateTable[] = { /* , STATE_VDECL */ STATE_VDECL, vertexdeclaration }, { /* , STATE_VSHADER */ STATE_VDECL, vertexdeclaration }, { /* , STATE_VIEWPORT */ STATE_VIEWPORT, viewport }, - + { /* , STATE_VERTEXSHADERCONSTANT */ STATE_VERTEXSHADERCONSTANT, shaderconstant }, + { /* , STATE_PIXELSHADERCONSTANT */ STATE_VERTEXSHADERCONSTANT, shaderconstant }, }; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 2eefa60..8b7170f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -436,7 +436,12 @@ typedef void (*APPLYSTATEFUNC)(DWORD sta #define STATE_VIEWPORT (STATE_VSHADER + 1) #define STATE_IS_VIEWPORT(a) ((a) == STATE_VIEWPORT) -#define STATE_HIGHEST (STATE_VIEWPORT) +#define STATE_VERTEXSHADERCONSTANT (STATE_VIEWPORT + 1) +#define STATE_PIXELSHADERCONSTANT (STATE_VERTEXSHADERCONSTANT + 1) +#define STATE_IS_VERTEXSHADERCONSTANT(a) ((a) == STATE_VERTEXSHADERCONSTANT) +#define STATE_IS_PIXELSHADERCONSTANT(a) ((a) == STATE_PIXELSHADERCONSTANT) + +#define STATE_HIGHEST (STATE_PIXELSHADERCONSTANT) struct StateEntry {
1
0
0
0
Stefan Dösinger : wined3d: Remove the general query fixme.
by Alexandre Julliard
08 Jan '07
08 Jan '07
Module: wine Branch: master Commit: f2dfbe76c256d44a8feea9eb332e86b560ff655a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f2dfbe76c256d44a8feea9eb3…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Jan 6 18:15:44 2007 +0100 wined3d: Remove the general query fixme. --- dlls/wined3d/query.c | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index b0c1482..32cacd6 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -111,6 +111,7 @@ static HRESULT WINAPI IWineD3DQueryImpl { WINED3DDEVINFO_VCACHE *data = (WINED3DDEVINFO_VCACHE *)pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_VCACHE\n", This); data->Pattern = MAKEFOURCC('C','A','C','H'); data->OptMethod = 0; /*0 get longest strips, 1 optimize vertex cache*/ data->CacheSize = 0; /*cache size, only required if OptMethod == 1*/ @@ -122,6 +123,7 @@ static HRESULT WINAPI IWineD3DQueryImpl { WINED3DDEVINFO_RESOURCEMANAGER *data = (WINED3DDEVINFO_RESOURCEMANAGER *)pData; int i; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_RESOURCEMANAGER\n", This); for(i = 0; i < WINED3DRTYPECOUNT; i++){ /*I'm setting the default values to 1 so as to reduce the risk of a div/0 in the caller*/ /* isTextureResident could be used to get some of this infomration */ @@ -143,6 +145,7 @@ static HRESULT WINAPI IWineD3DQueryImpl case WINED3DQUERYTYPE_VERTEXSTATS: { WINED3DDEVINFO_VERTEXSTATS *data = (WINED3DDEVINFO_VERTEXSTATS *)pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_VERTEXSTATS\n", This); data->NumRenderedTriangles = 1; data->NumExtraClippingTriangles = 1; @@ -151,6 +154,7 @@ static HRESULT WINAPI IWineD3DQueryImpl case WINED3DQUERYTYPE_EVENT: { BOOL* data = pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_EVENT\n", This); *data = TRUE; /*Don't know what this is supposed to be*/ } break; @@ -185,24 +189,28 @@ static HRESULT WINAPI IWineD3DQueryImpl case WINED3DQUERYTYPE_TIMESTAMP: { UINT64* data = pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_TIMESTAMP\n", This); *data = 1; /*Don't know what this is supposed to be*/ } break; case WINED3DQUERYTYPE_TIMESTAMPDISJOINT: { BOOL* data = pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_TIMESTAMPDISJOINT\n", This); *data = FALSE; /*Don't know what this is supposed to be*/ } break; case WINED3DQUERYTYPE_TIMESTAMPFREQ: { UINT64* data = pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_TIMESTAMPFREQ\n", This); *data = 1; /*Don't know what this is supposed to be*/ } break; case WINED3DQUERYTYPE_PIPELINETIMINGS: { WINED3DDEVINFO_PIPELINETIMINGS *data = (WINED3DDEVINFO_PIPELINETIMINGS *)pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_PIPELINETIMINGS\n", This); data->VertexProcessingTimePercent = 1.0f; data->PixelProcessingTimePercent = 1.0f; @@ -213,6 +221,7 @@ static HRESULT WINAPI IWineD3DQueryImpl case WINED3DQUERYTYPE_INTERFACETIMINGS: { WINED3DDEVINFO_INTERFACETIMINGS *data = (WINED3DDEVINFO_INTERFACETIMINGS *)pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_INTERFACETIMINGS\n", This); data->WaitingForGPUToUseApplicationResourceTimePercent = 1.0f; data->WaitingForGPUToAcceptMoreCommandsTimePercent = 1.0f; @@ -225,6 +234,8 @@ static HRESULT WINAPI IWineD3DQueryImpl case WINED3DQUERYTYPE_VERTEXTIMINGS: { WINED3DDEVINFO_STAGETIMINGS *data = (WINED3DDEVINFO_STAGETIMINGS *)pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_VERTEXTIMINGS\n", This); + data->MemoryProcessingPercent = 50.0f; data->ComputationProcessingPercent = 50.0f; @@ -233,6 +244,8 @@ static HRESULT WINAPI IWineD3DQueryImpl case WINED3DQUERYTYPE_PIXELTIMINGS: { WINED3DDEVINFO_STAGETIMINGS *data = (WINED3DDEVINFO_STAGETIMINGS *)pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_PIXELTIMINGS\n", This); + data->MemoryProcessingPercent = 50.0f; data->ComputationProcessingPercent = 50.0f; } @@ -240,6 +253,8 @@ static HRESULT WINAPI IWineD3DQueryImpl case WINED3DQUERYTYPE_BANDWIDTHTIMINGS: { WINED3DDEVINFO_BANDWIDTHTIMINGS *data = (WINED3DDEVINFO_BANDWIDTHTIMINGS *)pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_BANDWIDTHTIMINGS\n", This); + data->MaxBandwidthUtilized = 1.0f; data->FrontEndUploadMemoryUtilizedPercent = 1.0f; data->VertexRateUtilizedPercent = 1.0f; @@ -250,6 +265,7 @@ static HRESULT WINAPI IWineD3DQueryImpl case WINED3DQUERYTYPE_CACHEUTILIZATION: { WINED3DDEVINFO_CACHEUTILIZATION *data = (WINED3DDEVINFO_CACHEUTILIZATION *)pData; + FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_CACHEUTILIZATION\n", This); data->TextureCacheHitRate = 1.0f; data->PostTransformVertexCacheHitRate = 1.0f; @@ -265,7 +281,6 @@ static HRESULT WINAPI IWineD3DQueryImpl /*dwGetDataFlags = 0 || D3DGETDATA_FLUSH D3DGETDATA_FLUSH may return WINED3DERR_DEVICELOST if the device is lost */ - FIXME("(%p) : type %#x, Partial stub\n", This, This->type); return res; /* S_OK if the query data is available*/ } @@ -353,7 +368,8 @@ static HRESULT WINAPI IWineD3DQueryImpl break; default: - FIXME("(%p) : Unhandled query type %#x\n", This, This->type); + /* The fixme is printed when the app asks for the resulting data */ + WARN("(%p) : Unhandled query type %#x\n", This, This->type); break; }
1
0
0
0
Stefan Dösinger : wined3d: Apply shaders in their state handlers.
by Alexandre Julliard
08 Jan '07
08 Jan '07
Module: wine Branch: master Commit: 799770b992967f562b309fbacce31bf661980a31 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=799770b992967f562b309fbac…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Jan 6 18:14:12 2007 +0100 wined3d: Apply shaders in their state handlers. --- dlls/wined3d/arb_program_shader.c | 6 +++++ dlls/wined3d/drawprim.c | 14 +++++++----- dlls/wined3d/state.c | 39 +++++++++++++++++++++--------------- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index a8e4c9a..073a3ad 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -946,6 +946,9 @@ static void shader_arb_select(IWineD3DDe checkGLcall("glEnable(GL_VERTEX_PROGRAM_ARB);"); TRACE("(%p) : Bound vertex program %u and enabled GL_VERTEX_PROGRAM_ARB\n", This, ((IWineD3DVertexShaderImpl *)This->stateBlock->vertexShader)->baseShader.prgId); + } else if(GL_SUPPORT(GL_VERTEX_PROGRAM_ARB)) { + glDisable(GL_VERTEX_PROGRAM_ARB); + checkGLcall("glDisable(GL_VERTEX_PROGRAM_ARB)"); } if (usePS) { @@ -961,6 +964,9 @@ static void shader_arb_select(IWineD3DDe checkGLcall("glEnable(GL_FRAGMENT_PROGRAM_ARB);"); TRACE("(%p) : Bound fragment program %u and enabled GL_FRAGMENT_PROGRAM_ARB\n", This, ((IWineD3DPixelShaderImpl *)This->stateBlock->pixelShader)->baseShader.prgId); + } else if(GL_SUPPORT(ARB_FRAGMENT_PROGRAM)) { + glDisable(GL_FRAGMENT_PROGRAM_ARB); + checkGLcall("glDisable(GL_FRAGMENT_PROGRAM_ARB)"); } } diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index f2aec53..33c7480 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -1108,9 +1108,6 @@ inline static void drawPrimitiveDrawStri IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - /* Make any shaders active */ - This->shader_backend->shader_select(iface, usePixelShaderFunction, useVertexShaderFunction); - /* Load any global constants/uniforms that may have been set by the application */ This->shader_backend->shader_load_constants(iface, usePixelShaderFunction, useVertexShaderFunction); @@ -1119,9 +1116,6 @@ inline static void drawPrimitiveDrawStri drawStridedSlow(iface, dataLocations, numberOfIndicies, glPrimType, idxData, idxSize, minIndex, StartIdx, baseVIndex); else drawStridedFast(iface, numberOfIndicies, glPrimType, idxData, idxSize, minIndex, StartIdx, baseVIndex); - - /* Cleanup any shaders */ - This->shader_backend->shader_cleanup(usePixelShaderFunction, useVertexShaderFunction); } static void check_fbo_status(IWineD3DDevice *iface) { @@ -1164,6 +1158,14 @@ static void depth_blt(IWineD3DDevice *if glBindTexture(GL_TEXTURE_2D, old_binding); glPopAttrib(); + + /* Reselect the old shaders. There doesn't seem to be any glPushAttrib bit for arb shaders, + * and this seems easier and more efficient than providing the shader backend with a private + * storage to read and restore the old shader settings + */ + This->shader_backend->shader_select(iface, + This->stateBlock->pixelShader && ((IWineD3DPixelShaderImpl *)This->stateBlock->pixelShader)->baseShader.function, + This->stateBlock->vertexShader && ((IWineD3DVertexShaderImpl *)This->stateBlock->vertexShader)->baseShader.function); } static void depth_copy(IWineD3DDevice *iface) { diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 34aa4bc..70a374f 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1833,16 +1833,12 @@ static void pixelshader(DWORD state, IWi /* Compile and bind the shader */ IWineD3DPixelShader_CompileShader(stateblock->pixelShader); -#if 0 - /* Can't do that here right now, because glsl shaders depend on having both pixel and vertex shader - * setup at the same time. The shader_select call will be done by drawprim until vertex shaders are - * moved to the state table too - */ - stateblock->wineD3DDevice->shader_backend->shader_select( - (IWineD3DDevice *) stateblock->wineD3DDevice, - TRUE, - !stateblock->vertexShader ? FALSE : ((IWineD3DVertexShaderImpl *) stateblock->vertexShader)->baseShader.function != NULL); -#endif + if(!isStateDirty(stateblock->wineD3DDevice, StateTable[STATE_VSHADER].representative)) { + stateblock->wineD3DDevice->shader_backend->shader_select( + (IWineD3DDevice *) stateblock->wineD3DDevice, + TRUE, + !stateblock->vertexShader ? FALSE : ((IWineD3DVertexShaderImpl *) stateblock->vertexShader)->baseShader.function != NULL); + } stateblock->wineD3DDevice->last_was_pshader = TRUE; } else { /* Disabled the pixel shader - color ops weren't applied @@ -1855,12 +1851,12 @@ static void pixelshader(DWORD state, IWi } stateblock->wineD3DDevice->last_was_pshader = FALSE; -#if 0 - stateblock->wineD3DDevice->shader_backend->shader_select( - (IWineD3DDevice *) stateblock->wineD3DDevice, - FALSE, - !stateblock->vertexShader ? FALSE : ((IWineD3DVertexShaderImpl *) stateblock->vertexShader)->baseShader.function != NULL); -#endif + if(!isStateDirty(stateblock->wineD3DDevice, StateTable[STATE_VSHADER].representative)) { + stateblock->wineD3DDevice->shader_backend->shader_select( + (IWineD3DDevice *) stateblock->wineD3DDevice, + FALSE, + !stateblock->vertexShader ? FALSE : ((IWineD3DVertexShaderImpl *) stateblock->vertexShader)->baseShader.function != NULL); + } } } @@ -2653,6 +2649,17 @@ static void vertexdeclaration(DWORD stat * in order to determine if we need to do any swizzling for D3DCOLOR * registers. If the shader is already compiled this call will do nothing. */ IWineD3DVertexShader_CompileShader(stateblock->vertexShader); + + /* Vertex and pixel shaders are applied together for now, so let the last dirty state do the + * application + */ + if(!isStateDirty(device, STATE_PIXELSHADER)) { + BOOL usePixelShaderFunction = device->ps_selected_mode != SHADER_NONE && + stateblock->pixelShader && + ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function; + + device->shader_backend->shader_select((IWineD3DDevice *) device, usePixelShaderFunction, useVertexShaderFunction); + } } if(updateFog) {
1
0
0
0
← Newer
1
...
58
59
60
61
62
63
64
...
90
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
Results per page:
10
25
50
100
200