winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2024
----- 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
1 participants
590 discussions
Start a n
N
ew thread
Conor McCarthy : vkd3d: Validate that a resource with initial state RENDER_TARGET is a render target.
by Alexandre Julliard
11 Apr '24
11 Apr '24
Module: vkd3d Branch: master Commit: 9d7f63dc26b72132f36fde545aa997e1294b658a URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/9d7f63dc26b72132f36fde545aa99…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Apr 9 17:26:32 2024 +1000 vkd3d: Validate that a resource with initial state RENDER_TARGET is a render target. --- libs/vkd3d/resource.c | 5 +++++ tests/d3d12.c | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 60dffe3d..17999914 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -2003,6 +2003,11 @@ static HRESULT d3d12_resource_init(struct d3d12_resource *resource, struct d3d12 WARN("Invalid initial resource state %#x.\n", initial_state); return E_INVALIDARG; } + if (initial_state == D3D12_RESOURCE_STATE_RENDER_TARGET && !(desc->Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET)) + { + WARN("Invalid initial resource state %#x for non-render-target.\n", initial_state); + return E_INVALIDARG; + } if (optimized_clear_value && d3d12_resource_is_buffer(resource)) { diff --git a/tests/d3d12.c b/tests/d3d12.c index 69d72fb7..aaea5e31 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1634,9 +1634,7 @@ static void test_create_committed_resource(void) hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc, D3D12_RESOURCE_STATE_RENDER_TARGET, NULL, &IID_ID3D12Resource, (void **)&resource); - todo ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ID3D12Resource_Release(resource); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); /* A texture cannot be created on a UPLOAD heap. */ heap_properties.Type = D3D12_HEAP_TYPE_UPLOAD;
1
0
0
0
Conor McCarthy : vkd3d: Validate presence of flag ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL for multisampled resources.
by Alexandre Julliard
11 Apr '24
11 Apr '24
Module: vkd3d Branch: master Commit: 78301d720205439acac6f19952b5c16bc0dfd583 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/78301d720205439acac6f19952b5c…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Apr 9 17:17:58 2024 +1000 vkd3d: Validate presence of flag ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL for multisampled resources. --- libs/vkd3d/resource.c | 7 +++++++ tests/d3d12.c | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index b83a45d0..60dffe3d 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1893,6 +1893,13 @@ HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC1 *desc, struct d3 WARN("Invalid sample count 0.\n"); return E_INVALIDARG; } + if (desc->SampleDesc.Count > 1 + && !(desc->Flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL))) + { + WARN("Sample count %u invalid without ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL.\n", + desc->SampleDesc.Count); + return E_INVALIDARG; + } if (!(format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0))) { diff --git a/tests/d3d12.c b/tests/d3d12.c index a0d738ac..69d72fb7 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1607,10 +1607,7 @@ static void test_create_committed_resource(void) resource_desc.Flags = 0; hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, NULL, &IID_ID3D12Resource, (void **)&resource); - todo ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ID3D12Resource_Release(resource); resource_desc.Format = DXGI_FORMAT_D32_FLOAT; resource_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
1
0
0
0
Conor McCarthy : tests/d3d12: Test resource flags for multisampled resources.
by Alexandre Julliard
11 Apr '24
11 Apr '24
Module: vkd3d Branch: master Commit: e46de1daa28f447aa13c5d0e98f94f226a6ddb52 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/e46de1daa28f447aa13c5d0e98f94…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Apr 9 13:22:06 2024 +1000 tests/d3d12: Test resource flags for multisampled resources. --- tests/d3d12.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/d3d12.c b/tests/d3d12.c index be92cba8..a0d738ac 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1601,7 +1601,25 @@ static void test_create_committed_resource(void) hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc, D3D12_RESOURCE_STATE_RENDER_TARGET, &clear_value, &IID_ID3D12Resource, (void **)&resource); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + /* The ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL flag is required for multisampled resources. */ + resource_desc.SampleDesc.Count = 4; + resource_desc.Flags = 0; + hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc, + D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, NULL, &IID_ID3D12Resource, (void **)&resource); + todo + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + ID3D12Resource_Release(resource); + + resource_desc.Format = DXGI_FORMAT_D32_FLOAT; + resource_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL; + hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc, + D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, NULL, &IID_ID3D12Resource, (void **)&resource); + ok(hr == S_OK, "Failed to create committed resource, hr %#x.\n", hr); + ID3D12Resource_Release(resource); resource_desc.SampleDesc.Count = 1; + resource_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET; resource_desc.Format = DXGI_FORMAT_UNKNOWN; hr = ID3D12Device_CreateCommittedResource(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc,
1
0
0
0
Stefan Dösinger : vkd3d: Implement reopening existing caches.
by Alexandre Julliard
11 Apr '24
11 Apr '24
Module: vkd3d Branch: master Commit: a7860ae752821958f3e9c51db7dfdd88bb92ac4c URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/a7860ae752821958f3e9c51db7dfd…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Wed Mar 27 13:43:49 2024 +0300 vkd3d: Implement reopening existing caches. --- include/private/vkd3d_common.h | 6 ++++ libs/vkd3d/device.c | 62 +++++++++++++++++++++++++++++++++++++----- tests/d3d12.c | 13 ++++++--- 3 files changed, 70 insertions(+), 11 deletions(-) diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h index 6a8694a7..10e2afd5 100644 --- a/include/private/vkd3d_common.h +++ b/include/private/vkd3d_common.h @@ -438,6 +438,12 @@ struct vkd3d_mutex #endif }; +#ifdef _WIN32 +#define VKD3D_MUTEX_INITIALIZER {{NULL, -1, 0, 0, 0, 0}} +#else +#define VKD3D_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER +#endif + static inline void vkd3d_mutex_init(struct vkd3d_mutex *lock) { #ifdef _WIN32 diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 266465e0..90de27c5 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -2529,12 +2529,17 @@ struct d3d12_cache_session ID3D12ShaderCacheSession ID3D12ShaderCacheSession_iface; unsigned int refcount; + struct list cache_list_entry; + struct d3d12_device *device; struct vkd3d_private_store private_store; D3D12_SHADER_CACHE_SESSION_DESC desc; struct vkd3d_shader_cache *cache; }; +static struct vkd3d_mutex cache_list_mutex = VKD3D_MUTEX_INITIALIZER; +static struct list cache_list = LIST_INIT(cache_list); + static inline struct d3d12_cache_session *impl_from_ID3D12ShaderCacheSession(ID3D12ShaderCacheSession *iface) { return CONTAINING_RECORD(iface, struct d3d12_cache_session, ID3D12ShaderCacheSession_iface); @@ -2583,6 +2588,10 @@ static void d3d12_cache_session_destroy(struct d3d12_cache_session *session) TRACE("Destroying cache session %p.\n", session); + vkd3d_mutex_lock(&cache_list_mutex); + list_remove(&session->cache_list_entry); + vkd3d_mutex_unlock(&cache_list_mutex); + vkd3d_shader_cache_decref(session->cache); vkd3d_private_store_destroy(&session->private_store); vkd3d_free(session); @@ -2709,12 +2718,14 @@ static const struct ID3D12ShaderCacheSessionVtbl d3d12_cache_session_vtbl = static HRESULT d3d12_cache_session_init(struct d3d12_cache_session *session, struct d3d12_device *device, const D3D12_SHADER_CACHE_SESSION_DESC *desc) { + struct d3d12_cache_session *i; enum vkd3d_result ret; HRESULT hr; session->ID3D12ShaderCacheSession_iface.lpVtbl = &d3d12_cache_session_vtbl; session->refcount = 1; session->desc = *desc; + session->cache = NULL; if (!session->desc.MaximumValueFileSizeBytes) session->desc.MaximumValueFileSizeBytes = 128 * 1024 * 1024; @@ -2726,20 +2737,56 @@ static HRESULT d3d12_cache_session_init(struct d3d12_cache_session *session, if (FAILED(hr = vkd3d_private_store_init(&session->private_store))) return hr; - if (session->desc.Mode == D3D12_SHADER_CACHE_MODE_DISK) - FIXME("Disk caches are not yet implemented.\n"); + vkd3d_mutex_lock(&cache_list_mutex); - ret = vkd3d_shader_open_cache(&session->cache); - if (ret) + /* We expect the number of open caches to be small. */ + LIST_FOR_EACH_ENTRY(i, &cache_list, struct d3d12_cache_session, cache_list_entry) { - WARN("Failed to open shader cache.\n"); - vkd3d_private_store_destroy(&session->private_store); - return hresult_from_vkd3d_result(ret); + if (!memcmp(&i->desc.Identifier, &desc->Identifier, sizeof(desc->Identifier))) + { + TRACE("Found an existing cache %p from session %p.\n", i->cache, i); + if (desc->Version == i->desc.Version) + { + session->desc = i->desc; + vkd3d_shader_cache_incref(session->cache = i->cache); + break; + } + else + { + WARN("version mismatch: Existing %"PRIu64" new %"PRIu64".\n", + i->desc.Version, desc->Version); + hr = DXGI_ERROR_ALREADY_EXISTS; + goto error; + } + } } + if (!session->cache) + { + if (session->desc.Mode == D3D12_SHADER_CACHE_MODE_DISK) + FIXME("Disk caches are not yet implemented.\n"); + + ret = vkd3d_shader_open_cache(&session->cache); + if (ret) + { + WARN("Failed to open shader cache.\n"); + hr = hresult_from_vkd3d_result(ret); + goto error; + } + } + + /* Add it to the list even if we reused an existing cache. The other session might be destroyed, + * but the cache stays alive and can be opened a third time. */ + list_add_tail(&cache_list, &session->cache_list_entry); d3d12_device_add_ref(session->device = device); + vkd3d_mutex_unlock(&cache_list_mutex); return S_OK; + +error: + vkd3d_private_store_destroy(&session->private_store); + vkd3d_mutex_unlock(&cache_list_mutex); + return hr; } /* ID3D12Device */ @@ -4888,6 +4935,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateShaderCacheSession(ID3D12Dev WARN("No output pointer, returning S_FALSE.\n"); return S_FALSE; } + *session = NULL; if (!(object = vkd3d_malloc(sizeof(*object)))) return E_OUTOFMEMORY; diff --git a/tests/d3d12.c b/tests/d3d12.c index 1605d6e5..be92cba8 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -38477,10 +38477,8 @@ static void test_shader_cache(void) session2 = (void *)0xdeadbeef; hr = ID3D12Device9_CreateShaderCacheSession(device, &desc, &IID_ID3D12ShaderCacheSession, (void **)&session2); - todo ok(hr == DXGI_ERROR_ALREADY_EXISTS, "Got unexpected hr %#x.\n", hr); - todo ok(!session2, "Got unexpected pointer %p.\n", session2); - if (session2) - ID3D12ShaderCacheSession_Release(session2); + ok(hr == DXGI_ERROR_ALREADY_EXISTS, "Got unexpected hr %#x.\n", hr); + ok(!session2, "Got unexpected pointer %p.\n", session2); hr = ID3D12Device9_CreateShaderCacheSession(device, &desc, &IID_IUnknown, NULL); ok(hr == S_FALSE, "NULL outptr: Got hr %#x.\n", hr); @@ -38489,9 +38487,16 @@ static void test_shader_cache(void) refcount = get_refcount(device); ok(refcount == base_refcount, "Got unexpected refcount %u.\n", refcount); + /* Create two sessions with the same cache GUID. */ hr = ID3D12Device9_CreateShaderCacheSession(device, &desc, &IID_ID3D12ShaderCacheSession, (void **)&session); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3D12Device9_CreateShaderCacheSession(device, &desc, + &IID_ID3D12ShaderCacheSession, (void **)&session2); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(session2 != session, "Expected different interface pointers, got %p for both.\n", + session); + ID3D12ShaderCacheSession_Release(session2); ID3D12ShaderCacheSession_Release(session); ID3D12Device9_Release(device);
1
0
0
0
Stefan Dösinger : vkd3d: Implement opening and closing shader caches.
by Alexandre Julliard
11 Apr '24
11 Apr '24
Module: vkd3d Branch: master Commit: f24005507c153d3b4c9d325e8c71650100fb3562 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/f24005507c153d3b4c9d325e8c716…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Fri Apr 5 14:08:55 2024 +0300 vkd3d: Implement opening and closing shader caches. --- Makefile.am | 1 + libs/vkd3d/cache.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++ libs/vkd3d/device.c | 14 +++++++++++ libs/vkd3d/vkd3d_private.h | 6 +++++ 4 files changed, 80 insertions(+) diff --git a/Makefile.am b/Makefile.am index 995f70b2..876b4f52 100644 --- a/Makefile.am +++ b/Makefile.am @@ -356,6 +356,7 @@ libvkd3d_la_SOURCES = \ include/vkd3d_d3d12.idl \ include/vkd3d_d3dcommon.idl \ include/vkd3d_unknown.idl \ + libs/vkd3d/cache.c \ libs/vkd3d/command.c \ libs/vkd3d/device.c \ libs/vkd3d/resource.c \ diff --git a/libs/vkd3d/cache.c b/libs/vkd3d/cache.c new file mode 100644 index 00000000..56ba6990 --- /dev/null +++ b/libs/vkd3d/cache.c @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Stefan Dösinger for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "vkd3d_private.h" + +struct vkd3d_shader_cache +{ + unsigned int refcount; +}; + +int vkd3d_shader_open_cache(struct vkd3d_shader_cache **cache) +{ + struct vkd3d_shader_cache *object; + + TRACE("%p.\n", cache); + + object = vkd3d_malloc(sizeof(*object)); + if (!object) + return VKD3D_ERROR_OUT_OF_MEMORY; + + object->refcount = 1; + *cache = object; + + return VKD3D_OK; +} + +unsigned int vkd3d_shader_cache_incref(struct vkd3d_shader_cache *cache) +{ + unsigned int refcount = vkd3d_atomic_increment_u32(&cache->refcount); + TRACE("cache %p refcount %u.\n", cache, refcount); + return refcount; +} + +unsigned int vkd3d_shader_cache_decref(struct vkd3d_shader_cache *cache) +{ + unsigned int refcount = vkd3d_atomic_decrement_u32(&cache->refcount); + TRACE("cache %p refcount %u.\n", cache, refcount); + + if (refcount) + return refcount; + + vkd3d_free(cache); + return 0; +} diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 65db8b70..266465e0 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -2532,6 +2532,7 @@ struct d3d12_cache_session struct d3d12_device *device; struct vkd3d_private_store private_store; D3D12_SHADER_CACHE_SESSION_DESC desc; + struct vkd3d_shader_cache *cache; }; static inline struct d3d12_cache_session *impl_from_ID3D12ShaderCacheSession(ID3D12ShaderCacheSession *iface) @@ -2582,6 +2583,7 @@ static void d3d12_cache_session_destroy(struct d3d12_cache_session *session) TRACE("Destroying cache session %p.\n", session); + vkd3d_shader_cache_decref(session->cache); vkd3d_private_store_destroy(&session->private_store); vkd3d_free(session); @@ -2707,6 +2709,7 @@ static const struct ID3D12ShaderCacheSessionVtbl d3d12_cache_session_vtbl = static HRESULT d3d12_cache_session_init(struct d3d12_cache_session *session, struct d3d12_device *device, const D3D12_SHADER_CACHE_SESSION_DESC *desc) { + enum vkd3d_result ret; HRESULT hr; session->ID3D12ShaderCacheSession_iface.lpVtbl = &d3d12_cache_session_vtbl; @@ -2723,6 +2726,17 @@ static HRESULT d3d12_cache_session_init(struct d3d12_cache_session *session, if (FAILED(hr = vkd3d_private_store_init(&session->private_store))) return hr; + if (session->desc.Mode == D3D12_SHADER_CACHE_MODE_DISK) + FIXME("Disk caches are not yet implemented.\n"); + + ret = vkd3d_shader_open_cache(&session->cache); + if (ret) + { + WARN("Failed to open shader cache.\n"); + vkd3d_private_store_destroy(&session->private_store); + return hresult_from_vkd3d_result(ret); + } + d3d12_device_add_ref(session->device = device); return S_OK; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index d5e12ee3..91ffa6e9 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -1927,4 +1927,10 @@ static inline void vkd3d_prepend_struct(void *header, void *structure) vkd3d_header->next = vkd3d_structure; } +struct vkd3d_shader_cache; + +int vkd3d_shader_open_cache(struct vkd3d_shader_cache **cache); +unsigned int vkd3d_shader_cache_incref(struct vkd3d_shader_cache *cache); +unsigned int vkd3d_shader_cache_decref(struct vkd3d_shader_cache *cache); + #endif /* __VKD3D_PRIVATE_H */
1
0
0
0
Stefan Dösinger : tests: Add CreateShaderCacheSession pointer clearing tests.
by Alexandre Julliard
11 Apr '24
11 Apr '24
Module: vkd3d Branch: master Commit: 26387e1d4b4e9449b11e8657b421d6e9d6845020 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/26387e1d4b4e9449b11e8657b421d…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Fri Apr 5 15:30:36 2024 +0300 tests: Add CreateShaderCacheSession pointer clearing tests. Native's behavior is inconsistent. It sets the pointer to NULL when it fails to open an existing cache due to a version mismatch, but leaves the pointer untouched when the description fails validation. --- tests/d3d12.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/d3d12.c b/tests/d3d12.c index 7108068b..1605d6e5 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -38338,6 +38338,7 @@ static void test_shader_cache(void) base_refcount = get_refcount(device); /* The description needs to be non-NULL and have at least the identifier set. */ + unk = (IUnknown *)0xdeadbeef; hr = ID3D12Device9_CreateShaderCacheSession(device, NULL, &IID_IUnknown, (void **)&unk); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); hr = ID3D12Device9_CreateShaderCacheSession(device, NULL, &IID_IUnknown, NULL); @@ -38348,6 +38349,7 @@ static void test_shader_cache(void) ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); hr = ID3D12Device9_CreateShaderCacheSession(device, &desc, NULL, (void **)&unk); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(unk == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", unk); desc.Identifier = test_guid; desc.Mode = D3D12_SHADER_CACHE_MODE_MEMORY; @@ -38396,10 +38398,13 @@ static void test_shader_cache(void) (void **)&session); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ID3D12ShaderCacheSession_Release(session); + + session = (ID3D12ShaderCacheSession *)0xdeadbeef; desc.MaximumValueFileSizeBytes = 1024 * 1024 * 1024 + 1; hr = ID3D12Device9_CreateShaderCacheSession(device, &desc, &IID_ID3D12ShaderCacheSession, (void **)&session); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(session == (ID3D12ShaderCacheSession *)0xdeadbeef, "Got unexpected pointer %p.\n", unk); memset(&desc, 0, sizeof(desc)); desc.Identifier = test_guid; @@ -38420,6 +38425,7 @@ static void test_shader_cache(void) desc.Identifier = test_guid; desc.Mode = D3D12_SHADER_CACHE_MODE_MEMORY; desc.Flags = 0x1245670; + session = (ID3D12ShaderCacheSession *)0xdeadbeef; hr = ID3D12Device9_CreateShaderCacheSession(device, &desc, &IID_ID3D12ShaderCacheSession, (void **)&session); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); @@ -38428,6 +38434,7 @@ static void test_shader_cache(void) hr = ID3D12Device9_CreateShaderCacheSession(device, &desc, &IID_ID3D12ShaderCacheSession, (void **)&session); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(session == (ID3D12ShaderCacheSession *)0xdeadbeef, "Got unexpected pointer %p.\n", unk); memset(&desc, 0, sizeof(desc)); desc.Identifier = test_guid;
1
0
0
0
Giovanni Mascellani : ci: Build Mesa for release.
by Alexandre Julliard
11 Apr '24
11 Apr '24
Module: vkd3d Branch: master Commit: 42f07352a071924d4ddf82a5f05741878b55ee8e URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/42f07352a071924d4ddf82a5f0574…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Mon Apr 8 15:49:00 2024 +0200 ci: Build Mesa for release. Otherwise it trips on a few failed assertions in d3d12.c. --- gitlab/image.docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab/image.docker b/gitlab/image.docker index fb3ed626..9807e306 100644 --- a/gitlab/image.docker +++ b/gitlab/image.docker @@ -75,7 +75,7 @@ RUN export DEBIAN_FRONTEND=noninteractive; \ cd mesa && \ mkdir build && \ cd build && \ - meson setup -Dprefix=/opt/mesa24 -Dplatforms= -Dvideo-codecs= -Dvulkan-drivers=swrast -Dgallium-drivers=swrast -Dopengl=true -Degl=enabled -Dglvnd=true -Dshared-glapi=enabled -Dglx=disabled -Dgles1=disabled -Dgles2=disabled .. && \ + meson setup --buildtype release -Dprefix=/opt/mesa24 -Dplatforms= -Dvideo-codecs= -Dvulkan-drivers=swrast -Dgallium-drivers=swrast -Dopengl=true -Degl=enabled -Dglvnd=true -Dshared-glapi=enabled -Dglx=disabled -Dgles1=disabled -Dgles2=disabled .. && \ meson install && \ cd ../.. && \ rm -fr mesa && \
1
0
0
0
Giovanni Mascellani : tests: Pop the test context when leaving its scope.
by Alexandre Julliard
11 Apr '24
11 Apr '24
Module: vkd3d Branch: master Commit: 0be29f78c0b0d321665b12d2458c06a168c763f9 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/0be29f78c0b0d321665b12d2458c0…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Fri Apr 5 23:16:38 2024 +0200 tests: Pop the test context when leaving its scope. --- tests/d3d12.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/d3d12.c b/tests/d3d12.c index 0a55cddb..7108068b 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -32472,7 +32472,10 @@ static void test_resource_allocation_info(void) ok(infos1[i].SizeInBytes == sizes[i], "Got unexpected size %"PRIu64".\n", infos1[i].SizeInBytes); if (!i) + { + vkd3d_test_pop_context(); continue; + } ok(infos1[i].Offset - infos1[i - 1].Offset >= infos1[i - 1].SizeInBytes, "Got unexpected prev size %"PRIu64", prev offset %"PRIu64", offset %"PRIu64".\n",
1
0
0
0
Giovanni Mascellani : tests: Add llvmpipe among the Mesa drivers.
by Alexandre Julliard
11 Apr '24
11 Apr '24
Module: vkd3d Branch: master Commit: 59a5d8f852966713979060b901eaf362874c4994 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/59a5d8f852966713979060b901eaf…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Fri Apr 5 23:08:35 2024 +0200 tests: Add llvmpipe among the Mesa drivers. --- tests/d3d12_crosstest.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index 6b532bda..99641425 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -654,6 +654,7 @@ static inline bool is_mesa_device(ID3D12Device *device) get_driver_properties(device, NULL, &properties); return properties.driverID == VK_DRIVER_ID_MESA_RADV_KHR + || properties.driverID == VK_DRIVER_ID_MESA_LLVMPIPE || properties.driverID == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR; }
1
0
0
0
Giovanni Mascellani : tests: Print the device name.
by Alexandre Julliard
11 Apr '24
11 Apr '24
Module: vkd3d Branch: master Commit: ecd38f3d1bbd0330fb9b6bd866361dcde14f9c4d URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/ecd38f3d1bbd0330fb9b6bd866361…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Fri Apr 5 23:08:35 2024 +0200 tests: Print the device name. --- tests/d3d12_crosstest.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index a27b62e7..6b532bda 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -606,6 +606,7 @@ static bool get_driver_properties(ID3D12Device *device, VkPhysicalDeviceProperti static void init_adapter_info(void) { VkPhysicalDeviceDriverPropertiesKHR driver_properties; + VkPhysicalDeviceProperties device_properties; struct vkd3d_instance *instance; ID3D12Device *device; void *libvulkan; @@ -627,8 +628,9 @@ LOAD_VK_PFN(vkGetInstanceProcAddr) if (SUCCEEDED(hr = create_vkd3d_device(instance, D3D_FEATURE_LEVEL_11_0, &IID_ID3D12Device, (void **)&device))) { - if (get_driver_properties(device, NULL, &driver_properties)) - trace("Driver name: %s, driver info: %s.\n", driver_properties.driverName, driver_properties.driverInfo); + if (get_driver_properties(device, &device_properties, &driver_properties)) + trace("Driver name: %s, driver info: %s, device name: %s.\n", driver_properties.driverName, + driver_properties.driverInfo, device_properties.deviceName); ID3D12Device_Release(device); }
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
59
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
Results per page:
10
25
50
100
200