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 2021
----- 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
770 discussions
Start a n
N
ew thread
Zebediah Figura : wined3d: Pass a wined3d_device_context to wined3d_cs_emit_set_clip_plane().
by Alexandre Julliard
14 May '21
14 May '21
Module: wine Branch: master Commit: 30501be16d486a3f334a303d9d7c27519524db15 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=30501be16d486a3f334a303d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu May 13 10:47:49 2021 -0500 wined3d: Pass a wined3d_device_context to wined3d_cs_emit_set_clip_plane(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/cs.c | 7 ++++--- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/wined3d_private.h | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 6345aa4f634..201d8834252 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1853,16 +1853,17 @@ static void wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *da device_invalidate_state(cs->c.device, STATE_CLIPPLANE(op->plane_idx)); } -void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) +void wined3d_device_context_emit_set_clip_plane(struct wined3d_device_context *context, + unsigned int plane_idx, const struct wined3d_vec4 *plane) { struct wined3d_cs_set_clip_plane *op; - op = wined3d_device_context_require_space(&cs->c, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); + op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_SET_CLIP_PLANE; op->plane_idx = plane_idx; op->plane = *plane; - wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT); + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); } static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e8be09d9e78..f02e904accf 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1493,7 +1493,7 @@ static HRESULT wined3d_device_set_clip_plane(struct wined3d_device *device, clip_planes[plane_idx] = *plane; - wined3d_cs_emit_set_clip_plane(device->cs, plane_idx, plane); + wined3d_device_context_emit_set_clip_plane(&device->cs->c, plane_idx, plane); return WINED3D_OK; } @@ -1837,7 +1837,7 @@ void CDECL wined3d_device_set_state(struct wined3d_device *device, struct wined3 for (i = 0; i < WINED3D_MAX_CLIP_DISTANCES; ++i) { - wined3d_cs_emit_set_clip_plane(device->cs, i, state->clip_planes + i); + wined3d_device_context_emit_set_clip_plane(context, i, state->clip_planes + i); } wined3d_cs_emit_set_material(device->cs, &state->material); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 69021675fe7..12e908d341d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4746,8 +4746,6 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, unsigned int swap_interval, DWORD flags) DECLSPEC_HIDDEN; void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN; -void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, - const struct wined3d_vec4 *plane) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; @@ -4791,6 +4789,8 @@ void wined3d_device_context_emit_generate_mipmaps(struct wined3d_device_context void wined3d_device_context_emit_set_blend_state(struct wined3d_device_context *context, struct wined3d_blend_state *state, const struct wined3d_color *blend_factor, unsigned int sample_mask) DECLSPEC_HIDDEN; +void wined3d_device_context_emit_set_clip_plane(struct wined3d_device_context *context, unsigned int plane_idx, + const struct wined3d_vec4 *plane) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_constant_buffer(struct wined3d_device_context *context, enum wined3d_shader_type type, UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_depth_stencil_state(struct wined3d_device_context *context,
1
0
0
0
Zebediah Figura : wined3d: Pass a wined3d_device_context to wined3d_cs_emit_set_transform().
by Alexandre Julliard
14 May '21
14 May '21
Module: wine Branch: master Commit: 6f9e338599462ff75d0fe296022ec4449d76fddc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6f9e338599462ff75d0fe296…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu May 13 10:47:48 2021 -0500 wined3d: Pass a wined3d_device_context to wined3d_cs_emit_set_transform(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/cs.c | 8 ++++---- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/wined3d_private.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index e94d1a19dc2..6345aa4f634 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1832,17 +1832,17 @@ static void wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *dat device_invalidate_state(cs->c.device, STATE_TRANSFORM(op->state)); } -void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, - const struct wined3d_matrix *matrix) +void wined3d_device_context_emit_set_transform(struct wined3d_device_context *context, + enum wined3d_transform_state state, const struct wined3d_matrix *matrix) { struct wined3d_cs_set_transform *op; - op = wined3d_device_context_require_space(&cs->c, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); + op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_SET_TRANSFORM; op->state = state; op->matrix = *matrix; - wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT); + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); } static void wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e62da01171c..e8be09d9e78 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1330,7 +1330,7 @@ static void wined3d_device_set_transform(struct wined3d_device *device, } device->cs->c.state->transforms[state] = *matrix; - wined3d_cs_emit_set_transform(device->cs, state, matrix); + wined3d_device_context_emit_set_transform(&device->cs->c, state, matrix); } static void wined3d_device_get_transform(const struct wined3d_device *device, @@ -1832,7 +1832,7 @@ void CDECL wined3d_device_set_state(struct wined3d_device *device, struct wined3 for (i = 0; i < WINED3D_HIGHEST_TRANSFORM_STATE + 1; ++i) { - wined3d_cs_emit_set_transform(device->cs, i, state->transforms + i); + wined3d_device_context_emit_set_transform(context, i, state->transforms + i); } for (i = 0; i < WINED3D_MAX_CLIP_DISTANCES; ++i) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c752be692fc..69021675fe7 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4757,8 +4757,6 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags) DECLSPEC_HIDDEN; -void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, - const struct wined3d_matrix *matrix) DECLSPEC_HIDDEN; void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; @@ -4828,6 +4826,8 @@ void wined3d_device_context_emit_set_texture(struct wined3d_device_context *cont struct wined3d_texture *texture) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_texture_state(struct wined3d_device_context *context, unsigned int stage, enum wined3d_texture_stage_state state, unsigned int value) DECLSPEC_HIDDEN; +void wined3d_device_context_emit_set_transform(struct wined3d_device_context *context, + enum wined3d_transform_state state, const struct wined3d_matrix *matrix) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_unordered_access_view(struct wined3d_device_context *context, enum wined3d_pipeline pipeline, unsigned int view_idx, struct wined3d_unordered_access_view *view, unsigned int initial_count) DECLSPEC_HIDDEN;
1
0
0
0
Derek Lesho : winegstreamer: Ensure that the source reports both PCM and floating point audio formats.
by Alexandre Julliard
14 May '21
14 May '21
Module: wine Branch: master Commit: 865bbff0d984403fc608ec63bdd8dd6500240cf3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=865bbff0d984403fc608ec63…
Author: Derek Lesho <dlesho(a)codeweavers.com> Date: Thu May 13 15:53:47 2021 +0200 winegstreamer: Ensure that the source reports both PCM and floating point audio formats. The patch is originally by Derek Lesho, with some changes by Giovanni Mascellani and Nikolay Sivov. Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfreadwrite/tests/mfplat.c | 3 --- dlls/winegstreamer/media_source.c | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c index ded45afe771..e3ff7f6e7aa 100644 --- a/dlls/mfreadwrite/tests/mfplat.c +++ b/dlls/mfreadwrite/tests/mfplat.c @@ -752,9 +752,6 @@ static void test_source_reader(void) if (SUCCEEDED(hr)) IMFMediaType_Release(mediatype); - hr = IMFSourceReader_GetNativeMediaType(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 1, &mediatype); - ok(hr == MF_E_NO_MORE_TYPES, "Unexpected hr %#x.\n", hr); - /* Current media type. */ hr = IMFSourceReader_GetCurrentMediaType(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, &mediatype); ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr); diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index eb5b9e366ec..7f308973270 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -806,6 +806,31 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) goto done; } } + else if (format.major_type == WG_MAJOR_TYPE_AUDIO) + { + /* Expose at least one PCM and one floating point type for the + consumer to pick from. */ + static const enum wg_audio_format audio_types[] = + { + WG_AUDIO_FORMAT_S16LE, + WG_AUDIO_FORMAT_F32LE, + }; + + stream_types = malloc( sizeof(IMFMediaType *) * (ARRAY_SIZE(audio_types) + 1) ); + + stream_types[0] = mf_media_type_from_wg_format(&format); + type_count = 1; + + for (i = 0; i < ARRAY_SIZE(audio_types); i++) + { + struct wg_format new_format; + if (format.u.audio.format == audio_types[i]) + continue; + new_format = format; + new_format.u.audio.format = audio_types[i]; + stream_types[type_count++] = mf_media_type_from_wg_format(&new_format); + } + } else { stream_type = mf_media_type_from_wg_format(&format);
1
0
0
0
Zebediah Figura : ws2_32: Use IOCTL_AFD_LISTEN.
by Alexandre Julliard
14 May '21
14 May '21
Module: wine Branch: master Commit: cdd24b1d9f0ddcc40cf9346aba28b919075c8db4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cdd24b1d9f0ddcc40cf9346a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu May 13 22:54:40 2021 -0500 ws2_32: Use IOCTL_AFD_LISTEN. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 6c03a57e325..2ba1982b1d9 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -4566,37 +4566,36 @@ int WINAPI WS_ioctlsocket(SOCKET s, LONG cmd, WS_u_long *argp) return WSAIoctl( s, cmd, argp, sizeof(WS_u_long), argp, sizeof(WS_u_long), &ret_size, NULL, NULL ); } + /*********************************************************************** - * listen (WS2_32.13) + * listen (ws2_32.13) */ -int WINAPI WS_listen(SOCKET s, int backlog) +int WINAPI WS_listen( SOCKET s, int backlog ) { - int fd = get_sock_fd( s, FILE_READ_DATA, NULL ), ret = SOCKET_ERROR; + struct afd_listen_params params = {.backlog = backlog}; + IO_STATUS_BLOCK io; + NTSTATUS status; + int fd, bound; - TRACE("socket %04lx, backlog %d\n", s, backlog); - if (fd != -1) - { - int bound = is_fd_bound(fd, NULL, NULL); + TRACE( "socket %#lx, backlog %d\n", s, backlog ); - if (bound <= 0) - { - SetLastError(bound == -1 ? wsaErrno() : WSAEINVAL); - } - else if (listen(fd, backlog) == 0) - { - _enable_event(SOCKET2HANDLE(s), FD_ACCEPT, - FD_WINE_LISTENING, - FD_CONNECT|FD_WINE_CONNECTED); - ret = 0; - } - else - SetLastError(wsaErrno()); - release_sock_fd( s, fd ); + if ((fd = get_sock_fd( s, FILE_READ_DATA, NULL )) == -1) + return -1; + bound = is_fd_bound( fd, NULL, NULL ); + release_sock_fd( s, fd ); + if (bound <= 0) + { + SetLastError( bound ? wsaErrno() : WSAEINVAL ); + return -1; } - return ret; + status = NtDeviceIoControlFile( SOCKET2HANDLE(s), NULL, NULL, NULL, &io, + IOCTL_AFD_LISTEN, ¶ms, sizeof(params), NULL, 0 ); + SetLastError( NtStatusToWSAError( status ) ); + return status ? -1 : 0; } + /*********************************************************************** * recv (WS2_32.16) */
1
0
0
0
Zebediah Figura : server: Implement IOCTL_AFD_LISTEN.
by Alexandre Julliard
14 May '21
14 May '21
Module: wine Branch: master Commit: 6ccf61fbc730bfbb64ccb75ddbc226bb19968694 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6ccf61fbc730bfbb64ccb75d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu May 13 22:54:39 2021 -0500 server: Implement IOCTL_AFD_LISTEN. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/wine/afd.h | 9 +++++++++ server/sock.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/include/wine/afd.h b/include/wine/afd.h index a711fba23a5..e890020ca88 100644 --- a/include/wine/afd.h +++ b/include/wine/afd.h @@ -24,6 +24,15 @@ #include <winioctl.h> #include "wine/server_protocol.h" +#define IOCTL_AFD_LISTEN CTL_CODE(FILE_DEVICE_BEEP, 0x802, METHOD_NEITHER, FILE_ANY_ACCESS) + +struct afd_listen_params +{ + int unknown1; + int backlog; + int unknown2; +}; + #define IOCTL_AFD_WINE_CREATE CTL_CODE(FILE_DEVICE_NETWORK, 200, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_AFD_WINE_ACCEPT CTL_CODE(FILE_DEVICE_NETWORK, 201, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_AFD_WINE_ACCEPT_INTO CTL_CODE(FILE_DEVICE_NETWORK, 202, METHOD_BUFFERED, FILE_ANY_ACCESS) diff --git a/server/sock.c b/server/sock.c index dadcc607fbb..945895b51a4 100644 --- a/server/sock.c +++ b/server/sock.c @@ -1354,10 +1354,11 @@ static struct accept_req *alloc_accept_req( struct sock *sock, struct sock *acce static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) { struct sock *sock = get_fd_user( fd ); + int unix_fd; assert( sock->obj.ops == &sock_ops ); - if (code != IOCTL_AFD_WINE_CREATE && get_unix_fd( fd ) < 0) return 0; + if (code != IOCTL_AFD_WINE_CREATE && (unix_fd = get_unix_fd( fd )) < 0) return 0; switch(code) { @@ -1459,6 +1460,32 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return 1; } + case IOCTL_AFD_LISTEN: + { + const struct afd_listen_params *params = get_req_data(); + + if (get_req_data_size() < sizeof(*params)) + { + set_error( STATUS_INVALID_PARAMETER ); + return 0; + } + + if (listen( unix_fd, params->backlog ) < 0) + { + set_error( sock_get_ntstatus( errno ) ); + return 0; + } + + sock->pending_events &= ~FD_ACCEPT; + sock->reported_events &= ~FD_ACCEPT; + sock->state |= FD_WINE_LISTENING; + sock->state &= ~(FD_CONNECT | FD_WINE_CONNECTED); + + /* we may already be selecting for FD_ACCEPT */ + sock_reselect( sock ); + return 0; + } + case IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE: if ((sock->state & FD_WINE_NONBLOCKING) && async_is_blocking( async )) {
1
0
0
0
Zebediah Figura : include: Use FILE_ANY_ACCESS for wine-specific socket ioctls.
by Alexandre Julliard
14 May '21
14 May '21
Module: wine Branch: master Commit: b07384c29250e1e01aa71a5de784d7cbafce332c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b07384c29250e1e01aa71a5d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu May 13 22:54:38 2021 -0500 include: Use FILE_ANY_ACCESS for wine-specific socket ioctls. All native ioctls use FILE_ANY_ACCESS. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/wine/afd.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wine/afd.h b/include/wine/afd.h index 3562962d6a1..a711fba23a5 100644 --- a/include/wine/afd.h +++ b/include/wine/afd.h @@ -24,11 +24,11 @@ #include <winioctl.h> #include "wine/server_protocol.h" -#define IOCTL_AFD_WINE_CREATE CTL_CODE(FILE_DEVICE_NETWORK, 200, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_AFD_WINE_ACCEPT CTL_CODE(FILE_DEVICE_NETWORK, 201, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_AFD_WINE_ACCEPT_INTO CTL_CODE(FILE_DEVICE_NETWORK, 202, METHOD_BUFFERED, FILE_WRITE_ACCESS) +#define IOCTL_AFD_WINE_CREATE CTL_CODE(FILE_DEVICE_NETWORK, 200, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AFD_WINE_ACCEPT CTL_CODE(FILE_DEVICE_NETWORK, 201, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AFD_WINE_ACCEPT_INTO CTL_CODE(FILE_DEVICE_NETWORK, 202, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE CTL_CODE(FILE_DEVICE_NETWORK, 323, METHOD_BUFFERED, 0) +#define IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE CTL_CODE(FILE_DEVICE_NETWORK, 323, METHOD_BUFFERED, FILE_ANY_ACCESS) struct afd_create_params {
1
0
0
0
Zebediah Figura : include: Rename Wine-specific socket ioctls.
by Alexandre Julliard
14 May '21
14 May '21
Module: wine Branch: master Commit: 98d1dc31fb492ed13538d45527e50c30315446c8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=98d1dc31fb492ed13538d455…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu May 13 22:54:37 2021 -0500 include: Rename Wine-specific socket ioctls. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 8 ++++---- include/wine/afd.h | 8 ++++---- server/sock.c | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 0a23b44cc68..6c03a57e325 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2341,7 +2341,7 @@ SOCKET WINAPI WS_accept( SOCKET s, struct WS_sockaddr *addr, int *len ) if (!(sync_event = CreateEventW( NULL, TRUE, FALSE, NULL ))) return INVALID_SOCKET; status = NtDeviceIoControlFile( SOCKET2HANDLE(s), (HANDLE)((ULONG_PTR)sync_event | 0), NULL, NULL, &io, - IOCTL_AFD_ACCEPT, NULL, 0, &accept_handle, sizeof(accept_handle) ); + IOCTL_AFD_WINE_ACCEPT, NULL, 0, &accept_handle, sizeof(accept_handle) ); if (status == STATUS_PENDING) { if (WaitForSingleObject( sync_event, INFINITE ) == WAIT_FAILED) @@ -2416,7 +2416,7 @@ static BOOL WINAPI WS2_AcceptEx( SOCKET listener, SOCKET acceptor, void *dest, D } status = NtDeviceIoControlFile( SOCKET2HANDLE(listener), overlapped->hEvent, NULL, cvalue, - (IO_STATUS_BLOCK *)overlapped, IOCTL_AFD_ACCEPT_INTO, ¶ms, sizeof(params), + (IO_STATUS_BLOCK *)overlapped, IOCTL_AFD_WINE_ACCEPT_INTO, ¶ms, sizeof(params), dest, recv_len + local_len + remote_len ); if (ret_len) *ret_len = overlapped->InternalHigh; @@ -4507,7 +4507,7 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID SetLastError(WSAEOPNOTSUPP); return SOCKET_ERROR; case WS_SIO_ADDRESS_LIST_CHANGE: - code = IOCTL_AFD_ADDRESS_LIST_CHANGE; + code = IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE; status = WSAEOPNOTSUPP; break; default: @@ -5921,7 +5921,7 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol, create_params.protocol = protocol; create_params.flags = flags & ~(WSA_FLAG_NO_HANDLE_INHERIT | WSA_FLAG_OVERLAPPED); if ((status = NtDeviceIoControlFile(handle, NULL, NULL, NULL, &io, - IOCTL_AFD_CREATE, &create_params, sizeof(create_params), NULL, 0))) + IOCTL_AFD_WINE_CREATE, &create_params, sizeof(create_params), NULL, 0))) { WARN("Failed to initialize socket, status %#x.\n", status); err = RtlNtStatusToDosError( status ); diff --git a/include/wine/afd.h b/include/wine/afd.h index 07320e7bab5..3562962d6a1 100644 --- a/include/wine/afd.h +++ b/include/wine/afd.h @@ -24,11 +24,11 @@ #include <winioctl.h> #include "wine/server_protocol.h" -#define IOCTL_AFD_CREATE CTL_CODE(FILE_DEVICE_NETWORK, 200, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_AFD_ACCEPT CTL_CODE(FILE_DEVICE_NETWORK, 201, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_AFD_ACCEPT_INTO CTL_CODE(FILE_DEVICE_NETWORK, 202, METHOD_BUFFERED, FILE_WRITE_ACCESS) +#define IOCTL_AFD_WINE_CREATE CTL_CODE(FILE_DEVICE_NETWORK, 200, METHOD_BUFFERED, FILE_WRITE_ACCESS) +#define IOCTL_AFD_WINE_ACCEPT CTL_CODE(FILE_DEVICE_NETWORK, 201, METHOD_BUFFERED, FILE_WRITE_ACCESS) +#define IOCTL_AFD_WINE_ACCEPT_INTO CTL_CODE(FILE_DEVICE_NETWORK, 202, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_AFD_ADDRESS_LIST_CHANGE CTL_CODE(FILE_DEVICE_NETWORK, 323, METHOD_BUFFERED, 0) +#define IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE CTL_CODE(FILE_DEVICE_NETWORK, 323, METHOD_BUFFERED, 0) struct afd_create_params { diff --git a/server/sock.c b/server/sock.c index 340566cbb0a..dadcc607fbb 100644 --- a/server/sock.c +++ b/server/sock.c @@ -1357,11 +1357,11 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) assert( sock->obj.ops == &sock_ops ); - if (code != IOCTL_AFD_CREATE && get_unix_fd( fd ) < 0) return 0; + if (code != IOCTL_AFD_WINE_CREATE && get_unix_fd( fd ) < 0) return 0; switch(code) { - case IOCTL_AFD_CREATE: + case IOCTL_AFD_WINE_CREATE: { const struct afd_create_params *params = get_req_data(); @@ -1374,7 +1374,7 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return 0; } - case IOCTL_AFD_ACCEPT: + case IOCTL_AFD_WINE_ACCEPT: { struct sock *acceptsock; obj_handle_t handle; @@ -1409,7 +1409,7 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return 0; } - case IOCTL_AFD_ACCEPT_INTO: + case IOCTL_AFD_WINE_ACCEPT_INTO: { static const int access = FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | FILE_READ_DATA; const struct afd_accept_into_params *params = get_req_data(); @@ -1459,7 +1459,7 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return 1; } - case IOCTL_AFD_ADDRESS_LIST_CHANGE: + case IOCTL_AFD_WINE_ADDRESS_LIST_CHANGE: if ((sock->state & FD_WINE_NONBLOCKING) && async_is_blocking( async )) { set_error( STATUS_DEVICE_NOT_READY );
1
0
0
0
Zebediah Figura : server: Always clear pending messages in sock_wake_up().
by Alexandre Julliard
14 May '21
14 May '21
Module: wine Branch: master Commit: 21efebbdc1350fdc987e8c7dcf35256907387d58 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=21efebbdc1350fdc987e8c7d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu May 13 22:54:36 2021 -0500 server: Always clear pending messages in sock_wake_up(). Instead of clearing all messages when any match. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/tests/sock.c | 2 +- server/sock.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 9116c2b169d..33cdd5d6d15 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -4553,7 +4553,7 @@ static void test_close_events(struct event_test_ctx *ctx) check_events(ctx, 0, 0, 200); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ); - check_events_todo(ctx, FD_CLOSE, 0, 200); + check_events_todo_event(ctx, FD_CLOSE, 0, 200); closesocket(server); } diff --git a/server/sock.c b/server/sock.c index 92202d317c4..340566cbb0a 100644 --- a/server/sock.c +++ b/server/sock.c @@ -400,12 +400,11 @@ static void sock_wake_up( struct sock *sock ) unsigned int events = sock->pending_events & sock->mask; int i; - if ( !events ) return; - if (sock->event) { if (debug_level) fprintf(stderr, "signalling events %x ptr %p\n", events, sock->event ); - set_event( sock->event ); + if (events) + set_event( sock->event ); } if (sock->window) {
1
0
0
0
Zebediah Figura : server: Poll for FD_CLOSE even if we cannot receive more data.
by Alexandre Julliard
14 May '21
14 May '21
Module: wine Branch: master Commit: aa6b2482ccf08a699e14d00aad2e2ffd040218dd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=aa6b2482ccf08a699e14d00a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu May 13 22:54:35 2021 -0500 server: Poll for FD_CLOSE even if we cannot receive more data. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/tests/sock.c | 6 +++--- server/sock.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 266ddc14451..9116c2b169d 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -4455,12 +4455,12 @@ static void test_close_events(struct event_test_ctx *ctx) check_events(ctx, 0, 0, 0); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ); if (ctx->is_message) - check_events_todo_msg(ctx, FD_CLOSE, 0, 200); + check_events(ctx, FD_CLOSE, 0, 200); check_events(ctx, 0, 0, 0); select_events(ctx, server, 0); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ); if (ctx->is_message) - check_events_todo_msg(ctx, FD_CLOSE, 0, 200); + check_events(ctx, FD_CLOSE, 0, 200); check_events(ctx, 0, 0, 0); ret = recv(server, buffer, 5, 0); @@ -4553,7 +4553,7 @@ static void test_close_events(struct event_test_ctx *ctx) check_events(ctx, 0, 0, 200); select_events(ctx, server, FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_OOB | FD_READ); - check_events_todo_event(ctx, FD_CLOSE, 0, 200); + check_events_todo(ctx, FD_CLOSE, 0, 200); closesocket(server); } diff --git a/server/sock.c b/server/sock.c index c8cd603149b..92202d317c4 100644 --- a/server/sock.c +++ b/server/sock.c @@ -786,8 +786,7 @@ static int sock_get_poll_events( struct fd *fd ) else if (smask & FD_READ || (sock->state & FD_WINE_LISTENING && mask & FD_ACCEPT)) ev |= POLLIN | POLLPRI; /* We use POLLIN with 0 bytes recv() as FD_CLOSE indication for stream sockets. */ - else if (sock->type == WS_SOCK_STREAM && (sock->state & FD_READ) && (mask & FD_CLOSE) && - !(sock->reported_events & FD_READ)) + else if (sock->type == WS_SOCK_STREAM && (mask & FD_CLOSE) && !(sock->reported_events & FD_READ)) ev |= POLLIN; if (async_queued( &sock->write_q ))
1
0
0
0
Zebediah Figura : vkd3d-shader: Write SM1 store instructions.
by Alexandre Julliard
14 May '21
14 May '21
Module: vkd3d Branch: master Commit: e23780301163e073495319fcdcba4f8e0021ba78 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=e23780301163e073495319f…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon May 10 23:36:08 2021 -0500 vkd3d-shader: Write SM1 store instructions. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/vkd3d_d3d9types.h | 22 ++++ libs/vkd3d-shader/hlsl_codegen.c | 220 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 242 insertions(+) diff --git a/include/vkd3d_d3d9types.h b/include/vkd3d_d3d9types.h index c204202..75d0461 100644 --- a/include/vkd3d_d3d9types.h +++ b/include/vkd3d_d3d9types.h @@ -33,6 +33,8 @@ #define D3DSP_DCL_USAGEINDEX_SHIFT 16 #define D3DSP_DSTMOD_SHIFT 20 +#define D3DSP_SRCMOD_SHIFT 24 + #define D3DSP_REGTYPE_SHIFT 28 #define D3DSP_REGTYPE_SHIFT2 8 #define D3DSP_REGTYPE_MASK (0x7 << D3DSP_REGTYPE_SHIFT) @@ -196,6 +198,26 @@ typedef enum _D3DSHADER_PARAM_REGISTER_TYPE D3DSPR_FORCE_DWORD = 0x7fffffff, } D3DSHADER_PARAM_REGISTER_TYPE; +typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE +{ + D3DSPSM_NONE = 0x0 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_NEG = 0x1 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_BIAS = 0x2 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_BIASNEG = 0x3 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_SIGN = 0x4 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_SIGNNEG = 0x5 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_COMP = 0x6 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_X2 = 0x7 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_X2NEG = 0x8 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_DZ = 0x9 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_DW = 0xa << D3DSP_SRCMOD_SHIFT, + D3DSPSM_ABS = 0xb << D3DSP_SRCMOD_SHIFT, + D3DSPSM_ABSNEG = 0xc << D3DSP_SRCMOD_SHIFT, + D3DSPSM_NOT = 0xd << D3DSP_SRCMOD_SHIFT, + + D3DSPSM_FORCE_DWORD = 0x7fffffff, +} D3DSHADER_PARAM_SRCMOD_TYPE; + typedef enum _D3DSHADER_MISCTYPE_OFFSETS { D3DSMO_POSITION = 0x0, diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index d499511..0dfbfb9 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -1097,6 +1097,101 @@ static void allocate_semantic_registers(struct hlsl_ctx *ctx) } } +static unsigned int map_swizzle(unsigned int swizzle, unsigned int writemask) +{ + unsigned int i, ret = 0; + + for (i = 0; i < 4; ++i) + { + if (writemask & (1 << i)) + { + ret |= (swizzle & 3) << (i * 2); + swizzle >>= 2; + } + } + return ret; +} + +static unsigned int swizzle_from_writemask(unsigned int writemask) +{ + static const unsigned int swizzles[16] = + { + 0, + HLSL_SWIZZLE(X, X, X, X), + HLSL_SWIZZLE(Y, Y, Y, Y), + HLSL_SWIZZLE(X, Y, X, X), + HLSL_SWIZZLE(Z, Z, Z, Z), + HLSL_SWIZZLE(X, Z, X, X), + HLSL_SWIZZLE(Y, Z, X, X), + HLSL_SWIZZLE(X, Y, Z, X), + HLSL_SWIZZLE(W, W, W, W), + HLSL_SWIZZLE(X, W, X, X), + HLSL_SWIZZLE(Y, W, X, X), + HLSL_SWIZZLE(X, Y, W, X), + HLSL_SWIZZLE(Z, W, X, X), + HLSL_SWIZZLE(X, Z, W, X), + HLSL_SWIZZLE(Y, Z, W, X), + HLSL_SWIZZLE(X, Y, Z, W), + }; + + return swizzles[writemask & 0xf]; +} + +static unsigned int combine_writemasks(unsigned int first, unsigned int second) +{ + unsigned int ret = 0, i, j = 0; + + for (i = 0; i < 4; ++i) + { + if (first & (1 << i)) + { + if (second & (1 << j++)) + ret |= (1 << i); + } + } + + return ret; +} + +static bool type_is_single_reg(const struct hlsl_type *type) +{ + return type->type == HLSL_CLASS_SCALAR || type->type == HLSL_CLASS_VECTOR; +} + +static struct hlsl_reg hlsl_reg_from_deref(const struct hlsl_deref *deref, const struct hlsl_type *type) +{ + struct hlsl_ir_node *offset_node = deref->offset.node; + const struct hlsl_ir_var *var = deref->var; + struct hlsl_reg ret = {0}; + unsigned int offset = 0; + + if (offset_node && offset_node->type != HLSL_IR_CONSTANT) + { + FIXME("Dereference with non-constant offset of type %s.\n", hlsl_node_type_to_string(offset_node->type)); + return ret; + } + + ret = var->reg; + + ret.allocated = var->reg.allocated; + ret.id = var->reg.id; + if (offset_node) + offset = hlsl_ir_constant(offset_node)->value.u[0]; + ret.id += offset / 4; + + if (type_is_single_reg(var->data_type)) + { + assert(!offset); + ret.writemask = var->reg.writemask; + } + else + { + assert(type_is_single_reg(type)); + ret.writemask = ((1 << type->dimx) - 1) << (offset & 3); + } + return ret; +} + struct bytecode_buffer { uint32_t *data; @@ -1428,6 +1523,57 @@ static uint32_t sm1_encode_dst(D3DSHADER_PARAM_REGISTER_TYPE type, return (1u << 31) | sm1_encode_register_type(type) | modifier | (writemask << 16) | reg; } +static uint32_t sm1_encode_src(D3DSHADER_PARAM_REGISTER_TYPE type, + D3DSHADER_PARAM_SRCMOD_TYPE modifier, unsigned int swizzle, uint32_t reg) +{ + return (1u << 31) | sm1_encode_register_type(type) | modifier | (swizzle << 16) | reg; +} + +struct sm1_instruction +{ + D3DSHADER_INSTRUCTION_OPCODE_TYPE opcode; + + struct + { + D3DSHADER_PARAM_REGISTER_TYPE type; + D3DSHADER_PARAM_DSTMOD_TYPE mod; + unsigned int writemask; + uint32_t reg; + } dst; + + struct + { + D3DSHADER_PARAM_REGISTER_TYPE type; + D3DSHADER_PARAM_SRCMOD_TYPE mod; + unsigned int swizzle; + uint32_t reg; + } srcs[2]; + unsigned int src_count; + + unsigned int has_dst; +}; + +static void write_sm1_instruction(struct hlsl_ctx *ctx, struct bytecode_buffer *buffer, + const struct sm1_instruction *instr) +{ + uint32_t token = instr->opcode; + unsigned int i; + + if (ctx->profile->major_version > 1) + token |= (instr->has_dst + instr->src_count) << D3DSI_INSTLENGTH_SHIFT; + put_dword(buffer, token); + + if (instr->has_dst) + { + assert(instr->dst.writemask); + put_dword(buffer, sm1_encode_dst(instr->dst.type, instr->dst.mod, instr->dst.writemask, instr->dst.reg)); + } + + for (i = 0; i < instr->src_count; ++i) + put_dword(buffer, sm1_encode_src(instr->srcs[i].type, instr->srcs[i].mod, + map_swizzle(instr->srcs[i].swizzle, instr->dst.writemask), instr->srcs[i].reg)); +}; + static void write_sm1_constant_defs(struct hlsl_ctx *ctx, struct bytecode_buffer *buffer) { unsigned int i, x; @@ -1504,6 +1650,79 @@ static void write_sm1_semantic_dcls(struct hlsl_ctx *ctx, struct bytecode_buffer } } +static void write_sm1_store(struct hlsl_ctx *ctx, struct bytecode_buffer *buffer, const struct hlsl_ir_node *instr) +{ + const struct hlsl_ir_store *store = hlsl_ir_store(instr); + const struct hlsl_ir_node *rhs = store->rhs.node; + const struct hlsl_reg reg = hlsl_reg_from_deref(&store->lhs, rhs->data_type); + struct sm1_instruction sm1_instr = + { + .opcode = D3DSIO_MOV, + + .dst.type = D3DSPR_TEMP, + .dst.reg = reg.id, + .dst.writemask = combine_writemasks(reg.writemask, store->writemask), + .has_dst = 1, + + .srcs[0].type = D3DSPR_TEMP, + .srcs[0].reg = rhs->reg.id, + .srcs[0].swizzle = swizzle_from_writemask(rhs->reg.writemask), + .src_count = 1, + }; + + if (store->lhs.var->data_type->type == HLSL_CLASS_MATRIX) + { + FIXME("Matrix writemasks need to be lowered.\n"); + return; + } + + if (store->lhs.var->is_output_semantic) + { + if (!sm1_register_from_semantic(ctx, &store->lhs.var->semantic, true, &sm1_instr.dst.type, &sm1_instr.dst.reg)) + { + assert(reg.allocated); + sm1_instr.dst.type = D3DSPR_OUTPUT; + sm1_instr.dst.reg = reg.id; + } + else + sm1_instr.dst.writemask = (1u << store->lhs.var->data_type->dimx) - 1; + } + else + assert(reg.allocated); + + write_sm1_instruction(ctx, buffer, &sm1_instr); +} + +static void write_sm1_instructions(struct hlsl_ctx *ctx, struct bytecode_buffer *buffer, + const struct hlsl_ir_function_decl *entry_func) +{ + const struct hlsl_ir_node *instr; + + LIST_FOR_EACH_ENTRY(instr, entry_func->body, struct hlsl_ir_node, entry) + { + if (instr->data_type) + { + if (instr->data_type->type == HLSL_CLASS_MATRIX) + { + FIXME("Matrix operations need to be lowered.\n"); + break; + } + + assert(instr->data_type->type == HLSL_CLASS_SCALAR || instr->data_type->type == HLSL_CLASS_VECTOR); + } + + switch (instr->type) + { + case HLSL_IR_STORE: + write_sm1_store(ctx, buffer, instr); + break; + + default: + FIXME("Unhandled instruction type %s.\n", hlsl_node_type_to_string(instr->type)); + } + } +} + static int write_sm1_shader(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func, struct vkd3d_shader_code *out) { @@ -1516,6 +1735,7 @@ static int write_sm1_shader(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl * write_sm1_constant_defs(ctx, &buffer); write_sm1_semantic_dcls(ctx, &buffer); + write_sm1_instructions(ctx, &buffer, entry_func); put_dword(&buffer, D3DSIO_END);
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200