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
May 2018
----- 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
716 discussions
Start a n
N
ew thread
Akihiro Sagawa : winmm: Return a continuous stream position in MIDI stream.
by Alexandre Julliard
29 May '18
29 May '18
Module: wine Branch: master Commit: 2e2ff80567b4f64f5670330421421762a724b7c5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2e2ff80567b4f64f56703304…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Tue May 29 08:18:36 2018 -0500 winmm: Return a continuous stream position in MIDI stream. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winmm/tests/midi.c | 8 ++++---- dlls/winmm/winmm.c | 37 +++++++++++++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/dlls/winmm/tests/midi.c b/dlls/winmm/tests/midi.c index c78e465..091a500 100644 --- a/dlls/winmm/tests/midi.c +++ b/dlls/winmm/tests/midi.c @@ -869,7 +869,7 @@ static void test_midiStream(UINT udev, HWND hwnd) expected = 50; ret = get_position(hm, TIME_MS); - todo_wine ok(ret >= expected && ret < expected + MARGIN, "expected %ums or greater, got %ums\n", expected, ret); + ok(ret >= expected && ret < expected + MARGIN, "expected %ums or greater, got %ums\n", expected, ret); expected = ret; Sleep(100); @@ -882,7 +882,7 @@ static void test_midiStream(UINT udev, HWND hwnd) Sleep(1); ret = get_position(hm, TIME_MS); - todo_wine ok(ret > expected && ret < expected + MARGIN, "expected greater than %ums, got %ums\n", expected, ret); + ok(ret > expected && ret < expected + MARGIN, "expected greater than %ums, got %ums\n", expected, ret); expected = ret; ret = WaitForSingleObject(records.done, INFINITE); @@ -893,7 +893,7 @@ static void test_midiStream(UINT udev, HWND hwnd) expected = 250; /* = 12 ticks in 120 BPM */ ret = get_position(hm, TIME_MS); - ok(ret >= expected - MARGIN && ret <= expected + MARGIN, + todo_wine ok(ret >= expected - MARGIN && ret <= expected + MARGIN, "expected greater than %ums, got %ums\n", expected, ret); trace("after playing, got %ums\n", ret); @@ -924,7 +924,7 @@ static void test_midiStream(UINT udev, HWND hwnd) ok(!rc, "midiStreamStop(dev=%d) rc=%s\n", udev, mmsys_error(rc)); ret = get_position(hm, TIME_MS); - todo_wine ok(ret == 0, "expected 0ms, got %ums\n", ret); + ok(ret == 0, "expected 0ms, got %ums\n", ret); rc = midiStreamClose(hm); ok(!rc, "midiStreamClose(dev=%d) rc=%s\n", udev, mmsys_error(rc)); diff --git a/dlls/winmm/winmm.c b/dlls/winmm/winmm.c index 76807ab..2031c79 100644 --- a/dlls/winmm/winmm.c +++ b/dlls/winmm/winmm.c @@ -918,6 +918,7 @@ typedef struct WINE_MIDIStream { DWORD dwPositionMS; DWORD dwPulses; DWORD dwStartTicks; + DWORD dwElapsedMS; WORD wFlags; WORD status; HANDLE hEvent; @@ -973,6 +974,20 @@ static DWORD MMSYSTEM_MidiStream_Convert(WINE_MIDIStream* lpMidiStrm, DWORD puls return ret; } +static DWORD midistream_get_playing_position(WINE_MIDIStream* lpMidiStrm) +{ + switch (lpMidiStrm->status) { + case MSM_STATUS_STOPPED: + case MSM_STATUS_PAUSED: + return lpMidiStrm->dwElapsedMS; + case MSM_STATUS_PLAYING: + return GetTickCount() - lpMidiStrm->dwStartTicks; + default: + FIXME("Unknown playing status %hu\n", lpMidiStrm->status); + return 0; + } +} + /************************************************************************** * MMSYSTEM_MidiStream_MessageHandler [internal] */ @@ -988,7 +1003,11 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI return FALSE; case WINE_MSM_STOP: TRACE("STOP\n"); + EnterCriticalSection(&lpMidiStrm->lock); lpMidiStrm->status = MSM_STATUS_STOPPED; + lpMidiStrm->dwPulses = 0; + lpMidiStrm->dwElapsedMS = 0; + LeaveCriticalSection(&lpMidiStrm->lock); /* this is not quite what MS doc says... */ midiOutReset(lpMidiStrm->hDevice); /* empty list of already submitted buffers */ @@ -1008,13 +1027,22 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI return TRUE; case WINE_MSM_RESUME: /* FIXME: send out cc64 0 (turn off sustain pedal) on every channel */ - lpMidiStrm->dwStartTicks = GetTickCount() - lpMidiStrm->dwPositionMS; - lpMidiStrm->status = MSM_STATUS_PLAYING; + if (lpMidiStrm->status != MSM_STATUS_PLAYING) { + EnterCriticalSection(&lpMidiStrm->lock); + lpMidiStrm->dwStartTicks = GetTickCount() - lpMidiStrm->dwElapsedMS; + lpMidiStrm->status = MSM_STATUS_PLAYING; + LeaveCriticalSection(&lpMidiStrm->lock); + } SetEvent((HANDLE)msg->wParam); return TRUE; case WINE_MSM_PAUSE: /* FIXME: send out cc64 0 (turn off sustain pedal) on every channel */ - lpMidiStrm->status = MSM_STATUS_PAUSED; + if (lpMidiStrm->status != MSM_STATUS_PAUSED) { + EnterCriticalSection(&lpMidiStrm->lock); + lpMidiStrm->dwElapsedMS = GetTickCount() - lpMidiStrm->dwStartTicks; + lpMidiStrm->status = MSM_STATUS_PAUSED; + LeaveCriticalSection(&lpMidiStrm->lock); + } SetEvent((HANDLE)msg->wParam); break; /* FIXME(EPP): "I don't understand the content of the first MIDIHDR sent @@ -1302,6 +1330,7 @@ MMRESULT WINAPI midiStreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, lpMidiStrm->dwTimeDiv = 24; /* ticks per quarter note */ lpMidiStrm->dwPositionMS = 0; lpMidiStrm->status = MSM_STATUS_PAUSED; + lpMidiStrm->dwElapsedMS = 0; mosm.dwStreamID = (DWORD)lpMidiStrm; /* FIXME: the correct value is not allocated yet for MAPPER */ @@ -1460,7 +1489,7 @@ MMRESULT WINAPI midiStreamPosition(HMIDISTRM hMidiStrm, LPMMTIME lpMMT, UINT cbm lpMMT->wType = TIME_MS; /* fall through to alternative format */ case TIME_MS: - lpMMT->u.ms = lpMidiStrm->dwPositionMS; + lpMMT->u.ms = midistream_get_playing_position(lpMidiStrm); TRACE("=> %d ms\n", lpMMT->u.ms); break; case TIME_TICKS:
1
0
0
0
Akihiro Sagawa : winmm: Synchronize player status and API calls.
by Alexandre Julliard
29 May '18
29 May '18
Module: wine Branch: master Commit: 25f610f96ad7f892e4b117b166339a529050350e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=25f610f96ad7f892e4b117b1…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Tue May 29 08:18:05 2018 -0500 winmm: Synchronize player status and API calls. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winmm/winmm.c | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/dlls/winmm/winmm.c b/dlls/winmm/winmm.c index da87be2..76807ab 100644 --- a/dlls/winmm/winmm.c +++ b/dlls/winmm/winmm.c @@ -1004,15 +1004,18 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI (HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE, lpwm->mod.dwInstance, (DWORD_PTR)lphdr, 0); } + SetEvent((HANDLE)msg->wParam); return TRUE; case WINE_MSM_RESUME: /* FIXME: send out cc64 0 (turn off sustain pedal) on every channel */ lpMidiStrm->dwStartTicks = GetTickCount() - lpMidiStrm->dwPositionMS; lpMidiStrm->status = MSM_STATUS_PLAYING; + SetEvent((HANDLE)msg->wParam); return TRUE; case WINE_MSM_PAUSE: /* FIXME: send out cc64 0 (turn off sustain pedal) on every channel */ lpMidiStrm->status = MSM_STATUS_PAUSED; + SetEvent((HANDLE)msg->wParam); break; /* FIXME(EPP): "I don't understand the content of the first MIDIHDR sent * by native mcimidi, it doesn't look like a correct one". @@ -1387,20 +1390,49 @@ MMRESULT WINAPI midiStreamOut(HMIDISTRM hMidiStrm, LPMIDIHDR lpMidiHdr, return ret; } +static MMRESULT midistream_post_message_and_wait(WINE_MIDIStream* lpMidiStrm, UINT msg, LPARAM lParam) +{ + HANDLE hObjects[2]; + + hObjects[0] = CreateEventW(NULL, FALSE, FALSE, NULL); + if (!hObjects[0]) + return MMSYSERR_ERROR; + + if (!PostThreadMessageA(lpMidiStrm->dwThreadID, msg, (WPARAM)hObjects[0], lParam)) { + WARN("bad PostThreadMessage\n"); + CloseHandle(hObjects[0]); + return MMSYSERR_ERROR; + } + + if (GetCurrentThreadId() != lpMidiStrm->dwThreadID) { + DWORD ret; + hObjects[1] = lpMidiStrm->hThread; + ret = WaitForMultipleObjects(sizeof(hObjects)/sizeof(hObjects[0]), hObjects, + FALSE, INFINITE); + if (ret != WAIT_OBJECT_0) { + CloseHandle(hObjects[0]); + WARN("bad WaitForSingleObject (%u)\n", ret); + return MMSYSERR_ERROR; + } + } + + CloseHandle(hObjects[0]); + + return MMSYSERR_NOERROR; +} + /************************************************************************** * midiStreamPause [WINMM.@] */ MMRESULT WINAPI midiStreamPause(HMIDISTRM hMidiStrm) { WINE_MIDIStream* lpMidiStrm; - DWORD ret = MMSYSERR_NOERROR; TRACE("(%p)!\n", hMidiStrm); if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) return MMSYSERR_INVALHANDLE; - PostThreadMessageA(lpMidiStrm->dwThreadID, WINE_MSM_PAUSE, 0, 0); - return ret; + return midistream_post_message_and_wait(lpMidiStrm, WINE_MSM_PAUSE, 0); } /************************************************************************** @@ -1496,14 +1528,12 @@ MMRESULT WINAPI midiStreamProperty(HMIDISTRM hMidiStrm, LPBYTE lpPropData, DWORD MMRESULT WINAPI midiStreamRestart(HMIDISTRM hMidiStrm) { WINE_MIDIStream* lpMidiStrm; - MMRESULT ret = MMSYSERR_NOERROR; TRACE("(%p)!\n", hMidiStrm); if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) return MMSYSERR_INVALHANDLE; - PostThreadMessageA(lpMidiStrm->dwThreadID, WINE_MSM_RESUME, 0, 0); - return ret; + return midistream_post_message_and_wait(lpMidiStrm, WINE_MSM_RESUME, 0); } /************************************************************************** @@ -1512,14 +1542,12 @@ MMRESULT WINAPI midiStreamRestart(HMIDISTRM hMidiStrm) MMRESULT WINAPI midiStreamStop(HMIDISTRM hMidiStrm) { WINE_MIDIStream* lpMidiStrm; - MMRESULT ret = MMSYSERR_NOERROR; TRACE("(%p)!\n", hMidiStrm); if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) return MMSYSERR_INVALHANDLE; - PostThreadMessageA(lpMidiStrm->dwThreadID, WINE_MSM_STOP, 0, 0); - return ret; + return midistream_post_message_and_wait(lpMidiStrm, WINE_MSM_STOP, 0); } struct mm_starter
1
0
0
0
Józef Kucia : wined3d: Sort WINED3DSIH enum values.
by Alexandre Julliard
29 May '18
29 May '18
Module: wine Branch: master Commit: 1dd33399db687d3de43f6b667f81fbbdec4334b1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1dd33399db687d3de43f6b66…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue May 29 12:22:32 2018 +0200 wined3d: Sort WINED3DSIH enum values. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/shader.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 4fbb3a5..c05dca0 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -5084,7 +5084,6 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_DSY */ shader_hw_dsy, /* WINED3DSIH_DSY_COARSE */ NULL, /* WINED3DSIH_DSY_FINE */ NULL, - /* WINED3DSIH_EVAL_SAMPLE_INDEX */ NULL, /* WINED3DSIH_ELSE */ shader_hw_else, /* WINED3DSIH_EMIT */ NULL, /* WINED3DSIH_EMIT_STREAM */ NULL, @@ -5093,6 +5092,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_ENDREP */ shader_hw_endrep, /* WINED3DSIH_ENDSWITCH */ NULL, /* WINED3DSIH_EQ */ NULL, + /* WINED3DSIH_EVAL_SAMPLE_INDEX */ NULL, /* WINED3DSIH_EXP */ shader_hw_scalar_op, /* WINED3DSIH_EXPP */ shader_hw_scalar_op, /* WINED3DSIH_F16TOF32 */ NULL, diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 0d0e25a..3692a27 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -11292,7 +11292,6 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB /* WINED3DSIH_DSY */ shader_glsl_map2gl, /* WINED3DSIH_DSY_COARSE */ shader_glsl_map2gl, /* WINED3DSIH_DSY_FINE */ shader_glsl_map2gl, - /* WINED3DSIH_EVAL_SAMPLE_INDEX */ NULL, /* WINED3DSIH_ELSE */ shader_glsl_else, /* WINED3DSIH_EMIT */ shader_glsl_emit, /* WINED3DSIH_EMIT_STREAM */ shader_glsl_emit, @@ -11301,6 +11300,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB /* WINED3DSIH_ENDREP */ shader_glsl_end, /* WINED3DSIH_ENDSWITCH */ shader_glsl_end, /* WINED3DSIH_EQ */ shader_glsl_relop, + /* WINED3DSIH_EVAL_SAMPLE_INDEX */ NULL, /* WINED3DSIH_EXP */ shader_glsl_scalar_op, /* WINED3DSIH_EXPP */ shader_glsl_expp, /* WINED3DSIH_F16TOF32 */ shader_glsl_float16, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 3a0a302..8a6307a 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -125,7 +125,6 @@ static const char * const shader_opcode_names[] = /* WINED3DSIH_DSY */ "dsy", /* WINED3DSIH_DSY_COARSE */ "deriv_rty_coarse", /* WINED3DSIH_DSY_FINE */ "deriv_rty_fine", - /* WINED3DSIH_EVAL_SAMPLE_INDEX */ "eval_sample_index", /* WINED3DSIH_ELSE */ "else", /* WINED3DSIH_EMIT */ "emit", /* WINED3DSIH_EMIT_STREAM */ "emit_stream", @@ -134,6 +133,7 @@ static const char * const shader_opcode_names[] = /* WINED3DSIH_ENDREP */ "endrep", /* WINED3DSIH_ENDSWITCH */ "endswitch", /* WINED3DSIH_EQ */ "eq", + /* WINED3DSIH_EVAL_SAMPLE_INDEX */ "eval_sample_index", /* WINED3DSIH_EXP */ "exp", /* WINED3DSIH_EXPP */ "expp", /* WINED3DSIH_F16TOF32 */ "f16tof32", diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c30bb13..33bc463 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -771,7 +771,6 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER WINED3DSIH_DSY, WINED3DSIH_DSY_COARSE, WINED3DSIH_DSY_FINE, - WINED3DSIH_EVAL_SAMPLE_INDEX, WINED3DSIH_ELSE, WINED3DSIH_EMIT, WINED3DSIH_EMIT_STREAM, @@ -780,6 +779,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER WINED3DSIH_ENDREP, WINED3DSIH_ENDSWITCH, WINED3DSIH_EQ, + WINED3DSIH_EVAL_SAMPLE_INDEX, WINED3DSIH_EXP, WINED3DSIH_EXPP, WINED3DSIH_F16TOF32,
1
0
0
0
Jacek Caban : ole32/tests: Fixed tests on win64.
by Alexandre Julliard
29 May '18
29 May '18
Module: wine Branch: master Commit: d9677b1f2ad4130b75fdf729343e979987d04eaa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d9677b1f2ad4130b75fdf729…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue May 29 11:08:27 2018 +0200 ole32/tests: Fixed tests on win64. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/tests/marshal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index e71cbdb..4204903 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -1295,7 +1295,7 @@ static void test_marshal_channel_buffer(void) SET_EXPECT(GetWindow); hr = IOleWindow_GetWindow(ole_window, &hwnd); ok(hr == S_OK, "GetWindow failed: %08x\n", hr); - ok(hwnd == (HWND)0xdeadbeef, "hwnd = %p\n", hwnd); + ok((DWORD)(DWORD_PTR)hwnd == 0xdeadbeef, "hwnd = %p\n", hwnd); CHECK_CALLED(Invoke); CHECK_CALLED(GetWindow);
1
0
0
0
Pablo Martin : wined3d: Delete the wined3d_device_get_*_cb and wined3d_device_set_*_cb methods.
by Alexandre Julliard
29 May '18
29 May '18
Module: wine Branch: master Commit: f610f121b8a7cc2f0cc6e3af10d463b13ed3345d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f610f121b8a7cc2f0cc6e3af…
Author: Pablo Martin <pmart-wine(a)riseup.net> Date: Tue May 29 08:39:59 2018 +0200 wined3d: Delete the wined3d_device_get_*_cb and wined3d_device_set_*_cb methods. Signed-off-by: Pablo Martin <pmart-wine(a)riseup.net> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 12 +++---- dlls/wined3d/device.c | 84 ----------------------------------------------- dlls/wined3d/wined3d.spec | 12 ------- include/wine/wined3d.h | 12 ------- 4 files changed, 4 insertions(+), 116 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f610f121b8a7cc2f0cc6…
1
0
0
0
Pablo Martin : d3d11: Make d3d10 *GetConstantBuffers use a helper method.
by Alexandre Julliard
29 May '18
29 May '18
Module: wine Branch: master Commit: 506582ece6054adbbeaff60e5c22d1089b09186d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=506582ece6054adbbeaff60e…
Author: Pablo Martin <pmart-wine(a)riseup.net> Date: Tue May 29 08:39:58 2018 +0200 d3d11: Make d3d10 *GetConstantBuffers use a helper method. Signed-off-by: Pablo Martin <pmart-wine(a)riseup.net> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 92 +++++++++++++++++++---------------------------------- 1 file changed, 32 insertions(+), 60 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 0fdbb3c..d231284 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3890,6 +3890,32 @@ static ULONG STDMETHODCALLTYPE d3d10_device_Release(ID3D10Device1 *iface) /* ID3D10Device methods */ +static void d3d10_device_get_constant_buffers(ID3D10Device1 *iface, + enum wined3d_shader_type type, UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct wined3d_buffer *wined3d_buffer; + struct d3d_buffer *buffer_impl; + + if (!(wined3d_buffer = wined3d_device_get_constant_buffer(device->wined3d_device, + type, start_slot + i))) + { + buffers[i] = NULL; + continue; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + buffers[i] = &buffer_impl->ID3D10Buffer_iface; + ID3D10Buffer_AddRef(buffers[i]); + } + wined3d_mutex_unlock(); +} + static void d3d10_device_set_constant_buffers(ID3D10Device1 *iface, enum wined3d_shader_type type, UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) { @@ -4511,29 +4537,11 @@ static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device1 *ifa static void STDMETHODCALLTYPE d3d10_device_VSGetConstantBuffers(ID3D10Device1 *iface, UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct wined3d_buffer *wined3d_buffer; - struct d3d_buffer *buffer_impl; - - if (!(wined3d_buffer = wined3d_device_get_vs_cb(device->wined3d_device, start_slot + i))) - { - buffers[i] = NULL; - continue; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D10Buffer_iface; - ID3D10Buffer_AddRef(buffers[i]); - } - wined3d_mutex_unlock(); + d3d10_device_get_constant_buffers(iface, WINED3D_SHADER_TYPE_VERTEX, start_slot, buffer_count, + buffers); } static void STDMETHODCALLTYPE d3d10_device_PSGetShaderResources(ID3D10Device1 *iface, @@ -4639,29 +4647,11 @@ static void STDMETHODCALLTYPE d3d10_device_VSGetShader(ID3D10Device1 *iface, ID3 static void STDMETHODCALLTYPE d3d10_device_PSGetConstantBuffers(ID3D10Device1 *iface, UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct wined3d_buffer *wined3d_buffer; - struct d3d_buffer *buffer_impl; - - if (!(wined3d_buffer = wined3d_device_get_ps_cb(device->wined3d_device, start_slot + i))) - { - buffers[i] = NULL; - continue; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D10Buffer_iface; - ID3D10Buffer_AddRef(buffers[i]); - } - wined3d_mutex_unlock(); + d3d10_device_get_constant_buffers(iface, WINED3D_SHADER_TYPE_PIXEL, start_slot, buffer_count, + buffers); } static void STDMETHODCALLTYPE d3d10_device_IAGetInputLayout(ID3D10Device1 *iface, ID3D10InputLayout **input_layout) @@ -4747,29 +4737,11 @@ static void STDMETHODCALLTYPE d3d10_device_IAGetIndexBuffer(ID3D10Device1 *iface static void STDMETHODCALLTYPE d3d10_device_GSGetConstantBuffers(ID3D10Device1 *iface, UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct wined3d_buffer *wined3d_buffer; - struct d3d_buffer *buffer_impl; - - if (!(wined3d_buffer = wined3d_device_get_gs_cb(device->wined3d_device, start_slot + i))) - { - buffers[i] = NULL; - continue; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D10Buffer_iface; - ID3D10Buffer_AddRef(buffers[i]); - } - wined3d_mutex_unlock(); + d3d10_device_get_constant_buffers(iface, WINED3D_SHADER_TYPE_GEOMETRY, start_slot, buffer_count, + buffers); } static void STDMETHODCALLTYPE d3d10_device_GSGetShader(ID3D10Device1 *iface, ID3D10GeometryShader **shader)
1
0
0
0
Pablo Martin : d3d11: Make d3d10 *SetConstantBuffers use a helper method.
by Alexandre Julliard
29 May '18
29 May '18
Module: wine Branch: master Commit: 095964c4391736a9772e1e860eec2d600988af4d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=095964c4391736a9772e1e86…
Author: Pablo Martin <pmart-wine(a)riseup.net> Date: Tue May 29 08:39:57 2018 +0200 d3d11: Make d3d10 *SetConstantBuffers use a helper method. Signed-off-by: Pablo Martin <pmart-wine(a)riseup.net> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 47 +++++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index a35b82f..0fdbb3c 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3890,26 +3890,33 @@ static ULONG STDMETHODCALLTYPE d3d10_device_Release(ID3D10Device1 *iface) /* ID3D10Device methods */ -static void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device1 *iface, - UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) +static void d3d10_device_set_constant_buffers(ID3D10Device1 *iface, + enum wined3d_shader_type type, UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) { struct d3d_device *device = impl_from_ID3D10Device(iface); unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", - iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); for (i = 0; i < buffer_count; ++i) { struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); - wined3d_device_set_vs_cb(device->wined3d_device, start_slot + i, + wined3d_device_set_constant_buffer(device->wined3d_device, type, start_slot + i, buffer ? buffer->wined3d_buffer : NULL); } wined3d_mutex_unlock(); } +static void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device1 *iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) +{ + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", + iface, start_slot, buffer_count, buffers); + + d3d10_device_set_constant_buffers(iface, WINED3D_SHADER_TYPE_VERTEX, start_slot, + buffer_count, buffers); +} + static void STDMETHODCALLTYPE d3d10_device_PSSetShaderResources(ID3D10Device1 *iface, UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views) { @@ -4006,21 +4013,11 @@ static void STDMETHODCALLTYPE d3d10_device_Draw(ID3D10Device1 *iface, UINT verte static void STDMETHODCALLTYPE d3d10_device_PSSetConstantBuffers(ID3D10Device1 *iface, UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); - - wined3d_device_set_ps_cb(device->wined3d_device, start_slot + i, - buffer ? buffer->wined3d_buffer : NULL); - } - wined3d_mutex_unlock(); + d3d10_device_set_constant_buffers(iface, WINED3D_SHADER_TYPE_PIXEL, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device1 *iface, @@ -4110,21 +4107,11 @@ static void STDMETHODCALLTYPE d3d10_device_DrawInstanced(ID3D10Device1 *iface, static void STDMETHODCALLTYPE d3d10_device_GSSetConstantBuffers(ID3D10Device1 *iface, UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); - - wined3d_device_set_gs_cb(device->wined3d_device, start_slot + i, - buffer ? buffer->wined3d_buffer : NULL); - } - wined3d_mutex_unlock(); + d3d10_device_set_constant_buffers(iface, WINED3D_SHADER_TYPE_GEOMETRY, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d10_device_GSSetShader(ID3D10Device1 *iface, ID3D10GeometryShader *shader)
1
0
0
0
Pablo Martin : d3d11: Make d3d11 *GetConstantBuffers use a helper method.
by Alexandre Julliard
29 May '18
29 May '18
Module: wine Branch: master Commit: 7d9e02fc948edbfe7712d81d3077a1279b7b2728 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7d9e02fc948edbfe7712d81d…
Author: Pablo Martin <pmart-wine(a)riseup.net> Date: Tue May 29 08:39:56 2018 +0200 d3d11: Make d3d11 *GetConstantBuffers use a helper method. Signed-off-by: Pablo Martin <pmart-wine(a)riseup.net> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 155 +++++++++++++--------------------------------------- 1 file changed, 38 insertions(+), 117 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 5b5449c..a35b82f 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -97,6 +97,32 @@ static ULONG STDMETHODCALLTYPE d3d11_immediate_context_Release(ID3D11DeviceConte return refcount; } +static void d3d11_immediate_context_get_constant_buffers(ID3D11DeviceContext1 *iface, + enum wined3d_shader_type type, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) +{ + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + unsigned int i; + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct wined3d_buffer *wined3d_buffer; + struct d3d_buffer *buffer_impl; + + if (!(wined3d_buffer = wined3d_device_get_constant_buffer(device->wined3d_device, + type, start_slot + i))) + { + buffers[i] = NULL; + continue; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + buffers[i] = &buffer_impl->ID3D11Buffer_iface; + ID3D11Buffer_AddRef(buffers[i]); + } + wined3d_mutex_unlock(); +} + static void d3d11_immediate_context_set_constant_buffers(ID3D11DeviceContext1 *iface, enum wined3d_shader_type type, UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { @@ -1411,29 +1437,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetConstantBuffers(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct wined3d_buffer *wined3d_buffer; - struct d3d_buffer *buffer_impl; - - if (!(wined3d_buffer = wined3d_device_get_vs_cb(device->wined3d_device, start_slot + i))) - { - buffers[i] = NULL; - continue; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D11Buffer_iface; - ID3D11Buffer_AddRef(buffers[i]); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_get_constant_buffers(iface, WINED3D_SHADER_TYPE_VERTEX, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetShaderResources(ID3D11DeviceContext1 *iface, @@ -1553,29 +1561,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetShader(ID3D11DeviceCo static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct wined3d_buffer *wined3d_buffer; - struct d3d_buffer *buffer_impl; - - if (!(wined3d_buffer = wined3d_device_get_ps_cb(device->wined3d_device, start_slot + i))) - { - buffers[i] = NULL; - continue; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D11Buffer_iface; - ID3D11Buffer_AddRef(buffers[i]); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_get_constant_buffers(iface, WINED3D_SHADER_TYPE_PIXEL, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetInputLayout(ID3D11DeviceContext1 *iface, @@ -1666,29 +1656,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetIndexBuffer(ID3D11Dev static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct wined3d_buffer *wined3d_buffer; - struct d3d_buffer *buffer_impl; - - if (!(wined3d_buffer = wined3d_device_get_gs_cb(device->wined3d_device, start_slot + i))) - { - buffers[i] = NULL; - continue; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D11Buffer_iface; - ID3D11Buffer_AddRef(buffers[i]); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_get_constant_buffers(iface, WINED3D_SHADER_TYPE_GEOMETRY, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShader(ID3D11DeviceContext1 *iface, @@ -2193,28 +2165,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetSamplers(ID3D11Device static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct wined3d_buffer *wined3d_buffer; - struct d3d_buffer *buffer_impl; - - if (!(wined3d_buffer = wined3d_device_get_hs_cb(device->wined3d_device, start_slot + i))) - { - buffers[i] = NULL; - continue; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - ID3D11Buffer_AddRef(buffers[i] = &buffer_impl->ID3D11Buffer_iface); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_get_constant_buffers(iface, WINED3D_SHADER_TYPE_HULL, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetShaderResources(ID3D11DeviceContext1 *iface, @@ -2302,28 +2257,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetSamplers(ID3D11Device static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct wined3d_buffer *wined3d_buffer; - struct d3d_buffer *buffer_impl; - - if (!(wined3d_buffer = wined3d_device_get_ds_cb(device->wined3d_device, start_slot + i))) - { - buffers[i] = NULL; - continue; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - ID3D11Buffer_AddRef(buffers[i] = &buffer_impl->ID3D11Buffer_iface); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_get_constant_buffers(iface, WINED3D_SHADER_TYPE_DOMAIN, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetShaderResources(ID3D11DeviceContext1 *iface, @@ -2436,28 +2374,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetSamplers(ID3D11Device static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct wined3d_buffer *wined3d_buffer; - struct d3d_buffer *buffer_impl; - - if (!(wined3d_buffer = wined3d_device_get_cs_cb(device->wined3d_device, start_slot + i))) - { - buffers[i] = NULL; - continue; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - ID3D11Buffer_AddRef(buffers[i] = &buffer_impl->ID3D11Buffer_iface); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_get_constant_buffers(iface, WINED3D_SHADER_TYPE_COMPUTE, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_ClearState(ID3D11DeviceContext1 *iface)
1
0
0
0
Pablo Martin : d3d11: Make d3d11 *SetConstantBuffers use a helper method.
by Alexandre Julliard
29 May '18
29 May '18
Module: wine Branch: master Commit: 537c9dab9f8c0bc962385fa41c848690240b9cd4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=537c9dab9f8c0bc962385fa4…
Author: Pablo Martin <pmart-wine(a)riseup.net> Date: Tue May 29 08:39:55 2018 +0200 d3d11: Make d3d11 *SetConstantBuffers use a helper method. Signed-off-by: Pablo Martin <pmart-wine(a)riseup.net> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 101 +++++++++++++++------------------------------------- 1 file changed, 29 insertions(+), 72 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 36ed44b..5b5449c 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -97,6 +97,23 @@ static ULONG STDMETHODCALLTYPE d3d11_immediate_context_Release(ID3D11DeviceConte return refcount; } +static void d3d11_immediate_context_set_constant_buffers(ID3D11DeviceContext1 *iface, + enum wined3d_shader_type type, UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + unsigned int i; + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); + + wined3d_device_set_constant_buffer(device->wined3d_device, type, start_slot + i, + buffer ? buffer->wined3d_buffer : NULL); + } + wined3d_mutex_unlock(); +} + static void STDMETHODCALLTYPE d3d11_immediate_context_GetDevice(ID3D11DeviceContext1 *iface, ID3D11Device **device) { struct d3d_device *device_object = device_from_immediate_ID3D11DeviceContext1(iface); @@ -140,21 +157,11 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_SetPrivateDataInterface static void STDMETHODCALLTYPE d3d11_immediate_context_VSSetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); - - wined3d_device_set_vs_cb(device->wined3d_device, start_slot + i, - buffer ? buffer->wined3d_buffer : NULL); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_set_constant_buffers(iface, WINED3D_SHADER_TYPE_VERTEX, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_PSSetShaderResources(ID3D11DeviceContext1 *iface, @@ -302,21 +309,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_Unmap(ID3D11DeviceContext1 static void STDMETHODCALLTYPE d3d11_immediate_context_PSSetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); - - wined3d_device_set_ps_cb(device->wined3d_device, start_slot + i, - buffer ? buffer->wined3d_buffer : NULL); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_set_constant_buffers(iface, WINED3D_SHADER_TYPE_PIXEL, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_IASetInputLayout(ID3D11DeviceContext1 *iface, @@ -405,21 +402,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DrawInstanced(ID3D11Device static void STDMETHODCALLTYPE d3d11_immediate_context_GSSetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); - - wined3d_device_set_gs_cb(device->wined3d_device, start_slot + i, - buffer ? buffer->wined3d_buffer : NULL); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_set_constant_buffers(iface, WINED3D_SHADER_TYPE_GEOMETRY, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_GSSetShader(ID3D11DeviceContext1 *iface, @@ -1260,21 +1247,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetSamplers(ID3D11Device static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); - - wined3d_device_set_hs_cb(device->wined3d_device, start_slot + i, - buffer ? buffer->wined3d_buffer : NULL); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_set_constant_buffers(iface, WINED3D_SHADER_TYPE_HULL, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_DSSetShaderResources(ID3D11DeviceContext1 *iface, @@ -1337,21 +1314,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DSSetSamplers(ID3D11Device static void STDMETHODCALLTYPE d3d11_immediate_context_DSSetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); - - wined3d_device_set_ds_cb(device->wined3d_device, start_slot + i, - buffer ? buffer->wined3d_buffer : NULL); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_set_constant_buffers(iface, WINED3D_SHADER_TYPE_DOMAIN, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetShaderResources(ID3D11DeviceContext1 *iface, @@ -1434,21 +1401,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetSamplers(ID3D11Device static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetConstantBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); - unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", iface, start_slot, buffer_count, buffers); - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); - - wined3d_device_set_cs_cb(device->wined3d_device, start_slot + i, - buffer ? buffer->wined3d_buffer : NULL); - } - wined3d_mutex_unlock(); + d3d11_immediate_context_set_constant_buffers(iface, WINED3D_SHADER_TYPE_COMPUTE, start_slot, + buffer_count, buffers); } static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetConstantBuffers(ID3D11DeviceContext1 *iface,
1
0
0
0
Pablo Martin : wined3d: Expose wined3d_shader_type enum and wined3d_device_*_constant_buffer methods.
by Alexandre Julliard
29 May '18
29 May '18
Module: wine Branch: master Commit: a7a2d617920378b137aa0b277e0e945e2568acab URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a7a2d617920378b137aa0b27…
Author: Pablo Martin <pmart-wine(a)riseup.net> Date: Tue May 29 08:39:54 2018 +0200 wined3d: Expose wined3d_shader_type enum and wined3d_device_*_constant_buffer methods. Signed-off-by: Pablo Martin <pmart-wine(a)riseup.net> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/device.c | 8 ++++++-- dlls/wined3d/wined3d.spec | 2 ++ dlls/wined3d/wined3d_private.h | 14 -------------- include/wine/wined3d.h | 18 ++++++++++++++++++ 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index ec77a56..4124004 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2227,11 +2227,13 @@ struct wined3d_shader * CDECL wined3d_device_get_vertex_shader(const struct wine return device->state.shader[WINED3D_SHADER_TYPE_VERTEX]; } -static void wined3d_device_set_constant_buffer(struct wined3d_device *device, +void CDECL wined3d_device_set_constant_buffer(struct wined3d_device *device, enum wined3d_shader_type type, UINT idx, struct wined3d_buffer *buffer) { struct wined3d_buffer *prev; + TRACE("device %p, type %#x, idx %u, buffer %p.\n", device, type, idx, buffer); + if (idx >= MAX_CONSTANT_BUFFERS) { WARN("Invalid constant buffer index %u.\n", idx); @@ -2258,9 +2260,11 @@ void CDECL wined3d_device_set_vs_cb(struct wined3d_device *device, UINT idx, str wined3d_device_set_constant_buffer(device, WINED3D_SHADER_TYPE_VERTEX, idx, buffer); } -static struct wined3d_buffer *wined3d_device_get_constant_buffer(const struct wined3d_device *device, +struct wined3d_buffer * CDECL wined3d_device_get_constant_buffer(const struct wined3d_device *device, enum wined3d_shader_type shader_type, unsigned int idx) { + TRACE("device %p, shader_type %#x, idx %u.\n", device, shader_type, idx); + if (idx >= MAX_CONSTANT_BUFFERS) { WARN("Invalid constant buffer index %u.\n", idx); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index db50a44..c397f67 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -61,6 +61,7 @@ @ cdecl wined3d_device_get_clip_plane(ptr long ptr) @ cdecl wined3d_device_get_clip_status(ptr ptr) @ cdecl wined3d_device_get_compute_shader(ptr) +@ cdecl wined3d_device_get_constant_buffer(ptr long long) @ cdecl wined3d_device_get_creation_parameters(ptr ptr) @ cdecl wined3d_device_get_cs_cb(ptr long) @ cdecl wined3d_device_get_cs_resource_view(ptr long) @@ -137,6 +138,7 @@ @ cdecl wined3d_device_set_clip_plane(ptr long ptr) @ cdecl wined3d_device_set_clip_status(ptr ptr) @ cdecl wined3d_device_set_compute_shader(ptr ptr) +@ cdecl wined3d_device_set_constant_buffer(ptr long long ptr) @ cdecl wined3d_device_set_cs_cb(ptr long ptr) @ cdecl wined3d_device_set_cs_resource_view(ptr long ptr) @ cdecl wined3d_device_set_cs_sampler(ptr long ptr) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f2c4cd6..c30bb13 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -926,20 +926,6 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER WINED3DSIH_TABLE_SIZE }; -enum wined3d_shader_type -{ - WINED3D_SHADER_TYPE_PIXEL, - WINED3D_SHADER_TYPE_VERTEX, - WINED3D_SHADER_TYPE_GEOMETRY, - WINED3D_SHADER_TYPE_HULL, - WINED3D_SHADER_TYPE_DOMAIN, - WINED3D_SHADER_TYPE_GRAPHICS_COUNT, - - WINED3D_SHADER_TYPE_COMPUTE = WINED3D_SHADER_TYPE_GRAPHICS_COUNT, - WINED3D_SHADER_TYPE_COUNT, - WINED3D_SHADER_TYPE_INVALID = WINED3D_SHADER_TYPE_COUNT, -}; - struct wined3d_shader_version { enum wined3d_shader_type type; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index e15269f..17cc3b8 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -843,6 +843,20 @@ enum wined3d_shader_byte_code_format WINED3D_SHADER_BYTE_CODE_FORMAT_SM4 = 1, }; +enum wined3d_shader_type +{ + WINED3D_SHADER_TYPE_PIXEL, + WINED3D_SHADER_TYPE_VERTEX, + WINED3D_SHADER_TYPE_GEOMETRY, + WINED3D_SHADER_TYPE_HULL, + WINED3D_SHADER_TYPE_DOMAIN, + WINED3D_SHADER_TYPE_GRAPHICS_COUNT, + + WINED3D_SHADER_TYPE_COMPUTE = WINED3D_SHADER_TYPE_GRAPHICS_COUNT, + WINED3D_SHADER_TYPE_COUNT, + WINED3D_SHADER_TYPE_INVALID = WINED3D_SHADER_TYPE_COUNT, +}; + #define WINED3DCOLORWRITEENABLE_RED (1u << 0) #define WINED3DCOLORWRITEENABLE_GREEN (1u << 1) #define WINED3DCOLORWRITEENABLE_BLUE (1u << 2) @@ -2247,6 +2261,8 @@ HRESULT __cdecl wined3d_device_get_clip_plane(const struct wined3d_device *devic HRESULT __cdecl wined3d_device_get_clip_status(const struct wined3d_device *device, struct wined3d_clip_status *clip_status); struct wined3d_shader * __cdecl wined3d_device_get_compute_shader(const struct wined3d_device *device); +struct wined3d_buffer * __cdecl wined3d_device_get_constant_buffer(const struct wined3d_device *device, + enum wined3d_shader_type shader_type, unsigned int idx); void __cdecl wined3d_device_get_creation_parameters(const struct wined3d_device *device, struct wined3d_device_creation_parameters *creation_parameters); struct wined3d_buffer * __cdecl wined3d_device_get_cs_cb(const struct wined3d_device *device, unsigned int idx); @@ -2365,6 +2381,8 @@ HRESULT __cdecl wined3d_device_set_clip_plane(struct wined3d_device *device, HRESULT __cdecl wined3d_device_set_clip_status(struct wined3d_device *device, const struct wined3d_clip_status *clip_status); void __cdecl wined3d_device_set_compute_shader(struct wined3d_device *device, struct wined3d_shader *shader); +void __cdecl wined3d_device_set_constant_buffer(struct wined3d_device *device, enum wined3d_shader_type type, UINT idx, + struct wined3d_buffer *buffer); void __cdecl wined3d_device_set_cs_cb(struct wined3d_device *device, unsigned int idx, struct wined3d_buffer *buffer); void __cdecl wined3d_device_set_cs_resource_view(struct wined3d_device *device, unsigned int idx, struct wined3d_shader_resource_view *view);
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
72
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
Results per page:
10
25
50
100
200