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
February 2022
----- 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
1495 discussions
Start a n
N
ew thread
Rémi Bernon : dinput: Remove unnecessary critical section entry.
by Alexandre Julliard
18 Feb '22
18 Feb '22
Module: wine Branch: master Commit: d5ff6917b76e1584d3a317c6a38687e99340dc35 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d5ff6917b76e1584d3a317c6…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Feb 18 10:31:15 2022 +0100 dinput: Remove unnecessary critical section entry. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 13c168bca89..ee67c904fa5 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1279,7 +1279,6 @@ static HRESULT hid_joystick_read( IDirectInputDevice8W *iface ) &index, impl->preparsed, report_buf, report_len ); if (status != HIDP_STATUS_SUCCESS) WARN( "HidP_GetUsageValue EFFECT_BLOCK_INDEX returned %#lx\n", status ); - EnterCriticalSection( &impl->base.crit ); effect_state = 0; device_state = impl->base.force_feedback_state & DIGFFS_EMPTY; while (count--) @@ -1308,7 +1307,6 @@ static HRESULT hid_joystick_read( IDirectInputDevice8W *iface ) LIST_FOR_EACH_ENTRY( effect, &impl->effect_list, struct hid_joystick_effect, entry ) if (effect->index == index) effect->status = effect_state; impl->base.force_feedback_state = device_state; - LeaveCriticalSection( &impl->base.crit ); } memset( &impl->read_ovl, 0, sizeof(impl->read_ovl) );
1
0
0
0
Rémi Bernon : dinput: Only read effect state reports when exclusively acquired.
by Alexandre Julliard
18 Feb '22
18 Feb '22
Module: wine Branch: master Commit: 6d7889ef5314ef73187a408a98db0d9113914ac4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6d7889ef5314ef73187a408a…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Feb 18 10:31:14 2022 +0100 dinput: Only read effect state reports when exclusively acquired. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 4987a9f9872..13c168bca89 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1273,7 +1273,7 @@ static HRESULT hid_joystick_read( IDirectInputDevice8W *iface ) if (impl->base.hEvent && memcmp( ¶ms.old_state, impl->base.device_state, format->dwDataSize )) SetEvent( impl->base.hEvent ); } - else if (report_buf[0] == impl->pid_effect_state.id) + else if (report_buf[0] == impl->pid_effect_state.id && is_exclusively_acquired( impl )) { status = HidP_GetUsageValue( HidP_Input, HID_USAGE_PAGE_PID, 0, PID_USAGE_EFFECT_BLOCK_INDEX, &index, impl->preparsed, report_buf, report_len );
1
0
0
0
Rémi Bernon : dinput: Also trace report buffers on immediate ReadFile success.
by Alexandre Julliard
18 Feb '22
18 Feb '22
Module: wine Branch: master Commit: f6ef943b9cea7cb82d8c748690fd3354da81ccf7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f6ef943b9cea7cb82d8c7486…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Feb 18 10:31:13 2022 +0100 dinput: Also trace report buffers on immediate ReadFile success. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 68db935c44a..4987a9f9872 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1226,24 +1226,23 @@ static HRESULT hid_joystick_read( IDirectInputDevice8W *iface ) BOOL ret; ret = GetOverlappedResult( impl->device, &impl->read_ovl, &count, FALSE ); - if (ret && TRACE_ON(dinput)) + + EnterCriticalSection( &impl->base.crit ); + while (ret) { - TRACE( "read size %lu report:\n", count ); - for (i = 0; i < count;) + if (TRACE_ON(dinput)) { - char buffer[256], *buf = buffer; - buf += sprintf(buf, "%08lx ", i); - do + TRACE( "iface %p, size %lu, report:\n", iface, count ); + for (i = 0; i < count;) { - buf += sprintf(buf, " %02x", (BYTE)report_buf[i] ); - } while (++i % 16 && i < count); - TRACE("%s\n", buffer); + char buffer[256], *buf = buffer; + buf += sprintf(buf, "%08lx ", i); + do { buf += sprintf(buf, " %02x", (BYTE)report_buf[i] ); } + while (++i % 16 && i < count); + TRACE("%s\n", buffer); + } } - } - EnterCriticalSection( &impl->base.crit ); - while (ret) - { count = impl->usages_count; memset( impl->usages_buf, 0, count * sizeof(*impl->usages_buf) ); status = HidP_GetUsagesEx( HidP_Input, 0, impl->usages_buf, &count,
1
0
0
0
Alistair Leslie-Hughes : include: Add AACMFTEncoder coclass.
by Alexandre Julliard
18 Feb '22
18 Feb '22
Module: wine Branch: master Commit: a9b3adaac0d16bea511fd8e3502bac63fcf1fc5f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a9b3adaac0d16bea511fd8e3…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Feb 18 16:46:13 2022 +1100 include: Add AACMFTEncoder coclass. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/wmcodecdsp.idl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/wmcodecdsp.idl b/include/wmcodecdsp.idl index 2d74790179c..ae2a42419b4 100644 --- a/include/wmcodecdsp.idl +++ b/include/wmcodecdsp.idl @@ -44,3 +44,8 @@ coclass CMSH264DecoderMFT {} uuid(2eeb4adf-4578-4d10-bca7-bb955f56320a) ] coclass CWMADecMediaObject {}; + +[ + uuid(93af0c51-2275-45d2-a35b-f2ba21caed00) +] +coclass AACMFTEncoder {};
1
0
0
0
Zebediah Figura : wined3d: Set a valid map pointer in adapter_gl_alloc_bo() if possible.
by Alexandre Julliard
18 Feb '22
18 Feb '22
Module: wine Branch: master Commit: 5dd3b178ce8cbebf84de3f418115a47798144dbc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5dd3b178ce8cbebf84de3f41…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Feb 18 15:50:25 2022 +0100 wined3d: Set a valid map pointer in adapter_gl_alloc_bo() if possible. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/adapter_gl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index cb0c34823aa..4e93e25452d 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4646,6 +4646,18 @@ static bool adapter_gl_alloc_bo(struct wined3d_device *device, struct wined3d_re return false; } + if (bo_gl->memory) + { + struct wined3d_allocator_chunk_gl *chunk = wined3d_allocator_chunk_gl(bo_gl->memory->chunk); + + wined3d_allocator_chunk_gl_lock(chunk); + + if ((bo_gl->b.map_ptr = chunk->c.map_ptr)) + ++chunk->c.map_count; + + wined3d_allocator_chunk_gl_unlock(chunk); + } + addr->buffer_object = &bo_gl->b; addr->addr = NULL;
1
0
0
0
Zebediah Figura : wined3d: Treat NOOVERWRITE maps on a previously discarded buffer as if they were DISCARD maps.
by Alexandre Julliard
18 Feb '22
18 Feb '22
Module: wine Branch: master Commit: 83fc1807f9f85ce6c1a2e05a1d772c2e28eafd27 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=83fc1807f9f85ce6c1a2e05a…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Feb 17 23:01:39 2022 -0600 wined3d: Treat NOOVERWRITE maps on a previously discarded buffer as if they were DISCARD maps. For the purposes of wined3d_cs_map_upload_bo(). That is, if a buffer was just created or just discarded [e.g. with wined3d_device_evict_managed_resources()], and then subsequently mapped with WINED3D_MAP_NOOVERWRITE, treat it as if it had been mapped with WINED3D_MAP_DISCARD instead, thus allowing the adapter_alloc_upload_bo callback to allocate a new buffer from the client thread. This was the source of a bunch of stalls in Grand Theft Auto V, although it's hard to measure a difference in performance. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/buffer.c | 3 +++ dlls/wined3d/cs.c | 13 ++++++++++++- dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 16308a098e3..63afa01bb2e 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1321,6 +1321,9 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d } buffer->maps_size = 1; + if (buffer->locations & WINED3D_LOCATION_DISCARDED) + buffer->resource.client.addr.buffer_object = CLIENT_BO_DISCARDED; + if (data) wined3d_buffer_init_data(buffer, device, data); diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 4a3b805c0bd..7280739b8b2 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -67,6 +67,14 @@ struct wined3d_command_list struct wined3d_deferred_query_issue *queries; }; +static void discard_client_address(struct wined3d_resource *resource) +{ + struct wined3d_client_resource *client = &resource->client; + + client->addr.buffer_object = CLIENT_BO_DISCARDED; + client->addr.addr = NULL; +} + static void invalidate_client_address(struct wined3d_resource *resource) { struct wined3d_client_resource *client = &resource->client; @@ -2430,7 +2438,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou { struct wined3d_cs_unload_resource *op; - invalidate_client_address(resource); + discard_client_address(resource); op = wined3d_device_context_require_space(&cs->c, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE; @@ -3134,6 +3142,9 @@ static bool wined3d_cs_map_upload_bo(struct wined3d_device_context *context, str return NULL; } + if ((flags & WINED3D_MAP_NOOVERWRITE) && client->addr.buffer_object == CLIENT_BO_DISCARDED) + flags = (flags & ~WINED3D_MAP_NOOVERWRITE) | WINED3D_MAP_DISCARD; + if (flags & WINED3D_MAP_DISCARD) { if (!device->adapter->adapter_ops->adapter_alloc_bo(device, resource, sub_resource_idx, &addr)) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index eff42be3aa6..989fd33d2bf 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4276,6 +4276,8 @@ static inline ULONG wined3d_atomic_decrement_mutex_lock(volatile LONG *refcount) return count - 1; } +#define CLIENT_BO_DISCARDED ((struct wined3d_bo *)~(UINT_PTR)0) + struct wined3d_client_resource { /* The resource's persistently mapped address, which we may use to perform
1
0
0
0
Zebediah Figura : wined3d: Try to allocate new OpenGL BOs from the client thread for DISCARD maps.
by Alexandre Julliard
18 Feb '22
18 Feb '22
Module: wine Branch: master Commit: 1b1b03055db8bf03c6783d4fcb19abf670d53338 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1b1b03055db8bf03c6783d4f…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Feb 17 23:01:37 2022 -0600 wined3d: Try to allocate new OpenGL BOs from the client thread for DISCARD maps. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/adapter_gl.c | 43 ++++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/buffer.c | 2 +- dlls/wined3d/cs.c | 36 +++++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 4 ++++ 4 files changed, 84 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index bc54f46222f..cb0c34823aa 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4616,6 +4616,49 @@ static void adapter_gl_flush_bo_address(struct wined3d_context *context, static bool adapter_gl_alloc_bo(struct wined3d_device *device, struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_bo_address *addr) { + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct wined3d_device_gl *device_gl = wined3d_device_gl(device); + + wined3d_not_from_cs(device->cs); + assert(device->context_count); + + if (resource->type == WINED3D_RTYPE_BUFFER) + { + GLenum usage = GL_STATIC_DRAW; + struct wined3d_bo_gl *bo_gl; + bool coherent = true; + + if (resource->usage & WINED3DUSAGE_DYNAMIC) + { + usage = GL_STREAM_DRAW_ARB; + coherent = false; + } + + if (!(bo_gl = heap_alloc(sizeof(*bo_gl)))) + return false; + + if (!(wined3d_device_gl_create_bo(device_gl, NULL, resource->size, + wined3d_buffer_gl_binding_from_bind_flags(gl_info, resource->bind_flags), + usage, coherent, wined3d_resource_gl_storage_flags(resource), bo_gl))) + { + WARN("Failed to create OpenGL buffer.\n"); + heap_free(bo_gl); + return false; + } + + addr->buffer_object = &bo_gl->b; + addr->addr = NULL; + + if (!bo_gl->b.map_ptr) + { + WARN_(d3d_perf)("BO %p (chunk %p) is not persistently mapped.\n", + bo_gl, bo_gl->memory ? bo_gl->memory->chunk : NULL); + wined3d_cs_map_bo_address(device->cs, addr, resource->size, WINED3D_MAP_WRITE | WINED3D_MAP_DISCARD); + } + + return true; + } + return false; } diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 3ecaa9017d0..16308a098e3 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -136,7 +136,7 @@ void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD loc wined3d_buffer_invalidate_range(buffer, location, 0, 0); } -static GLenum wined3d_buffer_gl_binding_from_bind_flags(const struct wined3d_gl_info *gl_info, uint32_t bind_flags) +GLenum wined3d_buffer_gl_binding_from_bind_flags(const struct wined3d_gl_info *gl_info, uint32_t bind_flags) { if (!bind_flags) return GL_PIXEL_UNPACK_BUFFER; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 027a6786717..4a3b805c0bd 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -118,6 +118,7 @@ enum wined3d_cs_op WINED3D_CS_OP_UNLOAD_RESOURCE, WINED3D_CS_OP_MAP, WINED3D_CS_OP_UNMAP, + WINED3D_CS_OP_MAP_BO_ADDRESS, WINED3D_CS_OP_BLT_SUB_RESOURCE, WINED3D_CS_OP_UPDATE_SUB_RESOURCE, WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, @@ -452,6 +453,14 @@ struct wined3d_cs_unmap HRESULT *hr; }; +struct wined3d_cs_map_bo_address +{ + enum wined3d_cs_op opcode; + struct wined3d_bo_address addr; + size_t size; + uint32_t flags; +}; + struct wined3d_cs_blt_sub_resource { enum wined3d_cs_op opcode; @@ -592,6 +601,7 @@ static const char *debug_cs_op(enum wined3d_cs_op op) WINED3D_TO_STR(WINED3D_CS_OP_UNLOAD_RESOURCE); WINED3D_TO_STR(WINED3D_CS_OP_MAP); WINED3D_TO_STR(WINED3D_CS_OP_UNMAP); + WINED3D_TO_STR(WINED3D_CS_OP_MAP_BO_ADDRESS); WINED3D_TO_STR(WINED3D_CS_OP_BLT_SUB_RESOURCE); WINED3D_TO_STR(WINED3D_CS_OP_UPDATE_SUB_RESOURCE); WINED3D_TO_STR(WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION); @@ -2548,6 +2558,31 @@ HRESULT wined3d_device_context_emit_unmap(struct wined3d_device_context *context return hr; } +static void wined3d_cs_exec_map_bo_address(struct wined3d_cs *cs, const void *data) +{ + const struct wined3d_cs_map_bo_address *op = data; + struct wined3d_context *context; + + context = context_acquire(cs->c.device, NULL, 0); + wined3d_context_map_bo_address(context, &op->addr, op->size, op->flags); + context_release(context); +} + +void wined3d_cs_map_bo_address(struct wined3d_cs *cs, + struct wined3d_bo_address *addr, size_t size, unsigned int flags) +{ + struct wined3d_device_context *context = &cs->c; + struct wined3d_cs_map_bo_address *op; + + op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_MAP); + op->opcode = WINED3D_CS_OP_MAP_BO_ADDRESS; + op->addr = *addr; + op->size = size; + op->flags = flags; + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_MAP); + wined3d_device_context_finish(context, WINED3D_CS_QUEUE_MAP); +} + static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *data) { const struct wined3d_cs_blt_sub_resource *op = data; @@ -2966,6 +3001,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_UNLOAD_RESOURCE */ wined3d_cs_exec_unload_resource, /* WINED3D_CS_OP_MAP */ wined3d_cs_exec_map, /* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap, + /* WINED3D_CS_OP_MAP_BO_ADDRESS */ wined3d_cs_exec_map_bo_address, /* WINED3D_CS_OP_BLT_SUB_RESOURCE */ wined3d_cs_exec_blt_sub_resource, /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource, /* WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION */ wined3d_cs_exec_add_dirty_texture_region, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index e190fc4285e..eff42be3aa6 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5034,6 +5034,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, 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; +void wined3d_cs_map_bo_address(struct wined3d_cs *cs, + struct wined3d_bo_address *addr, size_t size, unsigned int flags) DECLSPEC_HIDDEN; static inline void wined3d_cs_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id queue_id) { @@ -5217,6 +5219,8 @@ static inline const struct wined3d_buffer_gl *wined3d_buffer_gl_const(const stru return CONTAINING_RECORD(buffer, struct wined3d_buffer_gl, b); } +GLenum wined3d_buffer_gl_binding_from_bind_flags(const struct wined3d_gl_info *gl_info, + uint32_t bind_flags) DECLSPEC_HIDDEN; HRESULT wined3d_buffer_gl_init(struct wined3d_buffer_gl *buffer_gl, struct wined3d_device *device, const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
1
0
0
0
Zebediah Figura : wined3d: Do not allocate upload bufers for resources pinned to system memory.
by Alexandre Julliard
18 Feb '22
18 Feb '22
Module: wine Branch: master Commit: f257daf390362d88972502551b6fe2d15996f0d6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f257daf390362d8897250255…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Feb 17 23:01:36 2022 -0600 wined3d: Do not allocate upload bufers for resources pinned to system memory. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/cs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 9f4a39cfe7e..027a6786717 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -3092,6 +3092,12 @@ static bool wined3d_cs_map_upload_bo(struct wined3d_device_context *context, str return NULL; } + if (resource->pin_sysmem) + { + TRACE("Not allocating an upload buffer because system memory is pinned for this resource.\n"); + return NULL; + } + if (flags & WINED3D_MAP_DISCARD) { if (!device->adapter->adapter_ops->adapter_alloc_bo(device, resource, sub_resource_idx, &addr))
1
0
0
0
Zebediah Figura : wined3d: Move the "pin sysmem" flag to struct wined3d_resource.
by Alexandre Julliard
18 Feb '22
18 Feb '22
Module: wine Branch: master Commit: c724df3b8eb4ce186240bb1a8531ee6c2a35e6e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c724df3b8eb4ce186240bb1a…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Feb 17 23:01:35 2022 -0600 wined3d: Move the "pin sysmem" flag to struct wined3d_resource. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/buffer.c | 13 ++++++------- dlls/wined3d/texture.c | 18 +++++++++++------- dlls/wined3d/wined3d_private.h | 3 ++- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 7c3537e466e..3ecaa9017d0 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -30,7 +30,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); #define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */ #define WINED3D_BUFFER_USE_BO 0x02 /* Use a buffer object for this buffer. */ -#define WINED3D_BUFFER_PIN_SYSMEM 0x04 /* Keep a system memory copy for this buffer. */ #define VB_MAXDECLCHANGES 100 /* After that number of decl changes we stop converting */ #define VB_RESETDECLCHANGE 1000 /* Reset the decl changecount after that number of draws */ @@ -47,7 +46,7 @@ struct wined3d_buffer_ops static void wined3d_buffer_evict_sysmem(struct wined3d_buffer *buffer) { - if (buffer->flags & WINED3D_BUFFER_PIN_SYSMEM) + if (buffer->resource.pin_sysmem) { TRACE("Not evicting system memory for buffer %p.\n", buffer); return; @@ -513,7 +512,7 @@ static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined ERR("Failed to load system memory.\n"); return; } - buffer->flags |= WINED3D_BUFFER_PIN_SYSMEM; + buffer->resource.pin_sysmem = 1; /* Now for each vertex in the buffer that needs conversion. */ vertex_count = buffer->resource.size / buffer->stride; @@ -666,7 +665,7 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, BYTE *wined3d_buffer_load_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *context) { if (wined3d_buffer_load_location(buffer, context, WINED3D_LOCATION_SYSMEM)) - buffer->flags |= WINED3D_BUFFER_PIN_SYSMEM; + buffer->resource.pin_sysmem = 1; return buffer->resource.heap_memory; } @@ -966,7 +965,7 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc if (((flags & WINED3D_MAP_WRITE) && !(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_DISCARD))) || (!(flags & WINED3D_MAP_WRITE) && (buffer->locations & WINED3D_LOCATION_SYSMEM)) - || buffer->flags & WINED3D_BUFFER_PIN_SYSMEM + || buffer->resource.pin_sysmem || !(buffer->flags & WINED3D_BUFFER_USE_BO)) { if (!(buffer->locations & WINED3D_LOCATION_SYSMEM)) @@ -1036,7 +1035,7 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc { TRACE("Falling back to doublebuffered operation.\n"); wined3d_buffer_load_location(buffer, context, WINED3D_LOCATION_SYSMEM); - buffer->flags |= WINED3D_BUFFER_PIN_SYSMEM; + buffer->resource.pin_sysmem = 1; } TRACE("New pointer is %p.\n", resource->heap_memory); } @@ -1302,7 +1301,7 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d * maps and retain data in DISCARD maps. Keep a system memory copy of * the buffer to provide the same behavior to the application. */ TRACE("Pinning system memory.\n"); - buffer->flags |= WINED3D_BUFFER_PIN_SYSMEM; + buffer->resource.pin_sysmem = 1; buffer->locations = WINED3D_LOCATION_SYSMEM; } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index b1fd1e7bde2..1323d533eff 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -48,8 +48,8 @@ struct wined3d_rect_f BOOL wined3d_texture_can_use_pbo(const struct wined3d_texture *texture, const struct wined3d_d3d_info *d3d_info) { - if (!d3d_info->pbo || texture->resource.format->conv_byte_count - || (texture->flags & (WINED3D_TEXTURE_PIN_SYSMEM | WINED3D_TEXTURE_COND_NP2_EMULATED))) + if (!d3d_info->pbo || texture->resource.format->conv_byte_count || texture->resource.pin_sysmem + || (texture->flags & WINED3D_TEXTURE_COND_NP2_EMULATED)) return FALSE; return TRUE; @@ -666,7 +666,8 @@ static void wined3d_texture_evict_sysmem(struct wined3d_texture *texture) struct wined3d_texture_sub_resource *sub_resource; unsigned int i, sub_count; - if (texture->flags & (WINED3D_TEXTURE_CONVERTED | WINED3D_TEXTURE_PIN_SYSMEM) + if ((texture->flags & WINED3D_TEXTURE_CONVERTED) + || texture->resource.pin_sysmem || texture->download_count > WINED3D_TEXTURE_DYNAMIC_MAP_THRESHOLD) { TRACE("Not evicting system memory for texture %p.\n", texture); @@ -2462,8 +2463,8 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, if (dst_texture->sub_resources[dst_sub_resource_idx].map_count) { - WARN("Uploading a texture that is currently mapped, setting WINED3D_TEXTURE_PIN_SYSMEM.\n"); - dst_texture->flags |= WINED3D_TEXTURE_PIN_SYSMEM; + WARN("Uploading a texture that is currently mapped, pinning sysmem.\n"); + dst_texture->resource.pin_sysmem = 1; } if (src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_HEIGHT_SCALE) @@ -3825,7 +3826,10 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc texture->flags |= WINED3D_TEXTURE_POW2_MAT_IDENT | WINED3D_TEXTURE_NORMALIZED_COORDS | WINED3D_TEXTURE_DOWNLOADABLE; if (flags & WINED3D_TEXTURE_CREATE_GET_DC_LENIENT) - texture->flags |= WINED3D_TEXTURE_PIN_SYSMEM | WINED3D_TEXTURE_GET_DC_LENIENT; + { + texture->flags |= WINED3D_TEXTURE_GET_DC_LENIENT; + texture->resource.pin_sysmem = 1; + } if (flags & (WINED3D_TEXTURE_CREATE_GET_DC | WINED3D_TEXTURE_CREATE_GET_DC_LENIENT)) texture->flags |= WINED3D_TEXTURE_GET_DC; if (flags & WINED3D_TEXTURE_CREATE_DISCARD) @@ -5744,7 +5748,7 @@ static bool blitter_use_cpu_clear(struct wined3d_rendertarget_view *view) locations = texture->sub_resources[view->sub_resource_idx].locations; if (locations & (resource->map_binding | WINED3D_LOCATION_DISCARDED)) return !(resource->access & WINED3D_RESOURCE_ACCESS_GPU) - || (texture->flags & WINED3D_TEXTURE_PIN_SYSMEM); + || texture->resource.pin_sysmem; return !(resource->access & WINED3D_RESOURCE_ACCESS_GPU) && !(texture->flags & WINED3D_TEXTURE_CONVERTED); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c8c9bb7c8c6..e190fc4285e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4332,6 +4332,8 @@ struct wined3d_resource DWORD priority; void *heap_memory; + uint32_t pin_sysmem : 1; + struct wined3d_client_resource client; void *parent; @@ -4450,7 +4452,6 @@ struct wined3d_texture_ops #define WINED3D_TEXTURE_SRGB_ALLOCATED 0x00000040 #define WINED3D_TEXTURE_SRGB_VALID 0x00000080 #define WINED3D_TEXTURE_CONVERTED 0x00000100 -#define WINED3D_TEXTURE_PIN_SYSMEM 0x00000200 #define WINED3D_TEXTURE_NORMALIZED_COORDS 0x00000400 #define WINED3D_TEXTURE_GET_DC_LENIENT 0x00000800 #define WINED3D_TEXTURE_DC_IN_USE 0x00001000
1
0
0
0
Alexandre Julliard : kernel32/tests: Add tests for apiset query functions.
by Alexandre Julliard
18 Feb '22
18 Feb '22
Module: wine Branch: master Commit: ac5ebb6192ce81fd10ecd7f3c6fac60f74d62207 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ac5ebb6192ce81fd10ecd7f3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Feb 18 18:25:39 2022 +0100 kernel32/tests: Add tests for apiset query functions. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/module.c | 88 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 91e1aba31e0..dcf3b8b3765 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -37,6 +37,8 @@ static BOOL (WINAPI *pSetDefaultDllDirectories)(DWORD); static BOOL (WINAPI *pK32GetModuleInformation)(HANDLE process, HMODULE module, MODULEINFO *modinfo, DWORD cb); +static NTSTATUS (WINAPI *pApiSetQueryApiSetPresence)(const UNICODE_STRING*,BOOLEAN*); +static NTSTATUS (WINAPI *pApiSetQueryApiSetPresenceEx)(const UNICODE_STRING*,BOOLEAN*,BOOLEAN*); static NTSTATUS (WINAPI *pLdrGetDllDirectory)(UNICODE_STRING*); static NTSTATUS (WINAPI *pLdrSetDllDirectory)(UNICODE_STRING*); static NTSTATUS (WINAPI *pLdrGetDllHandle)( LPCWSTR load_path, ULONG flags, const UNICODE_STRING *name, HMODULE *base ); @@ -44,6 +46,8 @@ static NTSTATUS (WINAPI *pLdrGetDllHandleEx)( ULONG flags, LPCWSTR load_path, UL const UNICODE_STRING *name, HMODULE *base ); static NTSTATUS (WINAPI *pLdrGetDllFullName)( HMODULE module, UNICODE_STRING *name ); +static BOOL (WINAPI *pIsApiSetImplemented)(LPCSTR); + static BOOL is_unicode_enabled = TRUE; static BOOL cmpStrAW(const char* a, const WCHAR* b, DWORD lenA, DWORD lenB) @@ -930,11 +934,15 @@ static void init_pointers(void) MAKEFUNC(SetDefaultDllDirectories); MAKEFUNC(K32GetModuleInformation); mod = GetModuleHandleA( "ntdll.dll" ); + MAKEFUNC(ApiSetQueryApiSetPresence); + MAKEFUNC(ApiSetQueryApiSetPresenceEx); MAKEFUNC(LdrGetDllDirectory); MAKEFUNC(LdrSetDllDirectory); MAKEFUNC(LdrGetDllHandle); MAKEFUNC(LdrGetDllHandleEx); MAKEFUNC(LdrGetDllFullName); + mod = GetModuleHandleA( "kernelbase.dll" ); + MAKEFUNC(IsApiSetImplemented); #undef MAKEFUNC /* before Windows 7 this was not exported in kernel32 */ @@ -1426,6 +1434,85 @@ static void test_LdrGetDllFullName(void) wine_dbgstr_w(expected_path), wine_dbgstr_w(path_buffer) ); } +static void test_apisets(void) +{ + static const struct + { + const char *name; + BOOLEAN present; + NTSTATUS status; + BOOLEAN present_ex, in_schema, broken; + } + tests[] = + { + { "api-ms-win-core-console-l1-1-0", TRUE, STATUS_SUCCESS, TRUE, TRUE }, + { "api-ms-win-core-console-l1-1-0.dll", TRUE, STATUS_INVALID_PARAMETER }, + { "api-ms-win-core-console-l1-1-9", TRUE, STATUS_SUCCESS, FALSE, FALSE, TRUE }, + { "api-ms-win-core-console-l1-1-9.dll", TRUE, STATUS_INVALID_PARAMETER, FALSE, FALSE, TRUE }, + { "api-ms-win-core-console-l1-1", FALSE, STATUS_SUCCESS }, + { "api-ms-win-core-console-l1-1-0.fake", TRUE, STATUS_INVALID_PARAMETER, FALSE, FALSE, TRUE }, + { "api-ms-win-foo-bar-l1-1-0", FALSE, STATUS_SUCCESS }, + { "api-ms-win-foo-bar-l1-1-0.dll", FALSE, STATUS_INVALID_PARAMETER }, + { "ext-ms-win-gdi-draw-l1-1-1", TRUE, STATUS_SUCCESS, TRUE, TRUE }, + { "ext-ms-win-gdi-draw-l1-1-1.dll", TRUE, STATUS_INVALID_PARAMETER }, + { "api-ms-win-deprecated-apis-advapi-l1-1-0", FALSE, STATUS_SUCCESS, FALSE, TRUE }, + { "foo", FALSE, STATUS_INVALID_PARAMETER }, + { "foo.dll", FALSE, STATUS_INVALID_PARAMETER }, + { "", FALSE, STATUS_INVALID_PARAMETER }, + }; + unsigned int i; + NTSTATUS status; + BOOLEAN present, in_schema; + UNICODE_STRING name; + + if (!pApiSetQueryApiSetPresence) + { + win_skip( "ApiSetQueryApiSetPresence not implemented\n" ); + return; + } + todo_wine + if (!pApiSetQueryApiSetPresenceEx) win_skip( "ApiSetQueryApiSetPresenceEx not implemented\n" ); + todo_wine + if (!pIsApiSetImplemented) win_skip( "IsApiSetImplemented not implemented\n" ); + + for (i = 0; i < ARRAY_SIZE(tests); i++) + { + RtlCreateUnicodeStringFromAsciiz( &name, tests[i].name ); + name.Buffer[name.Length / sizeof(WCHAR)] = 0xcccc; /* test without null termination */ + winetest_push_context( "%u:%s", i, tests[i].name ); + present = 0xff; + status = pApiSetQueryApiSetPresence( &name, &present ); + todo_wine + ok( status == STATUS_SUCCESS, "wrong ret %x\n", status ); + todo_wine_if( !tests[i].present ) + ok( present == tests[i].present || broken(!present && tests[i].broken) /* win8 */, + "wrong present %u\n", present ); + if (pApiSetQueryApiSetPresenceEx) + { + present = in_schema = 0xff; + status = pApiSetQueryApiSetPresenceEx( &name, &in_schema, &present ); + ok( status == tests[i].status, "wrong ret %x\n", status ); + if (!status) + { + ok( in_schema == tests[i].in_schema, "wrong in_schema %u\n", in_schema ); + ok( present == tests[i].present_ex, "wrong present %u\n", present ); + } + else + { + ok( in_schema == 0xff, "wrong in_schema %u\n", in_schema ); + ok( present == 0xff, "wrong present %u\n", present ); + } + } + if (pIsApiSetImplemented) + { + BOOL ret = pIsApiSetImplemented( tests[i].name ); + ok( ret == (!tests[i].status && tests[i].present_ex), "wrong result %u\n", ret ); + } + winetest_pop_context(); + RtlFreeUnicodeString( &name ); + } +} + static void test_ddag_node(void) { static const struct @@ -1562,5 +1649,6 @@ START_TEST(module) test_SetDefaultDllDirectories(); test_LdrGetDllHandleEx(); test_LdrGetDllFullName(); + test_apisets(); test_ddag_node(); }
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
...
150
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Results per page:
10
25
50
100
200