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
October 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
3 participants
1216 discussions
Start a n
N
ew thread
Andrew Nguyen : winmm: Fix a potential infinite recursion bug.
by Alexandre Julliard
29 Oct '08
29 Oct '08
Module: wine Branch: master Commit: 71eb8e10cd8edd8f17c5eece704c2e6d1756d8f7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=71eb8e10cd8edd8f17c5eece7…
Author: Andrew Nguyen <arethusa26(a)gmail.com> Date: Wed Oct 29 03:06:34 2008 -0500 winmm: Fix a potential infinite recursion bug. --- dlls/winmm/mmsystem.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/winmm/mmsystem.c b/dlls/winmm/mmsystem.c index a0e06fe..76e42f1 100644 --- a/dlls/winmm/mmsystem.c +++ b/dlls/winmm/mmsystem.c @@ -3195,7 +3195,7 @@ MMRESULT16 WINAPI joyReleaseCapture16(UINT16 wID) */ MMRESULT16 WINAPI joySetCapture16(HWND16 hWnd, UINT16 wID, UINT16 wPeriod, BOOL16 bChanged) { - return joySetCapture16(hWnd, wID, wPeriod, bChanged); + return joySetCapture(HWND_32(hWnd), wID, wPeriod, bChanged); } /************************************************************************** @@ -3203,7 +3203,7 @@ MMRESULT16 WINAPI joySetCapture16(HWND16 hWnd, UINT16 wID, UINT16 wPeriod, BOOL1 */ MMRESULT16 WINAPI joySetThreshold16(UINT16 wID, UINT16 wThreshold) { - return joySetThreshold16(wID,wThreshold); + return joySetThreshold(wID,wThreshold); } /**************************************************************************
1
0
0
0
James Hawkins : msi: Do not reinstall an assembly that already exists in the global assembly cache .
by Alexandre Julliard
29 Oct '08
29 Oct '08
Module: wine Branch: master Commit: 019f4af1c231aecbc4d141afea6758270ce6f884 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=019f4af1c231aecbc4d141afe…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Wed Oct 29 03:18:14 2008 -0500 msi: Do not reinstall an assembly that already exists in the global assembly cache. --- dlls/msi/action.c | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 145 insertions(+), 6 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 37a7de3..707bc75 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -5771,9 +5771,6 @@ static UINT install_assembly(MSIPACKAGE *package, MSIASSEMBLY *assembly, return ERROR_SUCCESS; } - if (!init_functionpointers() || !pCreateAssemblyCache) - return ERROR_FUNCTION_FAILED; - hr = pCreateAssemblyCache(&cache, 0); if (FAILED(hr)) goto done; @@ -5792,9 +5789,138 @@ done: typedef struct tagASSEMBLY_LIST { MSIPACKAGE *package; + IAssemblyCache *cache; struct list *assemblies; } ASSEMBLY_LIST; +typedef struct tagASSEMBLY_NAME +{ + LPWSTR name; + LPWSTR version; + LPWSTR culture; + LPWSTR pubkeytoken; +} ASSEMBLY_NAME; + +static UINT parse_assembly_name(MSIRECORD *rec, LPVOID param) +{ + ASSEMBLY_NAME *asmname = (ASSEMBLY_NAME *)param; + LPCWSTR name = MSI_RecordGetString(rec, 2); + LPWSTR val = msi_dup_record_field(rec, 3); + + static const WCHAR Name[] = {'N','a','m','e',0}; + static const WCHAR Version[] = {'V','e','r','s','i','o','n',0}; + static const WCHAR Culture[] = {'C','u','l','t','u','r','e',0}; + static const WCHAR PublicKeyToken[] = { + 'P','u','b','l','i','c','K','e','y','T','o','k','e','n',0}; + + if (!lstrcmpW(name, Name)) + asmname->name = val; + else if (!lstrcmpW(name, Version)) + asmname->version = val; + else if (!lstrcmpW(name, Culture)) + asmname->culture = val; + else if (!lstrcmpW(name, PublicKeyToken)) + asmname->pubkeytoken = val; + else + msi_free(val); + + return ERROR_SUCCESS; +} + +static void append_str(LPWSTR *str, DWORD *size, LPCWSTR append) +{ + if (!*str) + { + *size = lstrlenW(append) + 1; + *str = msi_alloc((*size) * sizeof(WCHAR)); + lstrcpyW(*str, append); + return; + } + + (*size) += lstrlenW(append); + *str = msi_realloc(*str, (*size) * sizeof(WCHAR)); + lstrcatW(*str, append); +} + +static BOOL check_assembly_installed(MSIDATABASE *db, IAssemblyCache *cache, + MSICOMPONENT *comp) +{ + ASSEMBLY_INFO asminfo; + ASSEMBLY_NAME name; + MSIQUERY *view; + LPWSTR disp; + DWORD size; + BOOL found; + UINT r; + + static const WCHAR separator[] = {',',' ',0}; + static const WCHAR Version[] = {'V','e','r','s','i','o','n','=',0}; + static const WCHAR Culture[] = {'C','u','l','t','u','r','e','=',0}; + static const WCHAR PublicKeyToken[] = { + 'P','u','b','l','i','c','K','e','y','T','o','k','e','n','=',0}; + static const WCHAR query[] = { + 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','M','s','i','A','s','s','e','m','b','l','y','N','a','m','e','`',' ', + 'W','H','E','R','E',' ','`','C','o','m','p','o','n','e','n','t','_','`', + '=','\'','%','s','\'',0}; + + disp = NULL; + found = FALSE; + ZeroMemory(&name, sizeof(ASSEMBLY_NAME)); + ZeroMemory(&asminfo, sizeof(ASSEMBLY_INFO)); + + r = MSI_OpenQuery(db, &view, query, comp->Component); + if (r != ERROR_SUCCESS) + return ERROR_SUCCESS; + + MSI_IterateRecords(view, NULL, parse_assembly_name, &name); + msiobj_release(&view->hdr); + + if (!name.name) + { + ERR("No assembly name specified!\n"); + goto done; + } + + append_str(&disp, &size, name.name); + + if (name.version) + { + append_str(&disp, &size, separator); + append_str(&disp, &size, Version); + append_str(&disp, &size, name.version); + } + + if (name.culture) + { + append_str(&disp, &size, separator); + append_str(&disp, &size, Culture); + append_str(&disp, &size, name.culture); + } + + if (name.pubkeytoken) + { + append_str(&disp, &size, separator); + append_str(&disp, &size, PublicKeyToken); + append_str(&disp, &size, name.pubkeytoken); + } + + asminfo.cbAssemblyInfo = sizeof(ASSEMBLY_INFO); + IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_VALIDATE, + disp, &asminfo); + found = (asminfo.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED); + +done: + msiobj_release(&view->hdr); + msi_free(disp); + msi_free(name.name); + msi_free(name.version); + msi_free(name.culture); + msi_free(name.pubkeytoken); + + return found; +} + static UINT load_assembly(MSIRECORD *rec, LPVOID param) { ASSEMBLY_LIST *list = (ASSEMBLY_LIST *)param; @@ -5826,17 +5952,20 @@ static UINT load_assembly(MSIRECORD *rec, LPVOID param) assembly->manifest = strdupW(MSI_RecordGetString(rec, 3)); assembly->application = strdupW(MSI_RecordGetString(rec, 4)); assembly->attributes = MSI_RecordGetInteger(rec, 5); - assembly->installed = FALSE; + assembly->installed = check_assembly_installed(list->package->db, + list->cache, + assembly->component); list_add_head(list->assemblies, &assembly->entry); - return ERROR_SUCCESS; } static UINT load_assemblies(MSIPACKAGE *package, struct list *assemblies) { - MSIQUERY *view; + IAssemblyCache *cache = NULL; ASSEMBLY_LIST list; + MSIQUERY *view; + HRESULT hr; UINT r; static const WCHAR query[] = @@ -5847,12 +5976,19 @@ static UINT load_assemblies(MSIPACKAGE *package, struct list *assemblies) if (r != ERROR_SUCCESS) return ERROR_SUCCESS; + hr = pCreateAssemblyCache(&cache, 0); + if (FAILED(hr)) + return ERROR_FUNCTION_FAILED; + list.package = package; + list.cache = cache; list.assemblies = assemblies; r = MSI_IterateRecords(view, NULL, load_assembly, &list); msiobj_release(&view->hdr); + IAssemblyCache_Release(cache); + return r; } @@ -5929,6 +6065,9 @@ static UINT ACTION_MsiPublishAssemblies( MSIPACKAGE *package ) MSIASSEMBLY *assembly; MSIMEDIAINFO *mi; + if (!init_functionpointers() || !pCreateAssemblyCache) + return ERROR_FUNCTION_FAILED; + r = load_assemblies(package, &assemblies); if (r != ERROR_SUCCESS) goto done;
1
0
0
0
Dmitry Timoshkov : user32: Handle all kinds of values returned by WIN_GetPtr.
by Alexandre Julliard
29 Oct '08
29 Oct '08
Module: wine Branch: master Commit: 8f1d058b9d0cbf742d998fa73f4726620351fae9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f1d058b9d0cbf742d998fa73…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Wed Oct 29 17:11:21 2008 +0800 user32: Handle all kinds of values returned by WIN_GetPtr. --- dlls/user32/win.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index ddea523..833e07d 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -1231,7 +1231,8 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags /* send the size messages */ - if (!(wndPtr = WIN_GetPtr(hwnd))) return 0; + if (!(wndPtr = WIN_GetPtr( hwnd )) || + wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return 0; if (!(wndPtr->flags & WIN_NEED_SIZE)) { rect = wndPtr->rectClient;
1
0
0
0
Alistair Leslie-Hughes : oleacc: Removed failed test case.
by Alexandre Julliard
29 Oct '08
29 Oct '08
Module: wine Branch: master Commit: a4dc3213ae37b4254a261fae8ebd36a669804542 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a4dc3213ae37b4254a261fae8…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Oct 29 16:42:02 2008 +1100 oleacc: Removed failed test case. --- dlls/oleacc/tests/main.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/dlls/oleacc/tests/main.c b/dlls/oleacc/tests/main.c index b977a7b..bd00294 100644 --- a/dlls/oleacc/tests/main.c +++ b/dlls/oleacc/tests/main.c @@ -48,8 +48,6 @@ static void test_getroletext(void) bufW[0] = '*'; ret = GetRoleTextW(-1, bufW, 0); ok(ret == 0, "GetRoleTextW doesn't return zero on wrong role number, got %d\n", ret); - /* don't know why this char */ - todo_wine ok(bufW[0] == 0x1e90, "GetRoleTextW returned wrong char, got %u\n", bufW[0]); /* zero role number - not documented */ ret = GetRoleTextA(0, NULL, 0);
1
0
0
0
Michael Stefaniuc : comctl32: HANDLE/ HGLOBAL are basically just void pointers. No casts to other pointers are needed.
by Alexandre Julliard
29 Oct '08
29 Oct '08
Module: wine Branch: master Commit: b12fbe163053487f2ee60946254afbc8923040ad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b12fbe163053487f2ee609462…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Oct 28 23:35:49 2008 +0100 comctl32: HANDLE/HGLOBAL are basically just void pointers. No casts to other pointers are needed. --- dlls/comctl32/commctrl.c | 12 +++--- dlls/comctl32/propsheet.c | 99 ++++++++++++++++---------------------------- 2 files changed, 42 insertions(+), 69 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b12fbe163053487f2ee60…
1
0
0
0
Dylan Smith : richedit: Handle negative position given to EM_POSFROMCHAR.
by Alexandre Julliard
29 Oct '08
29 Oct '08
Module: wine Branch: master Commit: 09802e2c764847ecccd2c82d891d887b97982baf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09802e2c764847ecccd2c82d8…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Tue Oct 28 18:16:23 2008 -0400 richedit: Handle negative position given to EM_POSFROMCHAR. --- dlls/riched20/editor.c | 1 + dlls/riched20/tests/editor.c | 4 ++++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index e35e3cb..ce754b9 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -3544,6 +3544,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, nCharOfs = lParam; nLength = ME_GetTextLength(editor); nCharOfs = min(nCharOfs, nLength); + nCharOfs = max(nCharOfs, 0); ME_RunOfsFromCharOfs(editor, nCharOfs, &pRun, &nOffset); assert(pRun->type == diRun); diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 2c803ae..7748d92 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -649,6 +649,10 @@ static void test_EM_POSFROMCHAR(void) SendMessage(hwndRichEdit, WM_GETTEXTLENGTH, 0, 0)+1); ok(pt.x == xpos, "pt.x = %d\n", pt.x); + /* Try a negative position. */ + SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt, -1); + ok(pt.x == 1, "pt.x = %d\n", pt.x); + DestroyWindow(hwndRichEdit); }
1
0
0
0
Henri Verbeet : wined3d: Handle projected cube textures.
by Alexandre Julliard
29 Oct '08
29 Oct '08
Module: wine Branch: master Commit: 795c4a77aa9ac0344463dcd4e191d74145e95b74 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=795c4a77aa9ac0344463dcd4e…
Author: Henri Verbeet <hverbeet(a)gmail.com> Date: Tue Oct 28 21:25:06 2008 +0100 wined3d: Handle projected cube textures. --- dlls/wined3d/glsl_shader.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index c43cdc3..fc57329 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -2213,13 +2213,18 @@ static void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) { /* 1.0-1.4: Use destination register as sampler source. * 2.0+: Use provided sampler source. */ - if (hex_version < WINED3DPS_VERSION(1,4)) { - DWORD flags; - + if (hex_version < WINED3DPS_VERSION(2,0)) { sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK; - flags = deviceImpl->stateBlock->textureState[sampler_idx][WINED3DTSS_TEXTURETRANSFORMFLAGS]; + } else { + sampler_idx = arg->src[1] & WINED3DSP_REGNUM_MASK; + } + sampler_type = arg->reg_maps->samplers[sampler_idx] & WINED3DSP_TEXTURETYPE_MASK; + + if (hex_version < WINED3DPS_VERSION(1,4)) { + DWORD flags = deviceImpl->stateBlock->textureState[sampler_idx][WINED3DTSS_TEXTURETRANSFORMFLAGS]; - if (flags & WINED3DTTFF_PROJECTED) { + /* Projected cube textures don't make a lot of sense, the resulting coordinates stay the same. */ + if (flags & WINED3DTTFF_PROJECTED && sampler_type != WINED3DSTT_CUBE) { projected = TRUE; switch (flags & ~WINED3DTTFF_PROJECTED) { case WINED3DTTFF_COUNT1: FIXME("WINED3DTTFF_PROJECTED with WINED3DTTFF_COUNT1?\n"); break; @@ -2233,7 +2238,6 @@ static void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) { } } else if (hex_version < WINED3DPS_VERSION(2,0)) { DWORD src_mod = arg->src[0] & WINED3DSP_SRCMOD_MASK; - sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK; if (src_mod == WINED3DSPSM_DZ) { projected = TRUE; @@ -2245,7 +2249,6 @@ static void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) { projected = FALSE; } } else { - sampler_idx = arg->src[1] & WINED3DSP_REGNUM_MASK; if(arg->opcode_token & WINED3DSI_TEXLD_PROJECT) { /* ps 2.0 texldp instruction always divides by the fourth component. */ projected = TRUE; @@ -2260,7 +2263,6 @@ static void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) { texrect = TRUE; } - sampler_type = arg->reg_maps->samplers[sampler_idx] & WINED3DSP_TEXTURETYPE_MASK; shader_glsl_get_sample_function(sampler_type, projected, texrect, &sample_function); mask |= sample_function.coord_mask;
1
0
0
0
Henri Verbeet : wined3d: Handle lack of NPOT support for depth blts.
by Alexandre Julliard
29 Oct '08
29 Oct '08
Module: wine Branch: master Commit: d262752aea790a715b3130733f1a08cf85024b85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d262752aea790a715b3130733…
Author: Henri Verbeet <hverbeet(a)gmail.com> Date: Tue Oct 28 21:25:06 2008 +0100 wined3d: Handle lack of NPOT support for depth blts. --- dlls/wined3d/surface.c | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 356b599..b5c9ff9 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -4126,6 +4126,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { if (location == SFLAG_DS_OFFSCREEN) { if (This->Flags & SFLAG_DS_ONSCREEN) { GLint old_binding = 0; + GLenum bind_target; TRACE("(%p) Copying onscreen depth buffer to depth texture\n", This); @@ -4138,9 +4139,15 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { /* Note that we use depth_blt here as well, rather than glCopyTexImage2D * directly on the FBO texture. That's because we need to flip. */ GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding); - glBindTexture(GL_TEXTURE_2D, device->depth_blt_texture); - glCopyTexImage2D(This->glDescription.target, + if (This->glDescription.target == GL_TEXTURE_RECTANGLE_ARB) { + glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding); + bind_target = GL_TEXTURE_RECTANGLE_ARB; + } else { + glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding); + bind_target = GL_TEXTURE_2D; + } + glBindTexture(bind_target, device->depth_blt_texture); + glCopyTexImage2D(bind_target, This->glDescription.level, This->glDescription.glFormatInternal, 0, @@ -4148,10 +4155,10 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { This->currentDesc.Width, This->currentDesc.Height, 0); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE_ARB, GL_LUMINANCE); - glBindTexture(GL_TEXTURE_2D, old_binding); + glTexParameteri(bind_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(bind_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(bind_target, GL_DEPTH_TEXTURE_MODE_ARB, GL_LUMINANCE); + glBindTexture(bind_target, old_binding); /* Setup the destination */ if (!device->depth_blt_rb) { @@ -4174,7 +4181,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { context_attach_depth_stencil_fbo(device, GL_FRAMEBUFFER_EXT, iface, FALSE); /* Do the actual blit */ - surface_depth_blt(This, device->depth_blt_texture, This->currentDesc.Width, This->currentDesc.Height, GL_TEXTURE_2D); + surface_depth_blt(This, device->depth_blt_texture, This->currentDesc.Width, This->currentDesc.Height, bind_target); checkGLcall("depth_blt"); if (device->activeContext->current_fbo) {
1
0
0
0
Henri Verbeet : wined3d: Support some more depth blt texture types in surface_depth_blt().
by Alexandre Julliard
29 Oct '08
29 Oct '08
Module: wine Branch: master Commit: 80818bfc8d92fca304f5776ad879e0c77ef1127c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=80818bfc8d92fca304f5776ad…
Author: Henri Verbeet <hverbeet(a)gmail.com> Date: Tue Oct 28 21:25:06 2008 +0100 wined3d: Support some more depth blt texture types in surface_depth_blt(). --- dlls/wined3d/surface.c | 117 +++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 106 insertions(+), 11 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 83c419e..356b599 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3954,9 +3954,103 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) { return WINED3D_OK; } -static void surface_depth_blt(IWineD3DSurfaceImpl *This, GLuint texture, GLsizei w, GLsizei h) +struct depth_blt_info +{ + GLenum binding; + GLenum bind_target; + enum tex_types tex_type; + GLfloat coords[4][3]; +}; + +static void surface_get_depth_blt_info(GLenum target, GLsizei w, GLsizei h, struct depth_blt_info *info) +{ + GLfloat (*coords)[3] = info->coords; + + switch (target) + { + default: + FIXME("Unsupported texture target %#x\n", target); + /* Fall back to GL_TEXTURE_2D */ + case GL_TEXTURE_2D: + info->binding = GL_TEXTURE_BINDING_2D; + info->bind_target = GL_TEXTURE_2D; + info->tex_type = tex_2d; + coords[0][0] = 0.0f; coords[0][1] = 1.0f; coords[0][2] = 0.0f; + coords[1][0] = 1.0f; coords[1][1] = 1.0f; coords[1][2] = 0.0f; + coords[2][0] = 0.0f; coords[2][1] = 0.0f; coords[2][2] = 0.0f; + coords[3][0] = 1.0f; coords[3][1] = 0.0f; coords[3][2] = 0.0f; + break; + + case GL_TEXTURE_RECTANGLE_ARB: + info->binding = GL_TEXTURE_BINDING_RECTANGLE_ARB; + info->bind_target = GL_TEXTURE_RECTANGLE_ARB; + info->tex_type = tex_rect; + coords[0][0] = 0.0f; coords[0][1] = h; coords[0][2] = 0.0f; + coords[1][0] = w; coords[1][1] = h; coords[1][2] = 0.0f; + coords[2][0] = 0.0f; coords[2][1] = 0.0f; coords[2][2] = 0.0f; + coords[3][0] = w; coords[3][1] = 0.0f; coords[3][2] = 0.0f; + break; + + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; + info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; + info->tex_type = tex_cube; + coords[0][0] = 1.0f; coords[0][1] = -1.0f; coords[0][2] = 1.0f; + coords[1][0] = 1.0f; coords[1][1] = -1.0f; coords[1][2] = -1.0f; + coords[2][0] = 1.0f; coords[2][1] = 1.0f; coords[2][2] = 1.0f; + coords[3][0] = 1.0f; coords[3][1] = 1.0f; coords[3][2] = -1.0f; + + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; + info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; + info->tex_type = tex_cube; + coords[0][0] = -1.0f; coords[0][1] = -1.0f; coords[0][2] = -1.0f; + coords[1][0] = -1.0f; coords[1][1] = -1.0f; coords[1][2] = 1.0f; + coords[2][0] = -1.0f; coords[2][1] = 1.0f; coords[2][2] = -1.0f; + coords[3][0] = -1.0f; coords[3][1] = 1.0f; coords[3][2] = 1.0f; + + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; + info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; + info->tex_type = tex_cube; + coords[0][0] = -1.0f; coords[0][1] = 1.0f; coords[0][2] = 1.0f; + coords[1][0] = 1.0f; coords[1][1] = 1.0f; coords[1][2] = 1.0f; + coords[2][0] = -1.0f; coords[2][1] = 1.0f; coords[2][2] = -1.0f; + coords[3][0] = 1.0f; coords[3][1] = 1.0f; coords[3][2] = -1.0f; + + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; + info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; + info->tex_type = tex_cube; + coords[0][0] = -1.0f; coords[0][1] = -1.0f; coords[0][2] = -1.0f; + coords[1][0] = 1.0f; coords[1][1] = -1.0f; coords[1][2] = -1.0f; + coords[2][0] = -1.0f; coords[2][1] = -1.0f; coords[2][2] = 1.0f; + coords[3][0] = 1.0f; coords[3][1] = -1.0f; coords[3][2] = 1.0f; + + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; + info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; + info->tex_type = tex_cube; + coords[0][0] = -1.0f; coords[0][1] = -1.0f; coords[0][2] = 1.0f; + coords[1][0] = 1.0f; coords[1][1] = -1.0f; coords[1][2] = 1.0f; + coords[2][0] = -1.0f; coords[2][1] = 1.0f; coords[2][2] = 1.0f; + coords[3][0] = 1.0f; coords[3][1] = 1.0f; coords[3][2] = 1.0f; + + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + info->binding = GL_TEXTURE_BINDING_CUBE_MAP_ARB; + info->bind_target = GL_TEXTURE_CUBE_MAP_ARB; + info->tex_type = tex_cube; + coords[0][0] = 1.0f; coords[0][1] = -1.0f; coords[0][2] = -1.0f; + coords[1][0] = -1.0f; coords[1][1] = -1.0f; coords[1][2] = -1.0f; + coords[2][0] = 1.0f; coords[2][1] = 1.0f; coords[2][2] = -1.0f; + coords[3][0] = -1.0f; coords[3][1] = 1.0f; coords[3][2] = -1.0f; + } +} + +static void surface_depth_blt(IWineD3DSurfaceImpl *This, GLuint texture, GLsizei w, GLsizei h, GLenum target) { IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; + struct depth_blt_info info; GLint old_binding = 0; glPushAttrib(GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_VIEWPORT_BIT); @@ -3972,24 +4066,25 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, GLuint texture, GLsizei glBlendFunc(GL_ZERO, GL_ONE); glViewport(0, 0, w, h); + surface_get_depth_blt_info(target, w, h, &info); GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB)); - glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding); - glBindTexture(GL_TEXTURE_2D, texture); + glGetIntegerv(info.binding, &old_binding); + glBindTexture(info.bind_target, texture); - device->shader_backend->shader_select_depth_blt((IWineD3DDevice *)device, tex_2d); + device->shader_backend->shader_select_depth_blt((IWineD3DDevice *)device, info.tex_type); glBegin(GL_TRIANGLE_STRIP); - glTexCoord2f(0.0f, 1.0f); + glTexCoord3fv(info.coords[0]); glVertex2f(-1.0f, -1.0f); - glTexCoord2f(1.0f, 1.0f); + glTexCoord3fv(info.coords[1]); glVertex2f(1.0f, -1.0f); - glTexCoord2f(0.0f, 0.0f); + glTexCoord3fv(info.coords[2]); glVertex2f(-1.0f, 1.0f); - glTexCoord2f(1.0f, 0.0f); + glTexCoord3fv(info.coords[3]); glVertex2f(1.0f, 1.0f); glEnd(); - glBindTexture(GL_TEXTURE_2D, old_binding); + glBindTexture(info.bind_target, old_binding); glPopAttrib(); @@ -4079,7 +4174,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { context_attach_depth_stencil_fbo(device, GL_FRAMEBUFFER_EXT, iface, FALSE); /* Do the actual blit */ - surface_depth_blt(This, device->depth_blt_texture, This->currentDesc.Width, This->currentDesc.Height); + surface_depth_blt(This, device->depth_blt_texture, This->currentDesc.Width, This->currentDesc.Height, GL_TEXTURE_2D); checkGLcall("depth_blt"); if (device->activeContext->current_fbo) { @@ -4101,7 +4196,7 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); checkGLcall("glBindFramebuffer()"); - surface_depth_blt(This, This->glDescription.textureName, This->currentDesc.Width, This->currentDesc.Height); + surface_depth_blt(This, This->glDescription.textureName, This->currentDesc.Width, This->currentDesc.Height, This->glDescription.target); checkGLcall("depth_blt"); if (device->activeContext->current_fbo) {
1
0
0
0
Henri Verbeet : wined3d: Support some more depth blt texture types for arb programs.
by Alexandre Julliard
29 Oct '08
29 Oct '08
Module: wine Branch: master Commit: 17ab7f6b83519c8f1dad5ee5df703f43a36b8839 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=17ab7f6b83519c8f1dad5ee5d…
Author: Henri Verbeet <hverbeet(a)gmail.com> Date: Tue Oct 28 21:25:05 2008 +0100 wined3d: Support some more depth blt texture types for arb programs. --- dlls/wined3d/arb_program_shader.c | 48 ++++++++++++++++++++++++++++++------- 1 files changed, 39 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index d1c6f91..ccb86b5 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -50,7 +50,7 @@ struct shader_arb_priv { GLuint current_vprogram_id; GLuint current_fprogram_id; GLuint depth_blt_vprogram_id; - GLuint depth_blt_fprogram_id; + GLuint depth_blt_fprogram_id[tex_type_count]; BOOL use_arbfp_fixed_func; struct hash_table_t *fragment_shaders; }; @@ -1805,18 +1805,44 @@ static GLuint create_arb_blt_vertex_program(WineD3D_GL_Info *gl_info) { return program_id; } -static GLuint create_arb_blt_fragment_program(WineD3D_GL_Info *gl_info) { +static GLuint create_arb_blt_fragment_program(WineD3D_GL_Info *gl_info, enum tex_types tex_type) +{ GLuint program_id = 0; - const char *blt_fprogram = + const char *blt_fprograms[tex_type_count] = + { + /* tex_1d */ + NULL, + /* tex_2d */ "!!ARBfp1.0\n" "TEMP R0;\n" "TEX R0.x, fragment.texcoord[0], texture[0], 2D;\n" "MOV result.depth.z, R0.x;\n" - "END\n"; + "END\n", + /* tex_3d */ + NULL, + /* tex_cube */ + "!!ARBfp1.0\n" + "TEMP R0;\n" + "TEX R0.x, fragment.texcoord[0], texture[0], CUBE;\n" + "MOV result.depth.z, R0.x;\n" + "END\n", + /* tex_rect */ + "!!ARBfp1.0\n" + "TEMP R0;\n" + "TEX R0.x, fragment.texcoord[0], texture[0], RECT;\n" + "MOV result.depth.z, R0.x;\n" + "END\n", + }; + + if (!blt_fprograms[tex_type]) + { + FIXME("tex_type %#x not supported\n", tex_type); + tex_type = tex_2d; + } GL_EXTCALL(glGenProgramsARB(1, &program_id)); GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, program_id)); - GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(blt_fprogram), blt_fprogram)); + GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(blt_fprograms[tex_type]), blt_fprograms[tex_type])); if (glGetError() == GL_INVALID_OPERATION) { GLint pos; @@ -1882,6 +1908,7 @@ static void shader_arb_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) { static void shader_arb_select_depth_blt(IWineD3DDevice *iface, enum tex_types tex_type) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; struct shader_arb_priv *priv = (struct shader_arb_priv *) This->shader_priv; + GLuint *blt_fprogram = &priv->depth_blt_fprogram_id[tex_type]; WineD3D_GL_Info *gl_info = &This->adapter->gl_info; if (tex_type != tex_2d) FIXME("Unsupported tex_type %#x\n", tex_type); @@ -1890,8 +1917,8 @@ static void shader_arb_select_depth_blt(IWineD3DDevice *iface, enum tex_types te GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, priv->depth_blt_vprogram_id)); glEnable(GL_VERTEX_PROGRAM_ARB); - if (!priv->depth_blt_fprogram_id) priv->depth_blt_fprogram_id = create_arb_blt_fragment_program(gl_info); - GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, priv->depth_blt_fprogram_id)); + if (!*blt_fprogram) *blt_fprogram = create_arb_blt_fragment_program(gl_info, tex_type); + GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, *blt_fprogram)); glEnable(GL_FRAGMENT_PROGRAM_ARB); } @@ -1956,12 +1983,15 @@ static void shader_arb_free(IWineD3DDevice *iface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; WineD3D_GL_Info *gl_info = &This->adapter->gl_info; struct shader_arb_priv *priv = (struct shader_arb_priv *) This->shader_priv; + int i; if(priv->depth_blt_vprogram_id) { GL_EXTCALL(glDeleteProgramsARB(1, &priv->depth_blt_vprogram_id)); } - if(priv->depth_blt_fprogram_id) { - GL_EXTCALL(glDeleteProgramsARB(1, &priv->depth_blt_fprogram_id)); + for (i = 0; i < tex_type_count; ++i) { + if (priv->depth_blt_fprogram_id[i]) { + GL_EXTCALL(glDeleteProgramsARB(1, &priv->depth_blt_fprogram_id[i])); + } } HeapFree(GetProcessHeap(), 0, This->shader_priv);
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
122
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
Results per page:
10
25
50
100
200