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 2015
----- 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
2 participants
451 discussions
Start a n
N
ew thread
Sebastian Lackner : wined3d: Fix typo in init_output_registers.
by Alexandre Julliard
08 Apr '15
08 Apr '15
Module: wine Branch: master Commit: 3a14df3b9a9c5fbb6b9d292d4e5e748946587971 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a14df3b9a9c5fbb6b9d292d4…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Tue Apr 7 20:07:56 2015 +0200 wined3d: Fix typo in init_output_registers. --- dlls/wined3d/arb_program_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 0d4d5e1..091ae1d 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4166,7 +4166,7 @@ static void init_output_registers(const struct wined3d_shader *shader, for (j = 0; j < ps_input_sig->element_count; ++j) { - const struct wined3d_shader_signature_element *input = &ps_input_sig->elements[i]; + const struct wined3d_shader_signature_element *input = &ps_input_sig->elements[j]; if (!input->semantic_name) continue;
1
0
0
0
Nikolay Sivov : shell32: Cleanup IShellItem creation calls.
by Alexandre Julliard
08 Apr '15
08 Apr '15
Module: wine Branch: master Commit: 17339f4f94b9e76d52957e10a636627a56ab2517 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=17339f4f94b9e76d52957e10a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Apr 7 12:55:48 2015 +0300 shell32: Cleanup IShellItem creation calls. --- dlls/shell32/shellitem.c | 45 +++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index d8cb6a8..a410381 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -548,7 +548,6 @@ HRESULT WINAPI IShellItem_Constructor(IUnknown *pUnkOuter, REFIID riid, void **p HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent, IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi) { - ShellItem *This; LPITEMIDLIST new_pidl; HRESULT ret; @@ -597,16 +596,9 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent, return E_OUTOFMEMORY; } - ret = IShellItem_Constructor(NULL, &IID_IShellItem, (void**)&This); - if (This) - { - *ppsi = (IShellItem*)&This->IShellItem2_iface; - This->pidl = new_pidl; - } - else - { - ILFree(new_pidl); - } + ret = SHCreateItemFromIDList(new_pidl, &IID_IShellItem, (void**)ppsi); + ILFree(new_pidl); + return ret; } @@ -621,37 +613,34 @@ HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, ret = SHParseDisplayName(pszPath, pbc, &pidl, 0, NULL); if(SUCCEEDED(ret)) { - ShellItem *This; - ret = IShellItem_Constructor(NULL, riid, (void**)&This); - - if(SUCCEEDED(ret)) - { - This->pidl = pidl; - *ppv = (void*)This; - } - else - { - ILFree(pidl); - } + ret = SHCreateItemFromIDList(pidl, riid, ppv); + ILFree(pidl); } return ret; } HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv) { - ShellItem *psiimpl; + IPersistIDList *persist; HRESULT ret; if(!pidl) return E_INVALIDARG; - ret = IShellItem_Constructor(NULL, riid, ppv); - if(SUCCEEDED(ret)) + *ppv = NULL; + ret = IShellItem_Constructor(NULL, &IID_IPersistIDList, (void**)&persist); + if(FAILED(ret)) + return ret; + + ret = IPersistIDList_SetIDList(persist, pidl); + if(FAILED(ret)) { - psiimpl = (ShellItem*)*ppv; - psiimpl->pidl = ILClone(pidl); + IPersistIDList_Release(persist); + return ret; } + ret = IPersistIDList_QueryInterface(persist, riid, ppv); + IPersistIDList_Release(persist); return ret; }
1
0
0
0
Francois Gouget : shell32: Add support for the OS X 'My Stuff' folders.
by Alexandre Julliard
08 Apr '15
08 Apr '15
Module: wine Branch: master Commit: e9d010ef628ac58482cee9c6c7814516d5e79e0b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e9d010ef628ac58482cee9c6c…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Tue Apr 7 16:50:43 2015 +0200 shell32: Add support for the OS X 'My Stuff' folders. --- dlls/shell32/shellpath.c | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index cfd3094..b35f04f 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -813,6 +813,7 @@ static const WCHAR Microsoft_Windows_GameExplorerW[] = {'M','i','c','r','o','s', static const WCHAR Microsoft_Windows_LibrariesW[] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','L','i','b','r','a','r','i','e','s','\0'}; static const WCHAR Microsoft_Windows_RingtonesW[] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','R','i','n','g','t','o','n','e','s','\0'}; static const WCHAR Microsoft_Windows_Start_MenuW[] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','S','t','a','r','t',' ','M','e','n','u',0}; +static const WCHAR MoviesW[] = {'M','o','v','i','e','s','\0'}; static const WCHAR MusicW[] = {'M','u','s','i','c','\0'}; static const WCHAR Music_PlaylistsW[] = {'M','u','s','i','c','\\','P','l','a','y','l','i','s','t','s','\0'}; static const WCHAR Music_Sample_MusicW[] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','M','u','s','i','c','\0'}; @@ -2785,6 +2786,7 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) { static void _SHCreateSymbolicLinks(void) { UINT aidsMyStuff[] = { IDS_MYPICTURES, IDS_MYVIDEOS, IDS_MYMUSIC }, i; + const WCHAR* MyOSXStuffW[] = { PicturesW, MoviesW, MusicW }; int acsidlMyStuff[] = { CSIDL_MYPICTURES, CSIDL_MYVIDEO, CSIDL_MYMUSIC }; static const char * const xdg_dirs[] = { "PICTURES", "VIDEOS", "MUSIC", "DOCUMENTS", "DESKTOP" }; static const unsigned int num = sizeof(xdg_dirs) / sizeof(xdg_dirs[0]); @@ -2870,36 +2872,47 @@ static void _SHCreateSymbolicLinks(void) } /* Create symbolic links for 'My Pictures', 'My Videos' and 'My Music'. */ - for (i=0; i < sizeof(aidsMyStuff)/sizeof(aidsMyStuff[0]); i++) { + for (i=0; i < sizeof(aidsMyStuff)/sizeof(aidsMyStuff[0]); i++) + { /* Create the current 'My Whatever' folder and get its unix path. */ hr = SHGetFolderPathW(NULL, acsidlMyStuff[i]|CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_DEFAULT, wszTempPath); if (FAILED(hr)) continue; + pszMyStuff = wine_get_unix_file_name(wszTempPath); if (!pszMyStuff) continue; - strcpy(szMyStuffTarget, szPersonalTarget); - if (_SHAppendToUnixPath(szMyStuffTarget, MAKEINTRESOURCEW(aidsMyStuff[i])) && - !stat(szMyStuffTarget, &statFolder) && S_ISDIR(statFolder.st_mode)) - { - /* If there's a 'My Whatever' directory where 'My Documents' links to, link to it. */ - rmdir(pszMyStuff); - symlink(szMyStuffTarget, pszMyStuff); - } - else + while (1) { - rmdir(pszMyStuff); + /* Check for the Wine-specific '$HOME/My Documents' subfolder */ + strcpy(szMyStuffTarget, szPersonalTarget); + if (_SHAppendToUnixPath(szMyStuffTarget, MAKEINTRESOURCEW(aidsMyStuff[i])) && + !stat(szMyStuffTarget, &statFolder) && S_ISDIR(statFolder.st_mode)) + break; + + /* Try the XDG_XXX_DIR folder */ if (xdg_results && xdg_results[i]) { - /* the folder specified by XDG_XXX_DIR exists, link to it. */ - symlink(xdg_results[i], pszMyStuff); + strcpy(szMyStuffTarget, xdg_results[i]); + break; } - else + + /* Or the OS X folder (these are never localized) */ + if (pszHome) { - /* Else link to where 'My Documents' itself links to. */ - symlink(szPersonalTarget, pszMyStuff); + strcpy(szMyStuffTarget, pszHome); + if (_SHAppendToUnixPath(szMyStuffTarget, MyOSXStuffW[i]) && + !stat(szMyStuffTarget, &statFolder) && + S_ISDIR(statFolder.st_mode)) + break; } + + /* As a last resort point to the same location as 'My Documents' */ + strcpy(szMyStuffTarget, szPersonalTarget); + break; } + rmdir(pszMyStuff); + symlink(szMyStuffTarget, pszMyStuff); HeapFree(GetProcessHeap(), 0, pszMyStuff); }
1
0
0
0
Sebastian Lackner : server: Implement waiting for job objects.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: a7247df6ca54fd1209eff9f9199447643ebdaec5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a7247df6ca54fd1209eff9f91…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Apr 3 17:20:35 2015 +1100 server: Implement waiting for job objects. --- dlls/kernel32/tests/process.c | 2 -- server/process.c | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 0bd14dc..c63d6b1 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -2469,7 +2469,6 @@ static void test_WaitForJobObject(void) ok(ret, "TerminateJobObject error %u\n", GetLastError()); dwret = WaitForSingleObject(job, 500); - todo_wine ok(dwret == WAIT_OBJECT_0 || broken(dwret == WAIT_TIMEOUT), "WaitForSingleObject returned %u\n", dwret); @@ -2478,7 +2477,6 @@ static void test_WaitForJobObject(void) CloseHandle(pi.hProcess); CloseHandle(pi.hThread); CloseHandle(job); - todo_wine win_skip("TerminateJobObject doesn't signal job, skipping tests\n"); return; } diff --git a/server/process.c b/server/process.c index d912739..569a8fe 100644 --- a/server/process.c +++ b/server/process.c @@ -149,6 +149,7 @@ struct job int num_processes; /* count of running processes */ unsigned int limit_flags; /* limit flags */ int terminating; /* job is terminating */ + int signaled; /* job is signaled */ struct completion *completion_port; /* associated completion port */ apc_param_t completion_key; /* key to send with completion messages */ }; @@ -191,6 +192,7 @@ static struct job *create_job_object( struct directory *root, const struct unico job->num_processes = 0; job->limit_flags = 0; job->terminating = 0; + job->signaled = 0; job->completion_port = NULL; job->completion_key = 0; } @@ -281,6 +283,8 @@ static void terminate_job( struct job *job, int exit_code ) } job->terminating = 0; + job->signaled = 1; + wake_up( &job->obj, 0 ); } static void job_destroy( struct object *obj ) @@ -303,7 +307,8 @@ static void job_dump( struct object *obj, int verbose ) static int job_signaled( struct object *obj, struct wait_queue_entry *entry ) { - return 0; + struct job *job = (struct job *)obj; + return job->signaled; } struct ptid_entry
1
0
0
0
Sebastian Lackner : kernel32/tests: Add tests for waiting on an job object.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: 7984fb9fbe881b596d58c6dfa10d853ab0d06b6a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7984fb9fbe881b596d58c6dfa…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Apr 3 17:20:05 2015 +1100 kernel32/tests: Add tests for waiting on an job object. --- dlls/kernel32/tests/process.c | 85 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index d981ec9..0bd14dc 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -2443,6 +2443,90 @@ static void test_KillOnJobClose(void) CloseHandle(pi.hThread); } +static void test_WaitForJobObject(void) +{ + HANDLE job; + PROCESS_INFORMATION pi; + BOOL ret; + DWORD dwret; + + /* test waiting for a job object when the process is killed */ + job = pCreateJobObjectW(NULL, NULL); + ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + + dwret = WaitForSingleObject(job, 100); + ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); + + create_process("wait", &pi); + + ret = pAssignProcessToJobObject(job, pi.hProcess); + ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + + dwret = WaitForSingleObject(job, 100); + ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); + + ret = pTerminateJobObject(job, 123); + ok(ret, "TerminateJobObject error %u\n", GetLastError()); + + dwret = WaitForSingleObject(job, 500); + todo_wine + ok(dwret == WAIT_OBJECT_0 || broken(dwret == WAIT_TIMEOUT), + "WaitForSingleObject returned %u\n", dwret); + + if (dwret == WAIT_TIMEOUT) /* Win 2000/XP */ + { + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + CloseHandle(job); + todo_wine + win_skip("TerminateJobObject doesn't signal job, skipping tests\n"); + return; + } + + /* the object is not reset immediately */ + dwret = WaitForSingleObject(job, 100); + ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); + + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + + /* creating a new process doesn't reset the signalled state */ + create_process("wait", &pi); + + ret = pAssignProcessToJobObject(job, pi.hProcess); + ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + + dwret = WaitForSingleObject(job, 100); + ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); + + ret = pTerminateJobObject(job, 123); + ok(ret, "TerminateJobObject error %u\n", GetLastError()); + + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + + CloseHandle(job); + + /* repeat the test, but this time the process terminates properly */ + job = pCreateJobObjectW(NULL, NULL); + ok(job != NULL, "CreateJobObject error %u\n", GetLastError()); + + dwret = WaitForSingleObject(job, 100); + ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); + + create_process("exit", &pi); + + ret = pAssignProcessToJobObject(job, pi.hProcess); + ok(ret, "AssignProcessToJobObject error %u\n", GetLastError()); + + dwret = WaitForSingleObject(job, 100); + ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret); + + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + CloseHandle(job); +} + static HANDLE test_AddSelfToJob(void) { HANDLE job; @@ -2625,6 +2709,7 @@ START_TEST(process) test_QueryInformationJobObject(); test_CompletionPort(); test_KillOnJobClose(); + test_WaitForJobObject(); job = test_AddSelfToJob(); test_jobInheritance(job); test_BreakawayOk(job);
1
0
0
0
Andrew Cook : server: Implement TerminateJobObject.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: 1d359a5827159fb0572d598ed02054ff3d700f44 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1d359a5827159fb0572d598ed…
Author: Andrew Cook <ariscop(a)gmail.com> Date: Fri Apr 3 17:19:45 2015 +1100 server: Implement TerminateJobObject. --- dlls/kernel32/tests/process.c | 2 -- dlls/ntdll/sync.c | 15 +++++++++++++-- include/wine/server_protocol.h | 19 ++++++++++++++++++- server/process.c | 39 ++++++++++++++++++++++++++++++++++++++- server/process.h | 1 + server/protocol.def | 7 +++++++ server/request.h | 5 +++++ server/trace.c | 9 +++++++++ 8 files changed, 91 insertions(+), 6 deletions(-) diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 11c9253..d981ec9 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -2255,13 +2255,11 @@ static void test_TerminateJobObject(void) ok(ret, "TerminateJobObject error %u\n", GetLastError()); dwret = WaitForSingleObject(pi.hProcess, 1000); - todo_wine ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", dwret); if (dwret == WAIT_TIMEOUT) TerminateProcess(pi.hProcess, 0); ret = GetExitCodeProcess(pi.hProcess, &dwret); ok(ret, "GetExitCodeProcess error %u\n", GetLastError()); - todo_wine ok(dwret == 123 || broken(dwret == 0) /* randomly fails on Win 2000 / XP */, "wrong exitcode %u\n", dwret); diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index 5db736e..04c6de30 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -613,8 +613,19 @@ NTSTATUS WINAPI NtOpenJobObject( PHANDLE handle, ACCESS_MASK access, const OBJEC */ NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) { - FIXME( "stub: %p %x\n", handle, status ); - return STATUS_SUCCESS; + NTSTATUS ret; + + TRACE( "(%p, %d)\n", handle, status ); + + SERVER_START_REQ( terminate_job ) + { + req->handle = wine_server_obj_handle( handle ); + req->status = status; + ret = wine_server_call( req ); + } + SERVER_END_REQ; + + return ret; } /****************************************************************************** diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index de6302c..d27914a 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -5156,6 +5156,20 @@ struct set_job_completion_port_reply }; + +struct terminate_job_request +{ + struct request_header __header; + obj_handle_t handle; + int status; + char __pad_20[4]; +}; +struct terminate_job_reply +{ + struct reply_header __header; +}; + + enum request { REQ_new_process, @@ -5419,6 +5433,7 @@ enum request REQ_process_in_job, REQ_set_job_limits, REQ_set_job_completion_port, + REQ_terminate_job, REQ_NB_REQUESTS }; @@ -5687,6 +5702,7 @@ union generic_request struct process_in_job_request process_in_job_request; struct set_job_limits_request set_job_limits_request; struct set_job_completion_port_request set_job_completion_port_request; + struct terminate_job_request terminate_job_request; }; union generic_reply { @@ -5953,8 +5969,9 @@ union generic_reply struct process_in_job_reply process_in_job_reply; struct set_job_limits_reply set_job_limits_reply; struct set_job_completion_port_reply set_job_completion_port_reply; + struct terminate_job_reply terminate_job_reply; }; -#define SERVER_PROTOCOL_VERSION 466 +#define SERVER_PROTOCOL_VERSION 467 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/process.c b/server/process.c index eba47f7..d912739 100644 --- a/server/process.c +++ b/server/process.c @@ -64,6 +64,7 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry static unsigned int process_map_access( struct object *obj, unsigned int access ); static void process_poll_event( struct fd *fd, int event ); static void process_destroy( struct object *obj ); +static void terminate_process( struct process *process, struct thread *skip, int exit_code ); static const struct object_ops process_ops = { @@ -147,6 +148,7 @@ struct job struct list process_list; /* list of all processes */ int num_processes; /* count of running processes */ unsigned int limit_flags; /* limit flags */ + int terminating; /* job is terminating */ struct completion *completion_port; /* associated completion port */ apc_param_t completion_key; /* key to send with completion messages */ }; @@ -188,6 +190,7 @@ static struct job *create_job_object( struct directory *root, const struct unico list_init( &job->process_list ); job->num_processes = 0; job->limit_flags = 0; + job->terminating = 0; job->completion_port = NULL; job->completion_key = 0; } @@ -251,12 +254,35 @@ static void release_job_process( struct process *process ) assert( job->num_processes ); job->num_processes--; - add_job_completion( job, JOB_OBJECT_MSG_EXIT_PROCESS, get_process_id(process) ); + if (!job->terminating) + add_job_completion( job, JOB_OBJECT_MSG_EXIT_PROCESS, get_process_id(process) ); if (!job->num_processes) add_job_completion( job, JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO, 0 ); } +static void terminate_job( struct job *job, int exit_code ) +{ + /* don't report completion events for terminated processes */ + job->terminating = 1; + + for (;;) /* restart from the beginning of the list every time */ + { + struct process *process; + + /* find the first process associated with this job and still running */ + LIST_FOR_EACH_ENTRY( process, &job->process_list, struct process, job_entry ) + { + if (process->running_threads) break; + } + if (&process->job_entry == &job->process_list) break; /* no process found */ + assert( process->job == job ); + terminate_process( process, NULL, exit_code ); + } + + job->terminating = 0; +} + static void job_destroy( struct object *obj ) { struct job *job = (struct job *)obj; @@ -1543,6 +1569,17 @@ DECL_HANDLER(process_in_job) release_object( process ); } +/* terminate all processes associated with the job */ +DECL_HANDLER(terminate_job) +{ + struct job *job = get_job_obj( current->process, req->handle, JOB_OBJECT_TERMINATE ); + + if (!job) return; + + terminate_job( job, req->status ); + release_object( job ); +} + /* update limits of the job object */ DECL_HANDLER(set_job_limits) { diff --git a/server/process.h b/server/process.h index 58c313a..59625f0 100644 --- a/server/process.h +++ b/server/process.h @@ -26,6 +26,7 @@ struct atom_table; struct handle_table; struct startup_info; +struct job; /* process startup state */ enum startup_state { STARTUP_IN_PROGRESS, STARTUP_DONE, STARTUP_ABORTED }; diff --git a/server/protocol.def b/server/protocol.def index 625b3c9..54501e8 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3544,3 +3544,10 @@ enum coords_relative obj_handle_t port; /* handle to the completion port */ client_ptr_t key; /* key to send with completion messages */ @END + + +/* Terminate all processes associated with the job */ +@REQ(terminate_job) + obj_handle_t handle; /* handle to the job */ + int status; /* process exit code */ +@END diff --git a/server/request.h b/server/request.h index dd6e4e2..f94235f 100644 --- a/server/request.h +++ b/server/request.h @@ -367,6 +367,7 @@ DECL_HANDLER(assign_job); DECL_HANDLER(process_in_job); DECL_HANDLER(set_job_limits); DECL_HANDLER(set_job_completion_port); +DECL_HANDLER(terminate_job); #ifdef WANT_REQUEST_HANDLERS @@ -634,6 +635,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = (req_handler)req_process_in_job, (req_handler)req_set_job_limits, (req_handler)req_set_job_completion_port, + (req_handler)req_terminate_job, }; C_ASSERT( sizeof(affinity_t) == 8 ); @@ -2233,6 +2235,9 @@ C_ASSERT( FIELD_OFFSET(struct set_job_completion_port_request, job) == 12 ); C_ASSERT( FIELD_OFFSET(struct set_job_completion_port_request, port) == 16 ); C_ASSERT( FIELD_OFFSET(struct set_job_completion_port_request, key) == 24 ); C_ASSERT( sizeof(struct set_job_completion_port_request) == 32 ); +C_ASSERT( FIELD_OFFSET(struct terminate_job_request, handle) == 12 ); +C_ASSERT( FIELD_OFFSET(struct terminate_job_request, status) == 16 ); +C_ASSERT( sizeof(struct terminate_job_request) == 24 ); #endif /* WANT_REQUEST_HANDLERS */ diff --git a/server/trace.c b/server/trace.c index 0e2e7e2..236c9ab 100644 --- a/server/trace.c +++ b/server/trace.c @@ -4133,6 +4133,12 @@ static void dump_set_job_completion_port_request( const struct set_job_completio dump_uint64( ", key=", &req->key ); } +static void dump_terminate_job_request( const struct terminate_job_request *req ) +{ + fprintf( stderr, " handle=%04x", req->handle ); + fprintf( stderr, ", status=%d", req->status ); +} + static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_new_process_request, (dump_func)dump_get_new_process_info_request, @@ -4395,6 +4401,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_process_in_job_request, (dump_func)dump_set_job_limits_request, (dump_func)dump_set_job_completion_port_request, + (dump_func)dump_terminate_job_request, }; static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { @@ -4659,6 +4666,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { NULL, NULL, NULL, + NULL, }; static const char * const req_names[REQ_NB_REQUESTS] = { @@ -4923,6 +4931,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = { "process_in_job", "set_job_limits", "set_job_completion_port", + "terminate_job", }; static const struct
1
0
0
0
Stefan Dösinger : wined3d: Add more formats to wined3d_format_convert_color_to_float.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: b413a4e202de70ada3d753323f55f12489ecddab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b413a4e202de70ada3d753323…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Apr 6 00:28:54 2015 +0200 wined3d: Add more formats to wined3d_format_convert_color_to_float. --- dlls/wined3d/utils.c | 63 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index f3c84ac..215ddd8 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3511,11 +3511,48 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, c return 0; } +static float color_to_float(DWORD color, DWORD size, DWORD offset) +{ + DWORD mask = (1 << size) - 1; + + if (!size) + return 1.0f; + + color >>= offset; + color &= mask; + + return (float)color / (float)mask; +} + BOOL wined3d_format_convert_color_to_float(const struct wined3d_format *format, const struct wined3d_palette *palette, DWORD color, struct wined3d_color *float_color) { switch (format->id) { + case WINED3DFMT_B8G8R8_UNORM: + case WINED3DFMT_B8G8R8A8_UNORM: + case WINED3DFMT_B8G8R8X8_UNORM: + case WINED3DFMT_B5G6R5_UNORM: + case WINED3DFMT_B5G5R5X1_UNORM: + case WINED3DFMT_B5G5R5A1_UNORM: + case WINED3DFMT_B4G4R4A4_UNORM: + case WINED3DFMT_B2G3R3_UNORM: + case WINED3DFMT_R8_UNORM: + case WINED3DFMT_A8_UNORM: + case WINED3DFMT_B2G3R3A8_UNORM: + case WINED3DFMT_B4G4R4X4_UNORM: + case WINED3DFMT_R10G10B10A2_UNORM: + case WINED3DFMT_R10G10B10A2_SNORM: + case WINED3DFMT_R8G8B8A8_UNORM: + case WINED3DFMT_R8G8B8X8_UNORM: + case WINED3DFMT_R16G16_UNORM: + case WINED3DFMT_B10G10R10A2_UNORM: + float_color->r = color_to_float(color, format->red_size, format->red_offset); + float_color->g = color_to_float(color, format->green_size, format->green_size); + float_color->b = color_to_float(color, format->blue_size, format->blue_offset); + float_color->a = color_to_float(color, format->alpha_size, format->alpha_offset); + return TRUE; + case WINED3DFMT_P8_UINT: if (palette) { @@ -3530,36 +3567,12 @@ BOOL wined3d_format_convert_color_to_float(const struct wined3d_format *format, float_color->b = 0.0f; } float_color->a = color / 255.0f; - break; - - case WINED3DFMT_B5G6R5_UNORM: - float_color->r = ((color >> 11) & 0x1f) / 31.0f; - float_color->g = ((color >> 5) & 0x3f) / 63.0f; - float_color->b = (color & 0x1f) / 31.0f; - float_color->a = 1.0f; - break; - - case WINED3DFMT_B8G8R8_UNORM: - case WINED3DFMT_B8G8R8X8_UNORM: - float_color->r = D3DCOLOR_R(color); - float_color->g = D3DCOLOR_G(color); - float_color->b = D3DCOLOR_B(color); - float_color->a = 1.0f; - break; - - case WINED3DFMT_B8G8R8A8_UNORM: - float_color->r = D3DCOLOR_R(color); - float_color->g = D3DCOLOR_G(color); - float_color->b = D3DCOLOR_B(color); - float_color->a = D3DCOLOR_A(color); - break; + return TRUE; default: ERR("Unhandled conversion from %s to floating point.\n", debug_d3dformat(format->id)); return FALSE; } - - return TRUE; } /* DirectDraw stuff */
1
0
0
0
Stefan Dösinger : wined3d: Move surface_convert_color_to_float to utils.c.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: fa0a9232e05fd2e9d66bc3face95df85c5819f44 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fa0a9232e05fd2e9d66bc3fac…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Apr 6 00:28:53 2015 +0200 wined3d: Move surface_convert_color_to_float to utils.c. --- dlls/wined3d/surface.c | 60 +++--------------------------------------- dlls/wined3d/utils.c | 51 +++++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 56 insertions(+), 57 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index d27339b..e3601a2 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1013,62 +1013,6 @@ static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined return TRUE; } -static BOOL surface_convert_color_to_float(const struct wined3d_surface *surface, - DWORD color, struct wined3d_color *float_color) -{ - const struct wined3d_format *format = surface->resource.format; - const struct wined3d_palette *palette; - - switch (format->id) - { - case WINED3DFMT_P8_UINT: - palette = surface->container->swapchain ? surface->container->swapchain->palette : NULL; - - if (palette) - { - float_color->r = palette->colors[color].rgbRed / 255.0f; - float_color->g = palette->colors[color].rgbGreen / 255.0f; - float_color->b = palette->colors[color].rgbBlue / 255.0f; - } - else - { - float_color->r = 0.0f; - float_color->g = 0.0f; - float_color->b = 0.0f; - } - float_color->a = color / 255.0f; - break; - - case WINED3DFMT_B5G6R5_UNORM: - float_color->r = ((color >> 11) & 0x1f) / 31.0f; - float_color->g = ((color >> 5) & 0x3f) / 63.0f; - float_color->b = (color & 0x1f) / 31.0f; - float_color->a = 1.0f; - break; - - case WINED3DFMT_B8G8R8_UNORM: - case WINED3DFMT_B8G8R8X8_UNORM: - float_color->r = D3DCOLOR_R(color); - float_color->g = D3DCOLOR_G(color); - float_color->b = D3DCOLOR_B(color); - float_color->a = 1.0f; - break; - - case WINED3DFMT_B8G8R8A8_UNORM: - float_color->r = D3DCOLOR_R(color); - float_color->g = D3DCOLOR_G(color); - float_color->b = D3DCOLOR_B(color); - float_color->a = D3DCOLOR_A(color); - break; - - default: - ERR("Unhandled conversion from %s to floating point.\n", debug_d3dformat(format->id)); - return FALSE; - } - - return TRUE; -} - static BOOL surface_convert_depth_to_float(const struct wined3d_surface *surface, DWORD depth, float *float_depth) { const struct wined3d_format *format = surface->resource.format; @@ -5333,10 +5277,12 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC if (flags & WINEDDBLT_COLORFILL) { struct wined3d_color color; + const struct wined3d_palette *palette = dst_swapchain ? dst_swapchain->palette : NULL; TRACE("Color fill.\n"); - if (!surface_convert_color_to_float(dst_surface, fx->u5.dwFillColor, &color)) + if (!wined3d_format_convert_color_to_float(dst_surface->resource.format, + palette, fx->u5.dwFillColor, &color)) goto fallback; if (SUCCEEDED(surface_color_fill(dst_surface, &dst_rect, &color))) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 1cb928e..f3c84ac 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3511,6 +3511,57 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, c return 0; } +BOOL wined3d_format_convert_color_to_float(const struct wined3d_format *format, + const struct wined3d_palette *palette, DWORD color, struct wined3d_color *float_color) +{ + switch (format->id) + { + case WINED3DFMT_P8_UINT: + if (palette) + { + float_color->r = palette->colors[color].rgbRed / 255.0f; + float_color->g = palette->colors[color].rgbGreen / 255.0f; + float_color->b = palette->colors[color].rgbBlue / 255.0f; + } + else + { + float_color->r = 0.0f; + float_color->g = 0.0f; + float_color->b = 0.0f; + } + float_color->a = color / 255.0f; + break; + + case WINED3DFMT_B5G6R5_UNORM: + float_color->r = ((color >> 11) & 0x1f) / 31.0f; + float_color->g = ((color >> 5) & 0x3f) / 63.0f; + float_color->b = (color & 0x1f) / 31.0f; + float_color->a = 1.0f; + break; + + case WINED3DFMT_B8G8R8_UNORM: + case WINED3DFMT_B8G8R8X8_UNORM: + float_color->r = D3DCOLOR_R(color); + float_color->g = D3DCOLOR_G(color); + float_color->b = D3DCOLOR_B(color); + float_color->a = 1.0f; + break; + + case WINED3DFMT_B8G8R8A8_UNORM: + float_color->r = D3DCOLOR_R(color); + float_color->g = D3DCOLOR_G(color); + float_color->b = D3DCOLOR_B(color); + float_color->a = D3DCOLOR_A(color); + break; + + default: + ERR("Unhandled conversion from %s to floating point.\n", debug_d3dformat(format->id)); + return FALSE; + } + + return TRUE; +} + /* DirectDraw stuff */ enum wined3d_format_id pixelformat_for_depth(DWORD depth) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index e401b8a..5d736dd 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3167,6 +3167,8 @@ UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT alignment, UINT width, UINT height, UINT depth) DECLSPEC_HIDDEN; DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, const struct wined3d_color *color) DECLSPEC_HIDDEN; +BOOL wined3d_format_convert_color_to_float(const struct wined3d_format *format, + const struct wined3d_palette *palette, DWORD color, struct wined3d_color *float_color) DECLSPEC_HIDDEN; const struct wined3d_color_key_conversion * wined3d_format_get_color_key_conversion( const struct wined3d_texture *texture, BOOL need_alpha_ck) DECLSPEC_HIDDEN;
1
0
0
0
Stefan Dösinger : wined3d: Add a function for wined3d_gl_resource_type to texture target conversion.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: 8a101bc1f5a7ee563d68d6029231e51bea18ead4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8a101bc1f5a7ee563d68d6029…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Apr 6 00:28:52 2015 +0200 wined3d: Add a function for wined3d_gl_resource_type to texture target conversion. --- dlls/wined3d/arb_program_shader.c | 106 +++++++++++--------------------------- 1 file changed, 30 insertions(+), 76 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index e648cc8..0d4d5e1 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -6199,6 +6199,25 @@ static void gen_ffp_instr(struct wined3d_shader_buffer *buffer, unsigned int sta shader_addline(buffer, "MUL_SAT %s%s, %s, const.z;\n", dstreg, dstmask, dstreg); } +static const char *arbfp_texture_target(enum wined3d_gl_resource_type type) +{ + switch(type) + { + case WINED3D_GL_RES_TYPE_TEX_1D: + return "1D"; + case WINED3D_GL_RES_TYPE_TEX_2D: + return "2D"; + case WINED3D_GL_RES_TYPE_TEX_3D: + return "3D"; + case WINED3D_GL_RES_TYPE_TEX_CUBE: + return "CUBE"; + case WINED3D_GL_RES_TYPE_TEX_RECT: + return "RECT"; + default: + return "unexpected_resource_type"; + } +} + static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, const struct wined3d_gl_info *gl_info) { unsigned int stage; @@ -6345,27 +6364,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con if (!tex_read[stage]) continue; - switch(settings->op[stage].tex_type) - { - case WINED3D_GL_RES_TYPE_TEX_1D: - textype = "1D"; - break; - case WINED3D_GL_RES_TYPE_TEX_2D: - textype = "2D"; - break; - case WINED3D_GL_RES_TYPE_TEX_3D: - textype = "3D"; - break; - case WINED3D_GL_RES_TYPE_TEX_CUBE: - textype = "CUBE"; - break; - case WINED3D_GL_RES_TYPE_TEX_RECT: - textype = "RECT"; - break; - default: - textype = "unexpected_textype"; - break; - } + textype = arbfp_texture_target(settings->op[stage].tex_type); if(settings->op[stage].projected == proj_none) { instr = "TEX"; @@ -6910,7 +6909,7 @@ static BOOL gen_planar_yuv_read(struct wined3d_shader_buffer *buffer, const stru char *luminance) { char chroma; - const char *tex, *texinstr; + const char *tex, *texinstr = "TXP"; if (type->fixup == COMPLEX_FIXUP_UYVY) { @@ -6923,25 +6922,9 @@ static BOOL gen_planar_yuv_read(struct wined3d_shader_buffer *buffer, const stru *luminance = 'x'; } - switch (type->res_type) - { - case WINED3D_GL_RES_TYPE_TEX_2D: - tex = "2D"; - texinstr = "TXP"; - break; - - case WINED3D_GL_RES_TYPE_TEX_RECT: - tex = "RECT"; - texinstr = "TEX"; - break; - - default: - /* This is more tricky than just replacing the texture type - we have to navigate - * properly in the texture to find the correct chroma values - */ - FIXME("Implement yuv correction for non-2d, non-rect textures\n"); - return FALSE; - } + tex = arbfp_texture_target(type->res_type); + if (type->res_type == WINED3D_GL_RES_TYPE_TEX_RECT) + texinstr = "TEX"; /* First we have to read the chroma values. This means we need at least two pixels(no filtering), * or 4 pixels(with filtering). To get the unmodified chromas, we have to rid ourselves of the @@ -7017,20 +7000,7 @@ static BOOL gen_yv12_read(struct wined3d_shader_buffer *buffer, const struct arb static const float yv12_coef[] = {2.0f / 3.0f, 1.0f / 6.0f, (2.0f / 3.0f) + (1.0f / 6.0f), 1.0f / 3.0f}; - switch (type->res_type) - { - case WINED3D_GL_RES_TYPE_TEX_2D: - tex = "2D"; - break; - - case WINED3D_GL_RES_TYPE_TEX_RECT: - tex = "RECT"; - break; - - default: - FIXME("Implement yv12 correction for non-2d, non-rect textures\n"); - return FALSE; - } + tex = arbfp_texture_target(type->res_type); /* YV12 surfaces contain a WxH sized luminance plane, followed by a (W/2)x(H/2) * V and a (W/2)x(H/2) U plane, each with 8 bit per pixel. So the effective @@ -7179,18 +7149,7 @@ static BOOL gen_nv12_read(struct wined3d_shader_buffer *buffer, const struct arb static const float nv12_coef[] = {2.0f / 3.0f, 1.0f / 3.0f, 1.0f, 1.0f}; - switch (type->res_type) - { - case WINED3D_GL_RES_TYPE_TEX_2D: - tex = "2D"; - break; - case WINED3D_GL_RES_TYPE_TEX_RECT: - tex = "RECT"; - break; - default: - FIXME("Implement nv12 correction for non-2d, non-rect textures\n"); - return FALSE; - } + tex = arbfp_texture_target(type->res_type); /* NV12 surfaces contain a WxH sized luminance plane, followed by a (W/2)x(H/2) * sized plane where each component is an UV pair. So the effective @@ -7326,6 +7285,7 @@ static GLuint gen_p8_shader(struct arbfp_blit_priv *priv, GLenum shader; struct wined3d_shader_buffer buffer; GLint pos; + const char *tex_target = arbfp_texture_target(type->res_type); /* Shader header */ if (!shader_buffer_init(&buffer)) @@ -7349,10 +7309,7 @@ static GLuint gen_p8_shader(struct arbfp_blit_priv *priv, shader_addline(&buffer, "PARAM constants = { 0.996, 0.00195, 0, 0 };\n"); /* The alpha-component contains the palette index */ - if (type->res_type == WINED3D_GL_RES_TYPE_TEX_RECT) - shader_addline(&buffer, "TEX index, fragment.texcoord[0], texture[0], RECT;\n"); - else - shader_addline(&buffer, "TEX index, fragment.texcoord[0], texture[0], 2D;\n"); + shader_addline(&buffer, "TEX index, fragment.texcoord[0], texture[0], %s;\n", tex_target); /* Scale the index by 255/256 and add a bias of '0.5' in order to sample in the middle */ shader_addline(&buffer, "MAD index.a, index.a, constants.x, constants.y;\n"); @@ -7564,6 +7521,7 @@ static GLuint arbfp_gen_plain_shader(struct arbfp_blit_priv *priv, GLenum shader; struct wined3d_shader_buffer buffer; GLint pos; + const char *tex_target = arbfp_texture_target(type->res_type); /* Shader header */ if (!shader_buffer_init(&buffer)) @@ -7581,11 +7539,7 @@ static GLuint arbfp_gen_plain_shader(struct arbfp_blit_priv *priv, GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader)); shader_addline(&buffer, "!!ARBfp1.0\n"); - if (type->res_type == WINED3D_GL_RES_TYPE_TEX_RECT) - shader_addline(&buffer, "TEX result.color, fragment.texcoord[0], texture[0], RECT;\n"); - else - shader_addline(&buffer, "TEX result.color, fragment.texcoord[0], texture[0], 2D;\n"); - + shader_addline(&buffer, "TEX result.color, fragment.texcoord[0], texture[0], %s;\n", tex_target); shader_addline(&buffer, "END\n"); GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
1
0
0
0
Stefan Dösinger : wined3d: Use a shader for unconverted blits.
by Alexandre Julliard
07 Apr '15
07 Apr '15
Module: wine Branch: master Commit: f260c17b347460baf198e9b8a82e8ae001168815 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f260c17b347460baf198e9b8a…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Apr 6 00:28:51 2015 +0200 wined3d: Use a shader for unconverted blits. --- dlls/wined3d/arb_program_shader.c | 74 ++++++++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 719e8e5..e648cc8 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7558,6 +7558,54 @@ static GLuint gen_yuv_shader(struct arbfp_blit_priv *priv, const struct wined3d_ } /* Context activation is done by the caller. */ +static GLuint arbfp_gen_plain_shader(struct arbfp_blit_priv *priv, + const struct wined3d_gl_info *gl_info, const struct arbfp_blit_type *type) +{ + GLenum shader; + struct wined3d_shader_buffer buffer; + GLint pos; + + /* Shader header */ + if (!shader_buffer_init(&buffer)) + { + ERR("Failed to initialize shader buffer.\n"); + return 0; + } + + GL_EXTCALL(glGenProgramsARB(1, &shader)); + if (!shader) + { + shader_buffer_free(&buffer); + return 0; + } + GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader)); + + shader_addline(&buffer, "!!ARBfp1.0\n"); + if (type->res_type == WINED3D_GL_RES_TYPE_TEX_RECT) + shader_addline(&buffer, "TEX result.color, fragment.texcoord[0], texture[0], RECT;\n"); + else + shader_addline(&buffer, "TEX result.color, fragment.texcoord[0], texture[0], 2D;\n"); + + shader_addline(&buffer, "END\n"); + + GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, + strlen(buffer.buffer), buffer.buffer)); + checkGLcall("glProgramStringARB()"); + + gl_info->gl_ops.gl.p_glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos); + if (pos != -1) + { + FIXME("Fragment program error at position %d: %s\n\n", pos, + debugstr_a((const char *)gl_info->gl_ops.gl.p_glGetString(GL_PROGRAM_ERROR_STRING_ARB))); + shader_arb_dump_program_source(buffer.buffer); + } + + shader_buffer_free(&buffer); + + return shader; +} + +/* Context activation is done by the caller. */ static HRESULT arbfp_blit_set(void *blit_priv, struct wined3d_context *context, const struct wined3d_surface *surface) { GLenum shader; @@ -7577,17 +7625,10 @@ static HRESULT arbfp_blit_set(void *blit_priv, struct wined3d_context *context, return WINED3D_OK; } - if (!is_complex_fixup(surface->resource.format->color_fixup)) - { - TRACE("Fixup:\n"); - dump_color_fixup_desc(surface->resource.format->color_fixup); - /* Don't bother setting up a shader for unconverted formats */ - gl_info->gl_ops.gl.p_glEnable(gl_texture_type); - checkGLcall("glEnable(gl_texture_type)"); - return WINED3D_OK; - } - - fixup = get_complex_fixup(surface->resource.format->color_fixup); + if (is_complex_fixup(surface->resource.format->color_fixup)) + fixup = get_complex_fixup(surface->resource.format->color_fixup); + else + fixup = COMPLEX_FIXUP_NONE; switch (gl_texture_type) { @@ -7628,11 +7669,20 @@ static HRESULT arbfp_blit_set(void *blit_priv, struct wined3d_context *context, { switch (fixup) { + case COMPLEX_FIXUP_NONE: + if (!is_identity_fixup(surface->resource.format->color_fixup)) + FIXME("Implement support for sign or swizzle fixups.\n"); + shader = arbfp_gen_plain_shader(priv, gl_info, &type); + break; + case COMPLEX_FIXUP_P8: shader = gen_p8_shader(priv, gl_info, &type); break; - default: + case COMPLEX_FIXUP_YUY2: + case COMPLEX_FIXUP_UYVY: + case COMPLEX_FIXUP_YV12: + case COMPLEX_FIXUP_NV12: shader = gen_yuv_shader(priv, gl_info, &type); break; }
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
46
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
Results per page:
10
25
50
100
200