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
April 2008
----- 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
1278 discussions
Start a n
N
ew thread
Stefan Dösinger : ddraw: Remove some leftover test debug output.
by Alexandre Julliard
02 Apr '08
02 Apr '08
Module: wine Branch: master Commit: c1503a2579b10ef2f41831f50b1bff0978504b0d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c1503a2579b10ef2f41831f50…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Mar 29 22:40:07 2008 +0100 ddraw: Remove some leftover test debug output. --- dlls/ddraw/tests/dsurface.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c index 99c45fd..7ff1fe7 100644 --- a/dlls/ddraw/tests/dsurface.c +++ b/dlls/ddraw/tests/dsurface.c @@ -1504,7 +1504,6 @@ static void CubeMapTest(void) IDirectDrawSurface7_EnumAttachedSurfaces(cubemap, &num, CubeTestLvl1Enum); - trace("Enumerated %d surfaces in total\n", num); ok(num == 6, "Surface has %d attachments\n", num); IDirectDrawSurface7_Release(cubemap); @@ -2110,7 +2109,6 @@ static void SizeTest(void) desc.dwSize = sizeof(desc); desc.dwFlags = DDSD_CAPS; desc.ddsCaps.dwCaps |= DDSCAPS_OFFSCREENPLAIN; - trace("before offscreenplain create dsurface = %p\n", dsurface); ret = IDirectDraw_CreateSurface(lpDD, &desc, &dsurface, NULL); ok(ret == DDERR_INVALIDPARAMS, "Creating an offscreen plain surface without a size info returned %08x (dsurface=%p)\n", ret, dsurface); if(dsurface)
1
0
0
0
Stefan Dösinger : ddraw: Add a D3D7 cube map test.
by Alexandre Julliard
02 Apr '08
02 Apr '08
Module: wine Branch: master Commit: ab7630fbe373426f00d1083f54325eac9499fbfa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ab7630fbe373426f00d1083f5…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Mar 29 22:36:27 2008 +0100 ddraw: Add a D3D7 cube map test. The DirectDraw cube mapping interface has a few pitfalls. So far we have a test testing the surface enumeration, this adds a rendering test. So far everything used in the test works. --- dlls/ddraw/tests/visual.c | 155 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 155 insertions(+), 0 deletions(-) diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c index 580bf88..08852d4 100644 --- a/dlls/ddraw/tests/visual.c +++ b/dlls/ddraw/tests/visual.c @@ -1915,6 +1915,160 @@ static void p8_primary_test() if(window) DestroyWindow(window); } +static void cubemap_test(IDirect3DDevice7 *device) +{ + IDirect3D7 *d3d; + IDirectDraw7 *ddraw; + IDirectDrawSurface7 *cubemap, *surface; + D3DDEVICEDESC7 d3dcaps; + HRESULT hr; + DWORD color; + DDSURFACEDESC2 ddsd; + DDBLTFX DDBltFx; + DDSCAPS2 caps; + static float quad[] = { + -1.0, -1.0, 0.1, 1.0, 0.0, 0.0, /* Lower left */ + 0.0, -1.0, 0.1, 1.0, 0.0, 0.0, + -1.0, 0.0, 0.1, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.1, 1.0, 0.0, 0.0, + + 0.0, -1.0, 0.1, 0.0, 1.0, 0.0, /* Lower right */ + 1.0, -1.0, 0.1, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.1, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.1, 0.0, 1.0, 0.0, + + 0.0, 0.0, 0.1, 0.0, 0.0, 1.0, /* upper right */ + 1.0, 0.0, 0.1, 0.0, 0.0, 1.0, + 0.0, 1.0, 0.1, 0.0, 0.0, 1.0, + 1.0, 1.0, 0.1, 0.0, 0.0, 1.0, + + -1.0, 0.0, 0.1, -1.0, 0.0, 0.0, /* Upper left */ + 0.0, 0.0, 0.1, -1.0, 0.0, 0.0, + -1.0, 1.0, 0.1, -1.0, 0.0, 0.0, + 0.0, 1.0, 0.1, -1.0, 0.0, 0.0, + }; + + memset(&DDBltFx, 0, sizeof(DDBltFx)); + DDBltFx.dwSize = sizeof(DDBltFx); + + memset(&d3dcaps, 0, sizeof(d3dcaps)); + hr = IDirect3DDevice7_GetCaps(device, &d3dcaps); + ok(hr == D3D_OK, "IDirect3DDevice7_GetCaps returned %08x\n", hr); + if(!(d3dcaps.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_CUBEMAP)) + { + skip("No cubemap support\n"); + return; + } + + hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 0.0, 0); + ok(hr == D3D_OK, "IDirect3DDevice7_Clear failed with %08x\n", hr); + + hr = IDirect3DDevice7_GetDirect3D(device, &d3d); + ok(hr == D3D_OK, "IDirect3DDevice7_GetDirect3D returned %08x\n", hr); + hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **) &ddraw); + ok(hr == D3D_OK, "IDirect3D7_QueryInterface returned %08x\n", hr); + IDirect3D7_Release(d3d); + + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS; + ddsd.dwWidth = 16; + ddsd.dwHeight = 16; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX; + ddsd.ddsCaps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES | DDSCAPS2_TEXTUREMANAGE; + ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; + ddsd.ddpfPixelFormat.dwRGBBitCount = 32; + ddsd.ddpfPixelFormat.dwRBitMask = 0x00FF0000; + ddsd.ddpfPixelFormat.dwGBitMask = 0x0000FF00; + ddsd.ddpfPixelFormat.dwBBitMask = 0x000000FF; + + hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &cubemap, NULL); + ok(hr == DD_OK, "IDirectDraw7_CreateSurface returned %08x\n", hr); + IDirectDraw7_Release(ddraw); + + /* Positive X */ + DDBltFx.dwFillColor = 0x00ff0000; + hr = IDirectDrawSurface7_Blt(cubemap, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); + ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + + memset(&caps, 0, sizeof(caps)); + caps.dwCaps = DDSCAPS_TEXTURE; + caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEX; + hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface); + ok(hr == DD_OK, "IDirectDrawSurface7_Lock returned %08x\n", hr); + DDBltFx.dwFillColor = 0x0000ffff; + hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); + ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + + caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ; + hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface); + ok(hr == DD_OK, "IDirectDrawSurface7_Lock returned %08x\n", hr); + DDBltFx.dwFillColor = 0x0000ff00; + hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); + ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + + caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEZ; + hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface); + ok(hr == DD_OK, "IDirectDrawSurface7_Lock returned %08x\n", hr); + DDBltFx.dwFillColor = 0x000000ff; + hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); + ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + + caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEY; + hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface); + ok(hr == DD_OK, "IDirectDrawSurface7_Lock returned %08x\n", hr); + DDBltFx.dwFillColor = 0x00ffff00; + hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); + ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + + caps.dwCaps2 = DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEY; + hr = IDirectDrawSurface_GetAttachedSurface(cubemap, &caps, &surface); + ok(hr == DD_OK, "IDirectDrawSurface7_Lock returned %08x\n", hr); + DDBltFx.dwFillColor = 0x00ff00ff; + hr = IDirectDrawSurface7_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL, &DDBltFx); + ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); + + hr = IDirect3DDevice7_SetTexture(device, 0, cubemap); + ok(hr == DD_OK, "IDirect3DDevice7_SetTexture returned %08x\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); + ok(hr == DD_OK, "IDirect3DDevice7_SetTextureStageState returned %08x\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); + ok(hr == DD_OK, "IDirect3DDevice7_SetTextureStageState returned %08x\n", hr); + + hr = IDirect3DDevice7_BeginScene(device); + ok(hr == DD_OK, "IDirect3DDevice7_BeginScene returned %08x\n", hr); + if(SUCCEEDED(hr)) + { + hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEXCOORDSIZE3(0) | D3DFVF_TEX1, quad + 0 * 6, 4, 0); + ok(hr == DD_OK, "IDirect3DDevice7_DrawPrimitive returned %08x\n", hr); + hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEXCOORDSIZE3(0) | D3DFVF_TEX1, quad + 4 * 6, 4, 0); + ok(hr == DD_OK, "IDirect3DDevice7_DrawPrimitive returned %08x\n", hr); + hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEXCOORDSIZE3(0) | D3DFVF_TEX1, quad + 8 * 6, 4, 0); + ok(hr == DD_OK, "IDirect3DDevice7_DrawPrimitive returned %08x\n", hr); + hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ | D3DFVF_TEXCOORDSIZE3(0) | D3DFVF_TEX1, quad + 12* 6, 4, 0); + ok(hr == DD_OK, "IDirect3DDevice7_DrawPrimitive returned %08x\n", hr); + + hr = IDirect3DDevice7_EndScene(device); + ok(hr == DD_OK, "IDirect3DDevice7_EndScene returned %08x\n", hr); + } + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); + ok(hr == DD_OK, "IDirect3DDevice7_SetTextureStageState returned %08x\n", hr); + + color = getPixelColor(device, 160, 360); /* lower left quad - positivex */ + ok(color == 0x00ff0000, "DDSCAPS2_CUBEMAP_POSITIVEX has color 0x%08x, expected 0x00ff0000\n", color); + color = getPixelColor(device, 160, 120); /* upper left quad - negativex */ + ok(color == 0x0000ffff, "DDSCAPS2_CUBEMAP_NEGATIVEX has color 0x%08x, expected 0x0000ffff\n", color); + color = getPixelColor(device, 480, 360); /* lower right quad - positivey */ + ok(color == 0x00ff00ff, "DDSCAPS2_CUBEMAP_POSITIVEY has color 0x%08x, expected 0x00ff00ff\n", color); + color = getPixelColor(device, 480, 120); /* upper right quad - positivez */ + ok(color == 0x000000ff, "DDSCAPS2_CUBEMAP_POSITIVEZ has color 0x%08x, expected 0x000000ff\n", color); + hr = IDirect3DDevice7_SetTexture(device, 0, NULL); + ok(hr == DD_OK, "IDirect3DDevice7_SetTexture returned %08x\n", hr); + IDirectDrawSurface7_Release(cubemap); +} + START_TEST(visual) { HRESULT hr; @@ -1961,6 +2115,7 @@ START_TEST(visual) offscreen_test(Direct3DDevice); alpha_test(Direct3DDevice); rhw_zero_test(Direct3DDevice); + cubemap_test(Direct3DDevice); releaseObjects(); /* release DX7 interfaces to test D3D1 */
1
0
0
0
Stefan Dösinger : d3d9: Make the shading test even more precision tolerant.
by Alexandre Julliard
02 Apr '08
02 Apr '08
Module: wine Branch: master Commit: 685d14818c33f1952612ca36ed76fef9397ea9fb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=685d14818c33f1952612ca36e…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Mar 29 13:56:56 2008 +0100 d3d9: Make the shading test even more precision tolerant. This is needed on both windows and wine, seems to be a hardware thing. --- dlls/d3d9/tests/visual.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index da4d7ab..418e92c 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -1,6 +1,6 @@ /* * Copyright 2005, 2007 Henri Verbeet - * Copyright (C) 2007 Stefan D�singer(for CodeWeavers) + * Copyright (C) 2007-2008 Stefan D�singer(for CodeWeavers) * Copyright (C) 2008 Jason Green(for TransGaming) * * This library is free software; you can redistribute it and/or @@ -6426,12 +6426,12 @@ static void shademode_test(IDirect3DDevice9 *device) r = (color0 & 0x00ff0000) >> 16; g = (color0 & 0x0000ff00) >> 8; b = (color0 & 0x000000ff); - ok(r >= 0x0d && r <= 0x0e && g == 0xca && b >= 0x27 && b <= 0x28, + ok(r >= 0x0c && r <= 0x0e && g == 0xca && b >= 0x27 && b <= 0x28, "GOURAUD shading has color0 %08x, expected 0x000dca28\n", color0); r = (color1 & 0x00ff0000) >> 16; g = (color1 & 0x0000ff00) >> 8; b = (color1 & 0x000000ff); - ok(r == 0x0d && g >= 0x44 && g <= 0x45 && b >= 0xc7 && b <= 0xc8, + ok(r >= 0x0c && r <= 0x0d && g >= 0x44 && g <= 0x45 && b >= 0xc7 && b <= 0xc8, "GOURAUD shading has color1 %08x, expected 0x000d45c7\n", color1); color0_gouraud = color0; @@ -6444,12 +6444,12 @@ static void shademode_test(IDirect3DDevice9 *device) r = (color0 & 0x00ff0000) >> 16; g = (color0 & 0x0000ff00) >> 8; b = (color0 & 0x000000ff); - ok(r >= 0x0d && r <= 0x0e && g == 0xca && b >= 0x27 && b <= 0x28, + ok(r >= 0x0c && r <= 0x0e && g == 0xca && b >= 0x27 && b <= 0x28, "PHONG shading has color0 %08x, expected 0x000dca28\n", color0); r = (color1 & 0x00ff0000) >> 16; g = (color1 & 0x0000ff00) >> 8; b = (color1 & 0x000000ff); - ok(r == 0x0d && g >= 0x44 && g <= 0x45 && b >= 0xc7 && b <= 0xc8, + ok(r >= 0x0c && r <= 0x0d && g >= 0x44 && g <= 0x45 && b >= 0xc7 && b <= 0xc8, "PHONG shading has color1 %08x, expected 0x000d45c7\n", color1); ok(color0 == color0_gouraud, "difference between GOURAUD and PHONG shading detected: %08x %08x\n",
1
0
0
0
Stefan Dösinger : wined3d: Update copyright lines.
by Alexandre Julliard
02 Apr '08
02 Apr '08
Module: wine Branch: master Commit: b1d8af7926554c363223b062af47fd206df1f601 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b1d8af7926554c363223b062a…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Mar 29 02:36:13 2008 +0100 wined3d: Update copyright lines. --- dlls/wined3d/arb_program_shader.c | 1 + dlls/wined3d/baseshader.c | 1 + dlls/wined3d/basetexture.c | 1 + dlls/wined3d/context.c | 2 +- dlls/wined3d/cubetexture.c | 1 + dlls/wined3d/device.c | 2 +- dlls/wined3d/directx.c | 1 + dlls/wined3d/drawprim.c | 2 +- dlls/wined3d/glsl_shader.c | 1 + dlls/wined3d/indexbuffer.c | 1 + dlls/wined3d/pixelshader.c | 1 + dlls/wined3d/query.c | 3 +-- dlls/wined3d/state.c | 2 +- dlls/wined3d/stateblock.c | 1 + dlls/wined3d/surface.c | 2 +- dlls/wined3d/surface_base.c | 2 +- dlls/wined3d/swapchain.c | 1 + dlls/wined3d/texture.c | 1 + dlls/wined3d/utils.c | 1 + dlls/wined3d/vertexbuffer.c | 1 + dlls/wined3d/vertexshader.c | 1 + dlls/wined3d/wined3d_main.c | 1 + 22 files changed, 22 insertions(+), 8 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b1d8af7926554c363223b…
1
0
0
0
Stefan Dösinger : wined3d: Implement TSSARGTEMP with register combiners.
by Alexandre Julliard
02 Apr '08
02 Apr '08
Module: wine Branch: master Commit: bd68237096eb7731239359a2b4941163be015f42 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bd68237096eb7731239359a2b…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Mar 29 13:55:59 2008 +0100 wined3d: Implement TSSARGTEMP with register combiners. --- dlls/wined3d/baseshader.c | 6 +++- dlls/wined3d/state.c | 34 ++++++++++------------------- dlls/wined3d/utils.c | 46 ++++++++++++++++++++++----------------- dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 43 insertions(+), 45 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=bd68237096eb773123935…
1
0
0
0
Stefan Dösinger : wined3d: Do not report pixel shaders if not supported.
by Alexandre Julliard
02 Apr '08
02 Apr '08
Module: wine Branch: master Commit: 0f1c2370b11d913c862ce8dc151f5392e8bf5eee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0f1c2370b11d913c862ce8dc1…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Apr 1 16:02:10 2008 +0200 wined3d: Do not report pixel shaders if not supported. --- dlls/wined3d/arb_program_shader.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 8868dac..e372cdc 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -2049,13 +2049,17 @@ static void shader_arb_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info */ none_shader_backend.shader_get_caps(devtype, gl_info, pCaps); - pCaps->VertexShaderVersion = WINED3DVS_VERSION(1,1); - TRACE_(d3d_caps)("Hardware vertex shader version 1.1 enabled (ARB_PROGRAM)\n"); - pCaps->MaxVertexShaderConst = GL_LIMITS(vshader_constantsF); + if(GL_SUPPORT(ARB_VERTEX_PROGRAM)) { + pCaps->VertexShaderVersion = WINED3DVS_VERSION(1,1); + TRACE_(d3d_caps)("Hardware vertex shader version 1.1 enabled (ARB_PROGRAM)\n"); + pCaps->MaxVertexShaderConst = GL_LIMITS(vshader_constantsF); + } - pCaps->PixelShaderVersion = WINED3DPS_VERSION(1,4); - pCaps->PixelShader1xMaxValue = 8.0; - TRACE_(d3d_caps)("Hardware pixel shader version 1.4 enabled (ARB_PROGRAM)\n"); + if(GL_SUPPORT(ARB_FRAGMENT_PROGRAM)) { + pCaps->PixelShaderVersion = WINED3DPS_VERSION(1,4); + pCaps->PixelShader1xMaxValue = 8.0; + TRACE_(d3d_caps)("Hardware pixel shader version 1.4 enabled (ARB_PROGRAM)\n"); + } } static void shader_arb_load_init(void) {
1
0
0
0
Stefan Dösinger : wined3d: Implement D3DTA_TEMP in the GL_ATI_fragment_shader codepath.
by Alexandre Julliard
02 Apr '08
02 Apr '08
Module: wine Branch: master Commit: 287f60a2b20902d5e3b12b5236927e8faf929623 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=287f60a2b20902d5e3b12b523…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Mar 29 23:55:09 2008 +0100 wined3d: Implement D3DTA_TEMP in the GL_ATI_fragment_shader codepath. --- dlls/wined3d/ati_fragment_shader.c | 78 +++++++++++++++++++++++++++++++++++- dlls/wined3d/baseshader.c | 9 ++++ dlls/wined3d/directx.c | 11 +---- dlls/wined3d/utils.c | 3 + dlls/wined3d/wined3d_private.h | 3 + 5 files changed, 94 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index d483c22..cd6f892 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -208,13 +208,73 @@ static GLuint register_for_arg(DWORD arg, WineD3D_GL_Info *gl_info, unsigned int return ret; } +static GLuint find_tmpreg(struct texture_stage_op op[MAX_TEXTURES]) { + int lowest_read = -1; + int lowest_write = -1; + int i; + BOOL tex_used[MAX_TEXTURES]; + + memset(tex_used, 0, sizeof(tex_used)); + for(i = 0; i < MAX_TEXTURES; i++) { + if(op[i].cop == WINED3DTOP_DISABLE) { + break; + } + + if(lowest_read == -1 && + (op[i].carg1 == WINED3DTA_TEMP || op[i].carg2 == WINED3DTA_TEMP || op[i].carg0 == WINED3DTA_TEMP || + op[i].aarg1 == WINED3DTA_TEMP || op[i].aarg2 == WINED3DTA_TEMP || op[i].aarg0 == WINED3DTA_TEMP)) { + lowest_read = i; + } + + if(lowest_write == -1 && op[i].dst == WINED3DTA_TEMP) { + lowest_write = i; + } + + if(op[i].carg1 == WINED3DTA_TEXTURE || op[i].carg2 == WINED3DTA_TEXTURE || op[i].carg0 == WINED3DTA_TEXTURE || + op[i].aarg1 == WINED3DTA_TEXTURE || op[i].aarg2 == WINED3DTA_TEXTURE || op[i].aarg0 == WINED3DTA_TEXTURE) { + tex_used[i] = TRUE; + } + } + + /* Temp reg not read? We don't need it, return GL_NONE */ + if(lowest_read == -1) return GL_NONE; + + if(lowest_write >= lowest_read) { + FIXME("Temp register read before beeing written\n"); + } + + if(lowest_write == -1) { + /* This needs a test. Maybe we are supposed to return 0.0/0.0/0.0/0.0, or fail drawprim, or whatever */ + FIXME("Temp register read without beeing written\n"); + return GL_REG_1_ATI; + } else if(lowest_write >= 1) { + /* If we're writing to the temp reg at earliest in stage 1, we can use register 1 for the temp result. + * there may be texture data stored in reg 1, but we do not need it any longer since stage 1 already + * read it + */ + return GL_REG_1_ATI; + } else { + /* Search for a free texture register. We have 6 registers available. GL_REG_0_ATI is already used + * for the regular result + */ + for(i = 1; i < 6; i++) { + if(!tex_used[i]) { + return GL_REG_0_ATI + i; + } + } + /* What to do here? Report it in ValidateDevice? */ + FIXME("Could not find a register for the temporary register\n"); + return 0; + } +} + static GLuint gen_ati_shader(struct texture_stage_op op[MAX_TEXTURES], WineD3D_GL_Info *gl_info) { GLuint ret = GL_EXTCALL(glGenFragmentShadersATI(1)); unsigned int stage; GLuint arg0, arg1, arg2, extrarg; GLuint dstmod, argmod0, argmod1, argmod2, argmodextra; GLuint swizzle; - GLuint tmparg = -1; + GLuint tmparg = find_tmpreg(op); GLuint dstreg; if(!ret) { @@ -358,7 +418,16 @@ static GLuint gen_ati_shader(struct texture_stage_op op[MAX_TEXTURES], WineD3D_G break; } - dstreg = GL_REG_0_ATI; + if(op[stage].dst == WINED3DTA_TEMP) { + /* If we're writing to D3DTA_TEMP, but never reading from it we don't have to write there in the first place. + * skip the entire stage, this saves some GPU time + */ + if(tmparg == GL_NONE) continue; + + dstreg = tmparg; + } else { + dstreg = GL_REG_0_ATI; + } arg0 = register_for_arg(op[stage].carg0, gl_info, stage, &argmod0, tmparg); arg1 = register_for_arg(op[stage].carg1, gl_info, stage, &argmod1, tmparg); @@ -803,6 +872,9 @@ static void init_state_table() { ATIFSStateTable[STATE_TEXTURESTAGE(i, WINED3DTSS_ALPHAARG0)].apply = set_tex_op_atifs; ATIFSStateTable[STATE_TEXTURESTAGE(i, WINED3DTSS_ALPHAARG0)].representative = rep; + ATIFSStateTable[STATE_TEXTURESTAGE(i, WINED3DTSS_RESULTARG)].apply = set_tex_op_atifs; + ATIFSStateTable[STATE_TEXTURESTAGE(i, WINED3DTSS_RESULTARG)].representative = rep; + ATIFSStateTable[STATE_TEXTURESTAGE(i, WINED3DTSS_BUMPENVMAT00)].apply = set_bumpmat; ATIFSStateTable[STATE_TEXTURESTAGE(i, WINED3DTSS_BUMPENVMAT01)].apply = set_bumpmat; ATIFSStateTable[STATE_TEXTURESTAGE(i, WINED3DTSS_BUMPENVMAT10)].apply = set_bumpmat; @@ -942,6 +1014,8 @@ static void shader_atifs_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_in WARN("but GL_ATI_fragment_shader limits this to 6\n"); caps->MaxSimultaneousTextures = 6; } + + caps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_TSSARGTEMP; } static void shader_atifs_generate_pshader(IWineD3DPixelShader *iface, SHADER_BUFFER *buffer) { diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index 678b119..4bb1ee7 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -1169,6 +1169,15 @@ static void shader_none_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_inf pCaps->VertexShaderVersion = 0; pCaps->PixelShaderVersion = 0; pCaps->PixelShader1xMaxValue = 0.0; + + /* The caps below can be supported but aren't handled yet in utils.c 'd3dta_to_combiner_input', disable them until support is fixed */ +#if 0 + if (GL_SUPPORT(NV_REGISTER_COMBINERS)) + pCaps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_TSSARGTEMP; + if (GL_SUPPORT(NV_REGISTER_COMBINERS2)) + pCaps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_PERSTAGECONSTANT; +#endif + } #undef GLINFO_LOCATION diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 6baf8d3..8cb8ca6 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2791,14 +2791,6 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, if(GL_SUPPORT(EXT_BLEND_EQUATION_SEPARATE) && GL_SUPPORT(EXT_BLEND_FUNC_SEPARATE)) pCaps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_SEPARATEALPHABLEND; -/* The caps below can be supported but aren't handled yet in utils.c 'd3dta_to_combiner_input', disable them until support is fixed */ -#if 0 - if (GL_SUPPORT(NV_REGISTER_COMBINERS)) - pCaps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_TSSARGTEMP; - if (GL_SUPPORT(NV_REGISTER_COMBINERS2)) - pCaps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_PERSTAGECONSTANT; -#endif - pCaps->RasterCaps = WINED3DPRASTERCAPS_DITHER | WINED3DPRASTERCAPS_PAT | WINED3DPRASTERCAPS_WFOG | @@ -3089,6 +3081,9 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, shader_backend = select_shader_backend(Adapter, DeviceType); shader_backend->shader_get_caps(DeviceType, &GLINFO_LOCATION, &shader_caps); + /* Add shader misc caps. Only some of them belong to the shader parts of the pipeline */ + pCaps->PrimitiveMiscCaps |= shader_caps.PrimitiveMiscCaps; + /* This takes care for disabling vertex shader or pixel shader caps while leaving the other one enabled. * Ignore shader model capabilities if disabled in config */ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index d0285df..f55ca14 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3271,6 +3271,7 @@ void gen_ffp_op(IWineD3DStateBlockImpl *stateblock, struct texture_stage_op op[M op[i].carg0 = op[i].carg1 = op[i].carg2 = 0xffffffff; op[i].aarg0 = op[i].aarg1 = op[i].aarg2 = 0xffffffff; op[i].color_correction = WINED3DFMT_UNKNOWN; + op[i].dst = 0xffffffff; i++; break; } @@ -3344,6 +3345,8 @@ void gen_ffp_op(IWineD3DStateBlockImpl *stateblock, struct texture_stage_op op[M } else { op[i].projected = proj_none; } + + op[i].dst = stateblock->textureState[i][WINED3DTSS_RESULTARG]; } /* Clear unsupported stages */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c3f4910..0044bab 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -259,6 +259,8 @@ typedef struct SHADER_BUFFER { } SHADER_BUFFER; struct shader_caps { + DWORD PrimitiveMiscCaps; + DWORD TextureOpCaps; DWORD MaxTextureBlendStages; DWORD MaxSimultaneousTextures; @@ -730,6 +732,7 @@ struct texture_stage_op DWORD carg1, carg2, carg0; DWORD aarg1, aarg2, aarg0; WINED3DFORMAT color_correction; + DWORD dst; enum projection_types projected; };
1
0
0
0
Stefan Dösinger : wined3d: Prepare the atifs shader generator for temp register support.
by Alexandre Julliard
02 Apr '08
02 Apr '08
Module: wine Branch: master Commit: 8f9a14e312a382be1c7e33720c92eecb5165a8ad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f9a14e312a382be1c7e33720…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Mar 29 00:41:07 2008 +0100 wined3d: Prepare the atifs shader generator for temp register support. --- dlls/wined3d/ati_fragment_shader.c | 249 ++++++++++++++++++++++-------------- 1 files changed, 152 insertions(+), 97 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8f9a14e312a382be1c7e3…
1
0
0
0
Stefan Dösinger : d3d9: Add a test for temporary results.
by Alexandre Julliard
02 Apr '08
02 Apr '08
Module: wine Branch: master Commit: 20a2afe6aacaac5596bf58e1e9b4a60bcd3bb606 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=20a2afe6aacaac5596bf58e1e…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Apr 1 16:00:20 2008 +0200 d3d9: Add a test for temporary results. --- dlls/d3d9/tests/visual.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 77 insertions(+), 0 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 20f3b4e..da4d7ab 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -8561,6 +8561,82 @@ out: } } +static void tssargtemp_test(IDirect3DDevice9 *device) +{ + HRESULT hr; + DWORD color; + static const struct vertex quad[] = { + {-1.0, -1.0, 0.1, 0x00ff0000}, + { 1.0, -1.0, 0.1, 0x00ff0000}, + {-1.0, 1.0, 0.1, 0x00ff0000}, + { 1.0, 1.0, 0.1, 0x00ff0000} + }; + D3DCAPS9 caps; + + memset(&caps, 0, sizeof(caps)); + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(hr == D3D_OK, "IDirect3DDevice9_GetDeviceCaps failed with %s\n", DXGetErrorString9(hr)); + if(!(caps.PrimitiveMiscCaps & D3DPMISCCAPS_TSSARGTEMP)) { + skip("D3DPMISCCAPS_TSSARGTEMP not supported\n"); + return; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 0.0, 0); + ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLORARG1, D3DTA_TFACTOR); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_RESULTARG, D3DTA_TEMP); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DDevice9_SetTextureStageState(device, 2, D3DTSS_COLOROP, D3DTOP_ADD); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetTextureStageState(device, 2, D3DTSS_COLORARG1, D3DTA_CURRENT); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetTextureStageState(device, 2, D3DTSS_COLORARG2, D3DTA_TEMP); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_COLOROP, D3DTOP_DISABLE); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_TEXTUREFACTOR, 0x0000ff00); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed, hr = %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed, hr = %s\n", DXGetErrorString9(hr)); + if(SUCCEEDED(hr)) { + + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); + ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed with %s\n", DXGetErrorString9(hr)); + } + IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + color = getPixelColor(device, 320, 240); + ok(color == 0x00FFFF00, "TSSARGTEMP test returned color 0x%08x, expected 0x00FFFF00\n", color); + + /* Set stage 1 back to default */ + hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_RESULTARG, D3DTA_CURRENT); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetTextureStageState(device, 2, D3DTSS_COLOROP, D3DTOP_DISABLE); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_COLOROP, D3DTOP_DISABLE); + ok(hr == D3D_OK, "SetTextureStageState failed, hr = %s\n", DXGetErrorString9(hr)); +} + START_TEST(visual) { IDirect3DDevice9 *device_ptr; @@ -8654,6 +8730,7 @@ START_TEST(visual) skip("No two sided stencil support\n"); } pointsize_test(device_ptr); + tssargtemp_test(device_ptr); if (caps.VertexShaderVersion >= D3DVS_VERSION(1, 1)) {
1
0
0
0
Aric Stewart : imm32: Keep track of context associations between HWND and HIMC.
by Alexandre Julliard
02 Apr '08
02 Apr '08
Module: wine Branch: master Commit: dd0c9300f99a9cc4a2ce1178a6fa7e40afe2dc8f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dd0c9300f99a9cc4a2ce1178a…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Wed Apr 2 08:48:22 2008 -0500 imm32: Keep track of context associations between HWND and HIMC. --- dlls/imm32/imm.c | 55 ++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 41 insertions(+), 14 deletions(-) diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index ab57bce..4ba1d63 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -110,6 +110,7 @@ static UINT WM_MSIME_RECONVERT; static UINT WM_MSIME_QUERYPOSITION; static UINT WM_MSIME_DOCUMENTFEED; +static const WCHAR szwWineIMCProperty[] = {'W','i','n','e','I','m','m','H','I','M','C','P','r','o','p','e','r','t','y',0}; /* * prototypes */ @@ -623,12 +624,10 @@ static HIMCC updateResultStr(HIMCC old, LPWSTR resultstr, DWORD len) */ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC) { + HIMC old = NULL; InputContextData *data = (InputContextData*)hIMC; - WARN("(%p, %p): semi-stub\n", hWnd, hIMC); - - if (!hIMC) - return NULL; + TRACE("(%p, %p):\n", hWnd, hIMC); /* * WINE SPECIFIC! MAY CONFLICT @@ -642,9 +641,30 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC) /* * If already associated just return */ - if (data->IMC.hWnd == hWnd) + if (hIMC && data->IMC.hWnd == hWnd) return hIMC; + if (hWnd) + { + old = (HIMC)RemovePropW(hWnd,szwWineIMCProperty); + + if (old == NULL) + old = (HIMC)root_context; + else if (old == (HIMC)-1) + old = NULL; + + if (hIMC != (HIMC)root_context) + { + if (hIMC == NULL) /* Meaning disable imm for that window*/ + SetPropW(hWnd,szwWineIMCProperty,(HANDLE)-1); + else + SetPropW(hWnd,szwWineIMCProperty,(HANDLE)hIMC); + } + } + + if (!hIMC) + return old; + if (IsWindow(data->IMC.hWnd)) { /* @@ -663,11 +683,7 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC) SendMessageW(data->IMC.hWnd, WM_IME_SETCONTEXT, TRUE, ISC_SHOWUIALL); } - /* - * TODO: We need to keep track of the old context associated - * with a window and return it for now we will return NULL; - */ - return NULL; + return old; } /*********************************************************************** @@ -1176,13 +1192,24 @@ BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm) */ HIMC WINAPI ImmGetContext(HWND hWnd) { + HIMC rc = NULL; + TRACE("%p\n", hWnd); - if (!root_context) - return NULL; + rc = (HIMC)GetPropW(hWnd,szwWineIMCProperty); + if (rc == (HIMC)-1) + rc = NULL; + else if (rc == NULL) + rc = (HIMC)root_context; + + if (rc) + { + InputContextData *data = (InputContextData*)rc; + data->IMC.hWnd = hWnd; + } + TRACE("returning %p\n", rc); - root_context->IMC.hWnd = hWnd; - return (HIMC)root_context; + return rc; } /***********************************************************************
1
0
0
0
← Newer
1
...
115
116
117
118
119
120
121
...
128
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Results per page:
10
25
50
100
200