Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 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
June 2019
- 73 participants
- 565 discussions
[PATCH v2 1/4] winehid.inf: Add new INF file and copy it to the INF directory.
by Zebediah Figura 07 Jun '19
by Zebediah Figura 07 Jun '19
07 Jun '19
From: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
loader/Makefile.in | 3 ++-
loader/wine.inf.in | 18 ++++++++++++++----
loader/winehid.inf.in | 25 +++++++++++++++++++++++++
3 files changed, 41 insertions(+), 5 deletions(-)
create mode 100644 loader/winehid.inf.in
diff --git a/loader/Makefile.in b/loader/Makefile.in
index a776c8542b..3ada656408 100644
--- a/loader/Makefile.in
+++ b/loader/Makefile.in
@@ -9,7 +9,8 @@ SOURCES = \
wine.inf.in \
wine.man.in \
wine.pl.UTF-8.man.in \
- wine_info.plist.in
+ wine_info.plist.in \
+ winehid.inf.in
PROGRAMS = $(WINELOADER_PROGRAMS)
INSTALL_LIB = $(WINELOADER_PROGRAMS)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 4d28a93c35..e80af7a6a3 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -30,7 +30,7 @@ signature="$CHICAGO$"
RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin32,FakeDlls
UpdateInis=SystemIni
-CopyFiles=(a)l_intl.nls
+CopyFiles=l_intl_section, inf_section
AddReg=\
Classes,\
ContentIndex,\
@@ -55,7 +55,7 @@ AddReg=\
RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin32,FakeDlls
UpdateInis=SystemIni
-CopyFiles=(a)l_intl.nls
+CopyFiles=l_intl_section, inf_section
AddReg=\
Classes,\
ContentIndex,\
@@ -82,7 +82,7 @@ RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin64,FakeDlls
WinePreInstall=Wow64
UpdateInis=SystemIni
-CopyFiles=(a)l_intl.nls
+CopyFiles=l_intl_section, inf_section
AddReg=\
Classes,\
ContentIndex,\
@@ -108,7 +108,7 @@ AddReg=\
[Wow64Install]
RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin32,FakeDllsWow64
-CopyFiles=(a)l_intl.nls
+CopyFiles=l_intl_section
AddReg=\
CurrentVersion,\
CurrentVersionWow64,\
@@ -3701,3 +3701,13 @@ HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-Shanghai-EnableGame",0x1
HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-Solitaire-EnableGame",0x10001,0x00000001
HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-SpiderSolitaire-EnableGame",0x10001,0x00000001
HKLM,Software\Wine\LicenseInformation,"Shell-PremiumInBoxGames-Chess-EnableGame",0x10001,0x00000001
+
+[DestinationDirs]
+l_intl_section = 11
+inf_section = 17
+
+[l_intl_section]
+l_intl.nls
+
+[inf_section]
+winehid.inf
diff --git a/loader/winehid.inf.in b/loader/winehid.inf.in
new file mode 100644
index 0000000000..bd42bceeaa
--- /dev/null
+++ b/loader/winehid.inf.in
@@ -0,0 +1,25 @@
+[Version]
+Signature="$CHICAGO$"
+ClassGuid={745a17a0-74d3-11d0-b6fe-00a0c90f57da}
+Class=HIDClass
+
+[Manufacturer]
+Wine=mfg_section
+
+[mfg_section]
+Wine hidraw device=device_section,HIDRAW
+Wine IOHID device=device_section,IOHID
+Wine libevent device=device_section,LNXEV
+Wine SDL HID device=device_section,SDLJOY
+
+[device_section.Services]
+AddService = winehid,0x2,svc_section
+
+[svc_section]
+Description="Wine HID Minidriver"
+DisplayName="Wine HID"
+ServiceBinary="%12%\winehid.sys"
+LoadOrderGroup="WinePlugPlay"
+ServiceType=1
+StartType=3
+ErrorControl=1
--
2.20.1
1
3
[PATCH 1/4] winehid.inf: Add new INF file and copy it to the INF directory.
by Zebediah Figura 07 Jun '19
by Zebediah Figura 07 Jun '19
07 Jun '19
From: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
loader/Makefile.in | 3 ++-
loader/wine.inf.in | 18 ++++++++++++++----
loader/winehid.inf.in | 25 +++++++++++++++++++++++++
3 files changed, 41 insertions(+), 5 deletions(-)
create mode 100644 loader/winehid.inf.in
diff --git a/loader/Makefile.in b/loader/Makefile.in
index a776c8542b..3ada656408 100644
--- a/loader/Makefile.in
+++ b/loader/Makefile.in
@@ -9,7 +9,8 @@ SOURCES = \
wine.inf.in \
wine.man.in \
wine.pl.UTF-8.man.in \
- wine_info.plist.in
+ wine_info.plist.in \
+ winehid.inf.in
PROGRAMS = $(WINELOADER_PROGRAMS)
INSTALL_LIB = $(WINELOADER_PROGRAMS)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 4d28a93c35..e80af7a6a3 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -30,7 +30,7 @@ signature="$CHICAGO$"
RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin32,FakeDlls
UpdateInis=SystemIni
-CopyFiles=(a)l_intl.nls
+CopyFiles=l_intl_section, inf_section
AddReg=\
Classes,\
ContentIndex,\
@@ -55,7 +55,7 @@ AddReg=\
RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin32,FakeDlls
UpdateInis=SystemIni
-CopyFiles=(a)l_intl.nls
+CopyFiles=l_intl_section, inf_section
AddReg=\
Classes,\
ContentIndex,\
@@ -82,7 +82,7 @@ RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin64,FakeDlls
WinePreInstall=Wow64
UpdateInis=SystemIni
-CopyFiles=(a)l_intl.nls
+CopyFiles=l_intl_section, inf_section
AddReg=\
Classes,\
ContentIndex,\
@@ -108,7 +108,7 @@ AddReg=\
[Wow64Install]
RegisterDlls=RegisterDllsSection
WineFakeDlls=FakeDllsWin32,FakeDllsWow64
-CopyFiles=(a)l_intl.nls
+CopyFiles=l_intl_section
AddReg=\
CurrentVersion,\
CurrentVersionWow64,\
@@ -3701,3 +3701,13 @@ HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-Shanghai-EnableGame",0x1
HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-Solitaire-EnableGame",0x10001,0x00000001
HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-SpiderSolitaire-EnableGame",0x10001,0x00000001
HKLM,Software\Wine\LicenseInformation,"Shell-PremiumInBoxGames-Chess-EnableGame",0x10001,0x00000001
+
+[DestinationDirs]
+l_intl_section = 11
+inf_section = 17
+
+[l_intl_section]
+l_intl.nls
+
+[inf_section]
+winehid.inf
diff --git a/loader/winehid.inf.in b/loader/winehid.inf.in
new file mode 100644
index 0000000000..bd42bceeaa
--- /dev/null
+++ b/loader/winehid.inf.in
@@ -0,0 +1,25 @@
+[Version]
+Signature="$CHICAGO$"
+ClassGuid={745a17a0-74d3-11d0-b6fe-00a0c90f57da}
+Class=HIDClass
+
+[Manufacturer]
+Wine=mfg_section
+
+[mfg_section]
+Wine hidraw device=device_section,HIDRAW
+Wine IOHID device=device_section,IOHID
+Wine libevent device=device_section,LNXEV
+Wine SDL HID device=device_section,SDLJOY
+
+[device_section.Services]
+AddService = winehid,0x2,svc_section
+
+[svc_section]
+Description="Wine HID Minidriver"
+DisplayName="Wine HID"
+ServiceBinary="%12%\winehid.sys"
+LoadOrderGroup="WinePlugPlay"
+ServiceType=1
+StartType=3
+ErrorControl=1
--
2.20.1
1
3
[PATCH vkd3d 3/5] vkd3d: Introduce helper functions to call ID3D12Device methods.
by Józef Kucia 07 Jun '19
by Józef Kucia 07 Jun '19
07 Jun '19
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
Keeps the current version of ID3D12Device interface in single place.
---
libs/vkd3d/command.c | 60 ++++++++++++++++----------------------
libs/vkd3d/resource.c | 52 ++++++++++++++-------------------
libs/vkd3d/state.c | 25 +++++++---------
libs/vkd3d/vkd3d_private.h | 21 +++++++++++++
4 files changed, 79 insertions(+), 79 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index a4659f701ebb..f66bbe90da40 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -885,7 +885,7 @@ static ULONG STDMETHODCALLTYPE d3d12_fence_Release(ID3D12Fence *iface)
ERR("Failed to destroy mutex, error %d.\n", rc);
vkd3d_free(fence);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -932,14 +932,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_fence_SetName(ID3D12Fence *iface, const W
return name ? S_OK : E_INVALIDARG;
}
-static HRESULT STDMETHODCALLTYPE d3d12_fence_GetDevice(ID3D12Fence *iface,
- REFIID riid, void **device)
+static HRESULT STDMETHODCALLTYPE d3d12_fence_GetDevice(ID3D12Fence *iface, REFIID iid, void **device)
{
struct d3d12_fence *fence = impl_from_ID3D12Fence(iface);
- TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
+ TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&fence->device->ID3D12Device_iface, riid, device);
+ return d3d12_device_query_interface(fence->device, iid, device);
}
static UINT64 STDMETHODCALLTYPE d3d12_fence_GetCompletedValue(ID3D12Fence *iface)
@@ -1081,8 +1080,7 @@ static HRESULT d3d12_fence_init(struct d3d12_fence *fence, struct d3d12_device *
return hr;
}
- fence->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(fence->device = device);
return S_OK;
}
@@ -1517,7 +1515,7 @@ static ULONG STDMETHODCALLTYPE d3d12_command_allocator_Release(ID3D12CommandAllo
vkd3d_free(allocator);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -1563,14 +1561,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_allocator_SetName(ID3D12CommandAl
VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT, name);
}
-static HRESULT STDMETHODCALLTYPE d3d12_command_allocator_GetDevice(ID3D12CommandAllocator *iface,
- REFIID riid, void **device)
+static HRESULT STDMETHODCALLTYPE d3d12_command_allocator_GetDevice(ID3D12CommandAllocator *iface, REFIID iid, void **device)
{
struct d3d12_command_allocator *allocator = impl_from_ID3D12CommandAllocator(iface);
- TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
+ TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&allocator->device->ID3D12Device_iface, riid, device);
+ return d3d12_device_query_interface(allocator->device, iid, device);
}
static HRESULT STDMETHODCALLTYPE d3d12_command_allocator_Reset(ID3D12CommandAllocator *iface)
@@ -1727,8 +1724,7 @@ static HRESULT d3d12_command_allocator_init(struct d3d12_command_allocator *allo
allocator->current_command_list = NULL;
- allocator->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(allocator->device = device);
return S_OK;
}
@@ -2132,7 +2128,7 @@ static ULONG STDMETHODCALLTYPE d3d12_command_list_Release(ID3D12GraphicsCommandL
vkd3d_free(list);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -2177,14 +2173,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetName(ID3D12GraphicsComman
return name ? S_OK : E_INVALIDARG;
}
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_GetDevice(ID3D12GraphicsCommandList1 *iface,
- REFIID riid, void **device)
+static HRESULT STDMETHODCALLTYPE d3d12_command_list_GetDevice(ID3D12GraphicsCommandList1 *iface, REFIID iid, void **device)
{
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
+ TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&list->device->ID3D12Device_iface, riid, device);
+ return d3d12_device_query_interface(list->device, iid, device);
}
static D3D12_COMMAND_LIST_TYPE STDMETHODCALLTYPE d3d12_command_list_GetType(ID3D12GraphicsCommandList1 *iface)
@@ -5118,8 +5113,7 @@ static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d
if (FAILED(hr = vkd3d_private_store_init(&list->private_store)))
return hr;
- list->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(list->device = device);
list->allocator = allocator;
@@ -5130,7 +5124,7 @@ static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d
else
{
vkd3d_private_store_destroy(&list->private_store);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return hr;
@@ -5228,7 +5222,7 @@ static ULONG STDMETHODCALLTYPE d3d12_command_queue_Release(ID3D12CommandQueue *i
vkd3d_free(command_queue);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -5284,14 +5278,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_queue_SetName(ID3D12CommandQueue
return hr;
}
-static HRESULT STDMETHODCALLTYPE d3d12_command_queue_GetDevice(ID3D12CommandQueue *iface,
- REFIID riid, void **device)
+static HRESULT STDMETHODCALLTYPE d3d12_command_queue_GetDevice(ID3D12CommandQueue *iface, REFIID iid, void **device)
{
struct d3d12_command_queue *command_queue = impl_from_ID3D12CommandQueue(iface);
- TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
+ TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&command_queue->device->ID3D12Device_iface, riid, device);
+ return d3d12_device_query_interface(command_queue->device, iid, device);
}
static void STDMETHODCALLTYPE d3d12_command_queue_UpdateTileMappings(ID3D12CommandQueue *iface,
@@ -5713,8 +5706,7 @@ static HRESULT d3d12_command_queue_init(struct d3d12_command_queue *queue,
if (FAILED(hr = vkd3d_private_store_init(&queue->private_store)))
return hr;
- queue->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(queue->device = device);
return S_OK;
}
@@ -5816,7 +5808,7 @@ static ULONG STDMETHODCALLTYPE d3d12_command_signature_Release(ID3D12CommandSign
vkd3d_free((void *)signature->desc.pArgumentDescs);
vkd3d_free(signature);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -5861,14 +5853,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_signature_SetName(ID3D12CommandSi
return name ? S_OK : E_INVALIDARG;
}
-static HRESULT STDMETHODCALLTYPE d3d12_command_signature_GetDevice(ID3D12CommandSignature *iface,
- REFIID iid, void **device)
+static HRESULT STDMETHODCALLTYPE d3d12_command_signature_GetDevice(ID3D12CommandSignature *iface, REFIID iid, void **device)
{
struct d3d12_command_signature *signature = impl_from_ID3D12CommandSignature(iface);
TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&signature->device->ID3D12Device_iface, iid, device);
+ return d3d12_device_query_interface(signature->device, iid, device);
}
static const struct ID3D12CommandSignatureVtbl d3d12_command_signature_vtbl =
@@ -5942,8 +5933,7 @@ HRESULT d3d12_command_signature_create(struct d3d12_device *device, const D3D12_
return hr;
}
- object->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(object->device = device);
TRACE("Created command signature %p.\n", object);
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index 1e5f5f3c3c38..15dac12abeb6 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -174,7 +174,7 @@ static ULONG STDMETHODCALLTYPE d3d12_heap_Release(ID3D12Heap *iface)
vkd3d_free(heap);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -220,14 +220,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_heap_SetName(ID3D12Heap *iface, const WCH
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, name);
}
-static HRESULT STDMETHODCALLTYPE d3d12_heap_GetDevice(ID3D12Heap *iface,
- REFIID riid, void **device)
+static HRESULT STDMETHODCALLTYPE d3d12_heap_GetDevice(ID3D12Heap *iface, REFIID iid, void **device)
{
struct d3d12_heap *heap = impl_from_ID3D12Heap(iface);
- TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
+ TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&heap->device->ID3D12Device_iface, riid, device);
+ return d3d12_device_query_interface(heap->device, iid, device);
}
static D3D12_HEAP_DESC * STDMETHODCALLTYPE d3d12_heap_GetDesc(ID3D12Heap *iface,
@@ -416,8 +415,7 @@ static HRESULT d3d12_heap_init(struct d3d12_heap *heap,
return hr;
}
- heap->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(heap->device = device);
return S_OK;
}
@@ -929,7 +927,7 @@ static ULONG STDMETHODCALLTYPE d3d12_resource_AddRef(ID3D12Resource *iface)
{
struct d3d12_device *device = resource->device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(device);
d3d12_resource_incref(resource);
}
@@ -949,7 +947,7 @@ static ULONG STDMETHODCALLTYPE d3d12_resource_Release(ID3D12Resource *iface)
d3d12_resource_decref(resource);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -1007,14 +1005,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_resource_SetName(ID3D12Resource *iface, c
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, name);
}
-static HRESULT STDMETHODCALLTYPE d3d12_resource_GetDevice(ID3D12Resource *iface,
- REFIID riid, void **device)
+static HRESULT STDMETHODCALLTYPE d3d12_resource_GetDevice(ID3D12Resource *iface, REFIID iid, void **device)
{
struct d3d12_resource *resource = impl_from_ID3D12Resource(iface);
- TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
+ TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&resource->device->ID3D12Device_iface, riid, device);
+ return d3d12_device_query_interface(resource->device, iid, device);
}
static HRESULT STDMETHODCALLTYPE d3d12_resource_Map(ID3D12Resource *iface, UINT sub_resource,
@@ -1419,8 +1416,7 @@ static HRESULT d3d12_resource_init(struct d3d12_resource *resource, struct d3d12
return hr;
}
- resource->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(resource->device = device);
return S_OK;
}
@@ -1627,8 +1623,7 @@ HRESULT vkd3d_create_image_resource(ID3D12Device *device,
return hr;
}
- object->device = d3d12_device;
- ID3D12Device_AddRef(&d3d12_device->ID3D12Device_iface);
+ d3d12_device_add_ref(object->device = d3d12_device);
TRACE("Created resource %p.\n", object);
@@ -2953,7 +2948,7 @@ static ULONG STDMETHODCALLTYPE d3d12_descriptor_heap_Release(ID3D12DescriptorHea
vkd3d_free(heap);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -2998,14 +2993,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_descriptor_heap_SetName(ID3D12DescriptorH
return name ? S_OK : E_INVALIDARG;
}
-static HRESULT STDMETHODCALLTYPE d3d12_descriptor_heap_GetDevice(ID3D12DescriptorHeap *iface,
- REFIID riid, void **device)
+static HRESULT STDMETHODCALLTYPE d3d12_descriptor_heap_GetDevice(ID3D12DescriptorHeap *iface, REFIID iid, void **device)
{
struct d3d12_descriptor_heap *heap = impl_from_ID3D12DescriptorHeap(iface);
- TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
+ TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&heap->device->ID3D12Device_iface, riid, device);
+ return d3d12_device_query_interface(heap->device, iid, device);
}
static D3D12_DESCRIPTOR_HEAP_DESC * STDMETHODCALLTYPE d3d12_descriptor_heap_GetDesc(ID3D12DescriptorHeap *iface,
@@ -3075,8 +3069,7 @@ static HRESULT d3d12_descriptor_heap_init(struct d3d12_descriptor_heap *descript
if (FAILED(hr = vkd3d_private_store_init(&descriptor_heap->private_store)))
return hr;
- descriptor_heap->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(descriptor_heap->device = device);
return S_OK;
}
@@ -3088,7 +3081,7 @@ HRESULT d3d12_descriptor_heap_create(struct d3d12_device *device,
struct d3d12_descriptor_heap *object;
HRESULT hr;
- if (!(descriptor_size = ID3D12Device_GetDescriptorHandleIncrementSize(&device->ID3D12Device_iface, desc->Type)))
+ if (!(descriptor_size = d3d12_device_get_descriptor_handle_increment_size(device, desc->Type)))
{
WARN("No descriptor size for descriptor type %#x.\n", desc->Type);
return E_INVALIDARG;
@@ -3183,7 +3176,7 @@ static ULONG STDMETHODCALLTYPE d3d12_query_heap_Release(ID3D12QueryHeap *iface)
vkd3d_free(heap);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -3229,14 +3222,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_query_heap_SetName(ID3D12QueryHeap *iface
VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, name);
}
-static HRESULT STDMETHODCALLTYPE d3d12_query_heap_GetDevice(ID3D12QueryHeap *iface,
- REFIID iid, void **device)
+static HRESULT STDMETHODCALLTYPE d3d12_query_heap_GetDevice(ID3D12QueryHeap *iface, REFIID iid, void **device)
{
struct d3d12_query_heap *heap = impl_from_ID3D12QueryHeap(iface);
TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&heap->device->ID3D12Device_iface, iid, device);
+ return d3d12_device_query_interface(heap->device, iid, device);
}
static const struct ID3D12QueryHeapVtbl d3d12_query_heap_vtbl =
@@ -3345,7 +3337,7 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H
return hresult_from_vk_result(vr);
}
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(device);
TRACE("Created query heap %p.\n", object);
diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c
index eb2626d1aef1..514fdc3a74f2 100644
--- a/libs/vkd3d/state.c
+++ b/libs/vkd3d/state.c
@@ -118,7 +118,7 @@ static ULONG STDMETHODCALLTYPE d3d12_root_signature_Release(ID3D12RootSignature
vkd3d_private_store_destroy(&root_signature->private_store);
d3d12_root_signature_cleanup(root_signature, device);
vkd3d_free(root_signature);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -164,13 +164,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_root_signature_SetName(ID3D12RootSignatur
}
static HRESULT STDMETHODCALLTYPE d3d12_root_signature_GetDevice(ID3D12RootSignature *iface,
- REFIID riid, void **device)
+ REFIID iid, void **device)
{
struct d3d12_root_signature *root_signature = impl_from_ID3D12RootSignature(iface);
- TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
+ TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&root_signature->device->ID3D12Device_iface, riid, device);
+ return d3d12_device_query_interface(root_signature->device, iid, device);
}
static const struct ID3D12RootSignatureVtbl d3d12_root_signature_vtbl =
@@ -982,8 +982,7 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
if (FAILED(hr = vkd3d_private_store_init(&root_signature->private_store)))
goto fail;
- root_signature->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(root_signature->device = device);
return S_OK;
@@ -1331,7 +1330,7 @@ static ULONG STDMETHODCALLTYPE d3d12_pipeline_state_Release(ID3D12PipelineState
vkd3d_free(state);
- ID3D12Device_Release(&device->ID3D12Device_iface);
+ d3d12_device_release(device);
}
return refcount;
@@ -1383,13 +1382,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_pipeline_state_SetName(ID3D12PipelineStat
}
static HRESULT STDMETHODCALLTYPE d3d12_pipeline_state_GetDevice(ID3D12PipelineState *iface,
- REFIID riid, void **device)
+ REFIID iid, void **device)
{
struct d3d12_pipeline_state *state = impl_from_ID3D12PipelineState(iface);
- TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device);
+ TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
- return ID3D12Device_QueryInterface(&state->device->ID3D12Device_iface, riid, device);
+ return d3d12_device_query_interface(state->device, iid, device);
}
static HRESULT STDMETHODCALLTYPE d3d12_pipeline_state_GetCachedBlob(ID3D12PipelineState *iface,
@@ -1646,8 +1645,7 @@ static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *st
}
state->vk_bind_point = VK_PIPELINE_BIND_POINT_COMPUTE;
- state->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(state->device = device);
return S_OK;
}
@@ -2550,8 +2548,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
goto fail;
state->vk_bind_point = VK_PIPELINE_BIND_POINT_GRAPHICS;
- state->device = device;
- ID3D12Device_AddRef(&device->ID3D12Device_iface);
+ d3d12_device_add_ref(state->device = device);
return S_OK;
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 2d31cacc101e..e01e00503081 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -1036,6 +1036,27 @@ void d3d12_device_mark_as_removed(struct d3d12_device *device, HRESULT reason,
const char *message, ...) VKD3D_PRINTF_FUNC(3, 4) DECLSPEC_HIDDEN;
struct d3d12_device *unsafe_impl_from_ID3D12Device(ID3D12Device *iface) DECLSPEC_HIDDEN;
+static inline HRESULT d3d12_device_query_interface(struct d3d12_device *device, REFIID iid, void **object)
+{
+ return ID3D12Device_QueryInterface(&device->ID3D12Device_iface, iid, object);
+}
+
+static inline ULONG d3d12_device_add_ref(struct d3d12_device *device)
+{
+ return ID3D12Device_AddRef(&device->ID3D12Device_iface);
+}
+
+static inline ULONG d3d12_device_release(struct d3d12_device *device)
+{
+ return ID3D12Device_Release(&device->ID3D12Device_iface);
+}
+
+static inline unsigned int d3d12_device_get_descriptor_handle_increment_size(struct d3d12_device *device,
+ D3D12_DESCRIPTOR_HEAP_TYPE descriptor_type)
+{
+ return ID3D12Device_GetDescriptorHandleIncrementSize(&device->ID3D12Device_iface, descriptor_type);
+}
+
/* utils */
struct vkd3d_format
{
--
2.21.0
2
1
[PATCH vkd3d 5/5] tests: Add tests for loading stencil values from textures.
by Józef Kucia 07 Jun '19
by Józef Kucia 07 Jun '19
07 Jun '19
From: Józef Kucia <jkucia(a)codeweavers.com>
With plane slice and component mapping.
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
tests/d3d12.c | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 182 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 04ee7be99fff..3c1eec59857e 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -18858,6 +18858,187 @@ static void test_depth_read_only_view(void)
destroy_test_context(&context);
}
+static void test_stencil_load(void)
+{
+ D3D12_ROOT_SIGNATURE_DESC root_signature_desc;
+ D3D12_DESCRIPTOR_RANGE descriptor_ranges[2];
+ D3D12_SHADER_RESOURCE_VIEW_DESC srv_desc;
+ D3D12_ROOT_PARAMETER root_parameters[1];
+ ID3D12GraphicsCommandList *command_list;
+ ID3D12PipelineState *pipeline_state;
+ struct depth_stencil_resource ds;
+ struct test_context_desc desc;
+ struct test_context context;
+ ID3D12DescriptorHeap *heap;
+ ID3D12CommandQueue *queue;
+ struct uvec4 uvec4 = {0};
+ ID3D12Resource *texture;
+ ID3D12Device *device;
+ unsigned int i;
+ HRESULT hr;
+
+ static const DWORD cs_code[] =
+ {
+#if 0
+ Texture2D<uint4> t;
+ RWTexture2D<uint4> u;
+
+ [numthreads(1, 1, 1)]
+ void main(uint2 id : SV_GroupID)
+ {
+ u[id] = t[id];
+ }
+#endif
+ 0x43425844, 0x0b41fa64, 0xd64df766, 0xc4c98283, 0xb810dc2b, 0x00000001, 0x00000110, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x000000bc, 0x00050050, 0x0000002f, 0x0100086a,
+ 0x04001858, 0x00107000, 0x00000000, 0x00004444, 0x0400189c, 0x0011e000, 0x00000000, 0x00004444,
+ 0x0200005f, 0x00021032, 0x02000068, 0x00000001, 0x0400009b, 0x00000001, 0x00000001, 0x00000001,
+ 0x04000036, 0x00100032, 0x00000000, 0x00021046, 0x08000036, 0x001000c2, 0x00000000, 0x00004002,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8900002d, 0x800000c2, 0x00111103, 0x001000f2,
+ 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x060000a4, 0x0011e0f2, 0x00000000,
+ 0x00021546, 0x00100e46, 0x00000000, 0x0100003e,
+ };
+ static const DWORD ps_code[] =
+ {
+#if 0
+ Texture2D<uint4> t;
+
+ uint4 main(float4 position : SV_Position) : SV_Target
+ {
+ return t[int2(position.x, position.y)];
+ }
+#endif
+ 0x43425844, 0x9ad18dbc, 0x98de0e54, 0xe3c15d5b, 0xac8b580a, 0x00000001, 0x00000138, 0x00000003,
+ 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020,
+ 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x7469736f, 0x006e6f69,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000009c, 0x00000050,
+ 0x00000027, 0x0100086a, 0x04001858, 0x00107000, 0x00000000, 0x00004444, 0x04002064, 0x00101032,
+ 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0500001b,
+ 0x00100032, 0x00000000, 0x00101046, 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8900002d, 0x800000c2, 0x00111103, 0x001020f2,
+ 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x0100003e,
+ };
+ static const D3D12_SHADER_BYTECODE ps = {ps_code, sizeof(ps_code)};
+ static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ static unsigned int tests[] = {0, 50, 75, 100, 150, 200, 255};
+
+ memset(&desc, 0, sizeof(desc));
+ desc.rt_format = DXGI_FORMAT_R32G32B32A32_UINT;
+ desc.no_root_signature = true;
+ if (!init_test_context(&context, &desc))
+ return;
+ device = context.device;
+ command_list = context.list;
+ queue = context.queue;
+
+ descriptor_ranges[0].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV;
+ descriptor_ranges[0].NumDescriptors = 1;
+ descriptor_ranges[0].BaseShaderRegister = 0;
+ descriptor_ranges[0].RegisterSpace = 0;
+ descriptor_ranges[0].OffsetInDescriptorsFromTableStart = 0;
+ descriptor_ranges[1].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_UAV;
+ descriptor_ranges[1].NumDescriptors = 1;
+ descriptor_ranges[1].BaseShaderRegister = 0;
+ descriptor_ranges[1].RegisterSpace = 0;
+ descriptor_ranges[1].OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;
+ root_parameters[0].ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE;
+ root_parameters[0].DescriptorTable.NumDescriptorRanges = 2;
+ root_parameters[0].DescriptorTable.pDescriptorRanges = descriptor_ranges;
+ root_parameters[0].ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL;
+ root_signature_desc.NumParameters = 1;
+ root_signature_desc.pParameters = root_parameters;
+ root_signature_desc.NumStaticSamplers = 0;
+ root_signature_desc.pStaticSamplers = NULL;
+ root_signature_desc.Flags = D3D12_ROOT_SIGNATURE_FLAG_NONE;
+ hr = create_root_signature(device, &root_signature_desc, &context.root_signature);
+ ok(hr == S_OK, "Failed to create root signature, hr %#x.\n", hr);
+
+ pipeline_state = create_compute_pipeline_state(device, context.root_signature,
+ shader_bytecode(cs_code, sizeof(cs_code)));
+ context.pipeline_state = create_pipeline_state(context.device,
+ context.root_signature, context.render_target_desc.Format, NULL, &ps, NULL);
+
+ heap = create_gpu_descriptor_heap(device, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 2);
+
+ init_depth_stencil(&ds, device, context.render_target_desc.Width,
+ context.render_target_desc.Height, 1, 1, DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, NULL);
+ memset(&srv_desc, 0, sizeof(srv_desc));
+ srv_desc.Format = DXGI_FORMAT_X24_TYPELESS_G8_UINT;
+ srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
+ srv_desc.Shader4ComponentMapping = D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(
+ D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1,
+ D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1,
+ D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1,
+ D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1);
+ srv_desc.Texture2D.MipLevels = 1;
+ srv_desc.Texture2D.PlaneSlice = 1;
+ ID3D12Device_CreateShaderResourceView(device, ds.texture, &srv_desc,
+ get_cpu_descriptor_handle(&context, heap, 0));
+
+ texture = create_default_texture(device, 32, 32, DXGI_FORMAT_R32G32B32A32_UINT,
+ D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
+ ID3D12Device_CreateUnorderedAccessView(device, texture, NULL, NULL,
+ get_cpu_descriptor_handle(&context, heap, 1));
+
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
+ {
+ vkd3d_test_set_context("Test %u", i);
+
+ uvec4.x = uvec4.y = uvec4.z = uvec4.w = tests[i];
+
+ ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, ds.dsv_handle,
+ D3D12_CLEAR_FLAG_STENCIL, 0.0f, tests[i], 0, NULL);
+ transition_sub_resource_state(command_list, ds.texture, 0,
+ D3D12_RESOURCE_STATE_DEPTH_WRITE, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
+
+ ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
+ ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, FALSE, NULL);
+ ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport);
+ ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect);
+
+ ID3D12GraphicsCommandList_SetDescriptorHeaps(command_list, 1, &heap);
+
+ ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state);
+ ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
+ ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(command_list, 0,
+ ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(heap));
+ ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
+ ID3D12GraphicsCommandList_DrawInstanced(command_list, 3, 1, 0, 0);
+
+ ID3D12GraphicsCommandList_SetPipelineState(command_list, pipeline_state);
+ ID3D12GraphicsCommandList_SetComputeRootSignature(command_list, context.root_signature);
+ ID3D12GraphicsCommandList_SetComputeRootDescriptorTable(command_list, 0,
+ ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(heap));
+ ID3D12GraphicsCommandList_Dispatch(command_list, 32, 32, 1);
+
+ transition_sub_resource_state(command_list, context.render_target, 0,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ check_sub_resource_uvec4(context.render_target, 0, queue, command_list, &uvec4);
+
+ reset_command_list(command_list, context.allocator);
+ transition_sub_resource_state(command_list, texture, 0,
+ D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ check_sub_resource_uvec4(texture, 0, queue, command_list, &uvec4);
+
+ reset_command_list(command_list, context.allocator);
+ transition_sub_resource_state(command_list, context.render_target, 0,
+ D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
+ transition_sub_resource_state(command_list, texture, 0,
+ D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
+ transition_sub_resource_state(command_list, ds.texture, 0,
+ D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, D3D12_RESOURCE_STATE_DEPTH_WRITE);
+ }
+ vkd3d_test_set_context(NULL);
+
+ destroy_depth_stencil(&ds);
+ ID3D12Resource_Release(texture);
+ ID3D12DescriptorHeap_Release(heap);
+ ID3D12PipelineState_Release(pipeline_state);
+ destroy_test_context(&context);
+}
+
static void test_typed_buffer_uav(void)
{
D3D12_CPU_DESCRIPTOR_HANDLE cpu_descriptor_handle;
@@ -29843,6 +30024,7 @@ START_TEST(d3d12)
run_test(test_depth_stencil_sampling);
run_test(test_depth_load);
run_test(test_depth_read_only_view);
+ run_test(test_stencil_load);
run_test(test_typed_buffer_uav);
run_test(test_typed_uav_store);
run_test(test_compute_shader_registers);
--
2.21.0
2
1
07 Jun '19
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
libs/vkd3d/utils.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c
index ea468b37d37d..4483a8d456f7 100644
--- a/libs/vkd3d/utils.c
+++ b/libs/vkd3d/utils.c
@@ -409,10 +409,10 @@ static const char *debug_d3d12_shader_component(D3D12_SHADER_COMPONENT_MAPPING c
const char *debug_d3d12_shader_component_mapping(unsigned int mapping)
{
return vkd3d_dbg_sprintf("{%s, %s, %s, %s}",
- debug_d3d12_shader_component(D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(mapping, 0)),
- debug_d3d12_shader_component(D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(mapping, 1)),
- debug_d3d12_shader_component(D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(mapping, 2)),
- debug_d3d12_shader_component(D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(mapping, 3)));
+ debug_d3d12_shader_component(D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(0, mapping)),
+ debug_d3d12_shader_component(D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(1, mapping)),
+ debug_d3d12_shader_component(D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(2, mapping)),
+ debug_d3d12_shader_component(D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(3, mapping)));
}
const char *debug_vk_extent_3d(VkExtent3D extent)
--
2.21.0
2
1
From: Józef Kucia <jkucia(a)codeweavers.com>
Simplifies passing around Vulkan physical device properties and features.
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
libs/vkd3d/device.c | 507 +++++++++++++++++++++-----------------------
1 file changed, 247 insertions(+), 260 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c
index a9610ffbfb4a..870b88af8282 100644
--- a/libs/vkd3d/device.c
+++ b/libs/vkd3d/device.c
@@ -92,20 +92,6 @@ struct vk_struct
struct vk_struct *pNext;
};
-#define vk_find_struct(c, t) vk_find_struct_(c, VK_STRUCTURE_TYPE_##t)
-static void *vk_find_struct_(struct vk_struct *chain, VkStructureType sType)
-{
- while (chain)
- {
- if (chain->sType == sType)
- return chain;
-
- chain = chain->pNext;
- }
-
- return NULL;
-}
-
static uint32_t vkd3d_get_vk_version(void)
{
const char *ptr = PACKAGE_VERSION;
@@ -676,6 +662,82 @@ VkInstance vkd3d_instance_get_vk_instance(struct vkd3d_instance *instance)
return instance->vk_instance;
}
+struct vkd3d_physical_device_info
+{
+ /* properties */
+ VkPhysicalDeviceDescriptorIndexingPropertiesEXT descriptor_indexing_properties;
+ VkPhysicalDeviceMaintenance3Properties maintenance3_properties;
+ VkPhysicalDeviceTransformFeedbackPropertiesEXT xfb_properties;
+ VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_divisor_properties;
+
+ VkPhysicalDeviceProperties2KHR properties2;
+
+ /* features */
+ VkPhysicalDeviceDepthClipEnableFeaturesEXT depth_clip_features;
+ VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptor_indexing_features;
+ VkPhysicalDeviceTransformFeedbackFeaturesEXT xfb_features;
+ VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT vertex_divisor_features;
+
+ VkPhysicalDeviceFeatures2 features2;
+};
+
+static void vkd3d_physical_device_info_init(struct vkd3d_physical_device_info *info, struct d3d12_device *device)
+{
+ const struct vkd3d_vk_instance_procs *vk_procs = &device->vkd3d_instance->vk_procs;
+ VkPhysicalDeviceDescriptorIndexingPropertiesEXT *descriptor_indexing_properties;
+ VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *vertex_divisor_properties;
+ VkPhysicalDeviceDescriptorIndexingFeaturesEXT *descriptor_indexing_features;
+ VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *vertex_divisor_features;
+ VkPhysicalDeviceDepthClipEnableFeaturesEXT *depth_clip_features;
+ VkPhysicalDeviceMaintenance3Properties *maintenance3_properties;
+ VkPhysicalDeviceTransformFeedbackPropertiesEXT *xfb_properties;
+ VkPhysicalDevice physical_device = device->vk_physical_device;
+ VkPhysicalDeviceTransformFeedbackFeaturesEXT *xfb_features;
+ struct vkd3d_vulkan_info *vulkan_info = &device->vk_info;
+
+ memset(info, 0, sizeof(*info));
+ depth_clip_features = &info->depth_clip_features;
+ descriptor_indexing_features = &info->descriptor_indexing_features;
+ descriptor_indexing_properties = &info->descriptor_indexing_properties;
+ maintenance3_properties = &info->maintenance3_properties;
+ vertex_divisor_features = &info->vertex_divisor_features;
+ vertex_divisor_properties = &info->vertex_divisor_properties;
+ xfb_features = &info->xfb_features;
+ xfb_properties = &info->xfb_properties;
+
+ depth_clip_features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT;
+ descriptor_indexing_features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
+ descriptor_indexing_features->pNext = depth_clip_features;
+ xfb_features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT;
+ xfb_features->pNext = descriptor_indexing_features;
+ vertex_divisor_features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT;
+ vertex_divisor_features->pNext = xfb_features;
+
+ info->features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
+ info->features2.pNext = vertex_divisor_features;
+
+ if (vulkan_info->KHR_get_physical_device_properties2)
+ VK_CALL(vkGetPhysicalDeviceFeatures2KHR(physical_device, &info->features2));
+ else
+ VK_CALL(vkGetPhysicalDeviceFeatures(physical_device, &info->features2.features));
+
+ maintenance3_properties->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES;
+ descriptor_indexing_properties->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT;
+ descriptor_indexing_properties->pNext = maintenance3_properties;
+ xfb_properties->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT;
+ xfb_properties->pNext = descriptor_indexing_properties;
+ vertex_divisor_properties->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT;
+ vertex_divisor_properties->pNext = xfb_properties;
+
+ info->properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+ info->properties2.pNext = vertex_divisor_properties;
+
+ if (vulkan_info->KHR_get_physical_device_properties2)
+ VK_CALL(vkGetPhysicalDeviceProperties2KHR(physical_device, &info->properties2));
+ else
+ VK_CALL(vkGetPhysicalDeviceProperties(physical_device, &info->properties2.properties));
+}
+
static void vkd3d_trace_physical_device_properties(const VkPhysicalDeviceProperties *properties)
{
const uint32_t driver_version = properties->driverVersion;
@@ -691,7 +753,7 @@ static void vkd3d_trace_physical_device_properties(const VkPhysicalDevicePropert
}
static void vkd3d_trace_physical_device(VkPhysicalDevice device,
- const VkPhysicalDeviceProperties *vk_device_properties,
+ const struct vkd3d_physical_device_info *info,
const struct vkd3d_vk_instance_procs *vk_procs)
{
VkPhysicalDeviceMemoryProperties memory_properties;
@@ -699,7 +761,7 @@ static void vkd3d_trace_physical_device(VkPhysicalDevice device,
unsigned int i, j;
uint32_t count;
- vkd3d_trace_physical_device_properties(vk_device_properties);
+ vkd3d_trace_physical_device_properties(&info->properties2.properties);
VK_CALL(vkGetPhysicalDeviceQueueFamilyProperties(device, &count, NULL));
TRACE("Queue families [%u]:\n", count);
@@ -733,11 +795,11 @@ static void vkd3d_trace_physical_device(VkPhysicalDevice device,
}
}
-static void vkd3d_trace_physical_device_limits(const VkPhysicalDeviceProperties2KHR *properties2)
+static void vkd3d_trace_physical_device_limits(const struct vkd3d_physical_device_info *info)
{
const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *divisor_properties;
+ const VkPhysicalDeviceLimits *limits = &info->properties2.properties.limits;
const VkPhysicalDeviceDescriptorIndexingPropertiesEXT *descriptor_indexing;
- const VkPhysicalDeviceLimits *limits = &properties2->properties.limits;
const VkPhysicalDeviceMaintenance3Properties *maintenance3;
const VkPhysicalDeviceTransformFeedbackPropertiesEXT *xfb;
@@ -858,102 +920,89 @@ static void vkd3d_trace_physical_device_limits(const VkPhysicalDeviceProperties2
TRACE(" optimalBufferCopyRowPitchAlignment: %#"PRIx64".\n", limits->optimalBufferCopyRowPitchAlignment);
TRACE(" nonCoherentAtomSize: %#"PRIx64".\n", limits->nonCoherentAtomSize);
- descriptor_indexing = vk_find_struct(properties2->pNext, PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT);
- if (descriptor_indexing)
- {
- TRACE(" VkPhysicalDeviceDescriptorIndexingPropertiesEXT:\n");
-
- TRACE(" maxUpdateAfterBindDescriptorsInAllPools: %u.\n",
- descriptor_indexing->maxUpdateAfterBindDescriptorsInAllPools);
-
- TRACE(" shaderUniformBufferArrayNonUniformIndexingNative: %#x.\n",
- descriptor_indexing->shaderUniformBufferArrayNonUniformIndexingNative);
- TRACE(" shaderSampledImageArrayNonUniformIndexingNative: %#x.\n",
- descriptor_indexing->shaderSampledImageArrayNonUniformIndexingNative);
- TRACE(" shaderStorageBufferArrayNonUniformIndexingNative: %#x.\n",
- descriptor_indexing->shaderStorageBufferArrayNonUniformIndexingNative);
- TRACE(" shaderStorageImageArrayNonUniformIndexingNative: %#x.\n",
- descriptor_indexing->shaderStorageImageArrayNonUniformIndexingNative);
- TRACE(" shaderInputAttachmentArrayNonUniformIndexingNative: %#x.\n",
- descriptor_indexing->shaderInputAttachmentArrayNonUniformIndexingNative);
-
- TRACE(" robustBufferAccessUpdateAfterBind: %#x.\n",
- descriptor_indexing->robustBufferAccessUpdateAfterBind);
- TRACE(" quadDivergentImplicitLod: %#x.\n",
- descriptor_indexing->quadDivergentImplicitLod);
-
- TRACE(" maxPerStageDescriptorUpdateAfterBindSamplers: %u.\n",
- descriptor_indexing->maxPerStageDescriptorUpdateAfterBindSamplers);
- TRACE(" maxPerStageDescriptorUpdateAfterBindUniformBuffers: %u.\n",
- descriptor_indexing->maxPerStageDescriptorUpdateAfterBindUniformBuffers);
- TRACE(" maxPerStageDescriptorUpdateAfterBindStorageBuffers: %u.\n",
- descriptor_indexing->maxPerStageDescriptorUpdateAfterBindStorageBuffers);
- TRACE(" maxPerStageDescriptorUpdateAfterBindSampledImages: %u.\n",
- descriptor_indexing->maxPerStageDescriptorUpdateAfterBindSampledImages);
- TRACE(" maxPerStageDescriptorUpdateAfterBindStorageImages: %u.\n",
- descriptor_indexing->maxPerStageDescriptorUpdateAfterBindStorageImages);
- TRACE(" maxPerStageDescriptorUpdateAfterBindInputAttachments: %u.\n",
- descriptor_indexing->maxPerStageDescriptorUpdateAfterBindInputAttachments);
- TRACE(" maxPerStageUpdateAfterBindResources: %u.\n",
- descriptor_indexing->maxPerStageUpdateAfterBindResources);
-
- TRACE(" maxDescriptorSetUpdateAfterBindSamplers: %u.\n",
- descriptor_indexing->maxDescriptorSetUpdateAfterBindSamplers);
- TRACE(" maxDescriptorSetUpdateAfterBindUniformBuffers: %u.\n",
- descriptor_indexing->maxDescriptorSetUpdateAfterBindUniformBuffers);
- TRACE(" maxDescriptorSetUpdateAfterBindUniformBuffersDynamic: %u.\n",
- descriptor_indexing->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic);
- TRACE(" maxDescriptorSetUpdateAfterBindStorageBuffers: %u.\n",
- descriptor_indexing->maxDescriptorSetUpdateAfterBindStorageBuffers);
- TRACE(" maxDescriptorSetUpdateAfterBindStorageBuffersDynamic: %u.\n",
- descriptor_indexing->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic);
- TRACE(" maxDescriptorSetUpdateAfterBindSampledImages: %u.\n",
- descriptor_indexing->maxDescriptorSetUpdateAfterBindSampledImages);
- TRACE(" maxDescriptorSetUpdateAfterBindStorageImages: %u.\n",
- descriptor_indexing->maxDescriptorSetUpdateAfterBindStorageImages);
- TRACE(" maxDescriptorSetUpdateAfterBindInputAttachments: %u.\n",
- descriptor_indexing->maxDescriptorSetUpdateAfterBindInputAttachments);
- }
-
- maintenance3 = vk_find_struct(properties2->pNext, PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES);
- if (maintenance3)
- {
- TRACE(" VkPhysicalDeviceMaintenance3Properties:\n");
- TRACE(" maxPerSetDescriptors: %u.\n", maintenance3->maxPerSetDescriptors);
- TRACE(" maxMemoryAllocationSize: %#"PRIx64".\n", maintenance3->maxMemoryAllocationSize);
- }
-
- xfb = vk_find_struct(properties2->pNext, PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT);
- if (xfb)
- {
- TRACE(" VkPhysicalDeviceTransformFeedbackPropertiesEXT:\n");
- TRACE(" maxTransformFeedbackStreams: %u.\n", xfb->maxTransformFeedbackStreams);
- TRACE(" maxTransformFeedbackBuffers: %u.\n", xfb->maxTransformFeedbackBuffers);
- TRACE(" maxTransformFeedbackBufferSize: %#"PRIx64".\n", xfb->maxTransformFeedbackBufferSize);
- TRACE(" maxTransformFeedbackStreamDataSize: %u.\n", xfb->maxTransformFeedbackStreamDataSize);
- TRACE(" maxTransformFeedbackBufferDataSize: %u.\n", xfb->maxTransformFeedbackBufferDataSize);
- TRACE(" maxTransformFeedbackBufferDataStride: %u.\n", xfb->maxTransformFeedbackBufferDataStride);
- TRACE(" transformFeedbackQueries: %#x.\n", xfb->transformFeedbackQueries);
- TRACE(" transformFeedbackStreamsLinesTriangles: %#x.\n", xfb->transformFeedbackStreamsLinesTriangles);
- TRACE(" transformFeedbackRasterizationStreamSelect: %#x.\n", xfb->transformFeedbackRasterizationStreamSelect);
- TRACE(" transformFeedbackDraw: %x.\n", xfb->transformFeedbackDraw);
- }
-
- divisor_properties
- = vk_find_struct(properties2->pNext, PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT);
- if (divisor_properties)
- {
- TRACE(" VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT:\n");
- TRACE(" maxVertexAttribDivisor: %u.\n", divisor_properties->maxVertexAttribDivisor);
- }
-}
-
-static void vkd3d_trace_physical_device_features(const VkPhysicalDeviceFeatures2KHR *features2)
+ descriptor_indexing = &info->descriptor_indexing_properties;
+ TRACE(" VkPhysicalDeviceDescriptorIndexingPropertiesEXT:\n");
+
+ TRACE(" maxUpdateAfterBindDescriptorsInAllPools: %u.\n",
+ descriptor_indexing->maxUpdateAfterBindDescriptorsInAllPools);
+
+ TRACE(" shaderUniformBufferArrayNonUniformIndexingNative: %#x.\n",
+ descriptor_indexing->shaderUniformBufferArrayNonUniformIndexingNative);
+ TRACE(" shaderSampledImageArrayNonUniformIndexingNative: %#x.\n",
+ descriptor_indexing->shaderSampledImageArrayNonUniformIndexingNative);
+ TRACE(" shaderStorageBufferArrayNonUniformIndexingNative: %#x.\n",
+ descriptor_indexing->shaderStorageBufferArrayNonUniformIndexingNative);
+ TRACE(" shaderStorageImageArrayNonUniformIndexingNative: %#x.\n",
+ descriptor_indexing->shaderStorageImageArrayNonUniformIndexingNative);
+ TRACE(" shaderInputAttachmentArrayNonUniformIndexingNative: %#x.\n",
+ descriptor_indexing->shaderInputAttachmentArrayNonUniformIndexingNative);
+
+ TRACE(" robustBufferAccessUpdateAfterBind: %#x.\n",
+ descriptor_indexing->robustBufferAccessUpdateAfterBind);
+ TRACE(" quadDivergentImplicitLod: %#x.\n",
+ descriptor_indexing->quadDivergentImplicitLod);
+
+ TRACE(" maxPerStageDescriptorUpdateAfterBindSamplers: %u.\n",
+ descriptor_indexing->maxPerStageDescriptorUpdateAfterBindSamplers);
+ TRACE(" maxPerStageDescriptorUpdateAfterBindUniformBuffers: %u.\n",
+ descriptor_indexing->maxPerStageDescriptorUpdateAfterBindUniformBuffers);
+ TRACE(" maxPerStageDescriptorUpdateAfterBindStorageBuffers: %u.\n",
+ descriptor_indexing->maxPerStageDescriptorUpdateAfterBindStorageBuffers);
+ TRACE(" maxPerStageDescriptorUpdateAfterBindSampledImages: %u.\n",
+ descriptor_indexing->maxPerStageDescriptorUpdateAfterBindSampledImages);
+ TRACE(" maxPerStageDescriptorUpdateAfterBindStorageImages: %u.\n",
+ descriptor_indexing->maxPerStageDescriptorUpdateAfterBindStorageImages);
+ TRACE(" maxPerStageDescriptorUpdateAfterBindInputAttachments: %u.\n",
+ descriptor_indexing->maxPerStageDescriptorUpdateAfterBindInputAttachments);
+ TRACE(" maxPerStageUpdateAfterBindResources: %u.\n",
+ descriptor_indexing->maxPerStageUpdateAfterBindResources);
+
+ TRACE(" maxDescriptorSetUpdateAfterBindSamplers: %u.\n",
+ descriptor_indexing->maxDescriptorSetUpdateAfterBindSamplers);
+ TRACE(" maxDescriptorSetUpdateAfterBindUniformBuffers: %u.\n",
+ descriptor_indexing->maxDescriptorSetUpdateAfterBindUniformBuffers);
+ TRACE(" maxDescriptorSetUpdateAfterBindUniformBuffersDynamic: %u.\n",
+ descriptor_indexing->maxDescriptorSetUpdateAfterBindUniformBuffersDynamic);
+ TRACE(" maxDescriptorSetUpdateAfterBindStorageBuffers: %u.\n",
+ descriptor_indexing->maxDescriptorSetUpdateAfterBindStorageBuffers);
+ TRACE(" maxDescriptorSetUpdateAfterBindStorageBuffersDynamic: %u.\n",
+ descriptor_indexing->maxDescriptorSetUpdateAfterBindStorageBuffersDynamic);
+ TRACE(" maxDescriptorSetUpdateAfterBindSampledImages: %u.\n",
+ descriptor_indexing->maxDescriptorSetUpdateAfterBindSampledImages);
+ TRACE(" maxDescriptorSetUpdateAfterBindStorageImages: %u.\n",
+ descriptor_indexing->maxDescriptorSetUpdateAfterBindStorageImages);
+ TRACE(" maxDescriptorSetUpdateAfterBindInputAttachments: %u.\n",
+ descriptor_indexing->maxDescriptorSetUpdateAfterBindInputAttachments);
+
+ maintenance3 = &info->maintenance3_properties;
+ TRACE(" VkPhysicalDeviceMaintenance3Properties:\n");
+ TRACE(" maxPerSetDescriptors: %u.\n", maintenance3->maxPerSetDescriptors);
+ TRACE(" maxMemoryAllocationSize: %#"PRIx64".\n", maintenance3->maxMemoryAllocationSize);
+
+ xfb = &info->xfb_properties;
+ TRACE(" VkPhysicalDeviceTransformFeedbackPropertiesEXT:\n");
+ TRACE(" maxTransformFeedbackStreams: %u.\n", xfb->maxTransformFeedbackStreams);
+ TRACE(" maxTransformFeedbackBuffers: %u.\n", xfb->maxTransformFeedbackBuffers);
+ TRACE(" maxTransformFeedbackBufferSize: %#"PRIx64".\n", xfb->maxTransformFeedbackBufferSize);
+ TRACE(" maxTransformFeedbackStreamDataSize: %u.\n", xfb->maxTransformFeedbackStreamDataSize);
+ TRACE(" maxTransformFeedbackBufferDataSize: %u.\n", xfb->maxTransformFeedbackBufferDataSize);
+ TRACE(" maxTransformFeedbackBufferDataStride: %u.\n", xfb->maxTransformFeedbackBufferDataStride);
+ TRACE(" transformFeedbackQueries: %#x.\n", xfb->transformFeedbackQueries);
+ TRACE(" transformFeedbackStreamsLinesTriangles: %#x.\n", xfb->transformFeedbackStreamsLinesTriangles);
+ TRACE(" transformFeedbackRasterizationStreamSelect: %#x.\n", xfb->transformFeedbackRasterizationStreamSelect);
+ TRACE(" transformFeedbackDraw: %x.\n", xfb->transformFeedbackDraw);
+
+ divisor_properties = &info->vertex_divisor_properties;
+ TRACE(" VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT:\n");
+ TRACE(" maxVertexAttribDivisor: %u.\n", divisor_properties->maxVertexAttribDivisor);
+}
+
+static void vkd3d_trace_physical_device_features(const struct vkd3d_physical_device_info *info)
{
const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *divisor_features;
const VkPhysicalDeviceDescriptorIndexingFeaturesEXT *descriptor_indexing;
const VkPhysicalDeviceDepthClipEnableFeaturesEXT *depth_clip_features;
- const VkPhysicalDeviceFeatures *features = &features2->features;
+ const VkPhysicalDeviceFeatures *features = &info->features2.features;
const VkPhysicalDeviceTransformFeedbackFeaturesEXT *xfb;
TRACE("Device features:\n");
@@ -1013,80 +1062,68 @@ static void vkd3d_trace_physical_device_features(const VkPhysicalDeviceFeatures2
TRACE(" variableMultisampleRate: %#x.\n", features->variableMultisampleRate);
TRACE(" inheritedQueries: %#x.\n", features->inheritedQueries);
- descriptor_indexing = vk_find_struct(features2->pNext, PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT);
- if (descriptor_indexing)
- {
- TRACE(" VkPhysicalDeviceDescriptorIndexingFeaturesEXT:\n");
-
- TRACE(" shaderInputAttachmentArrayDynamicIndexing: %#x.\n",
- descriptor_indexing->shaderInputAttachmentArrayDynamicIndexing);
- TRACE(" shaderUniformTexelBufferArrayDynamicIndexing: %#x.\n",
- descriptor_indexing->shaderUniformTexelBufferArrayDynamicIndexing);
- TRACE(" shaderStorageTexelBufferArrayDynamicIndexing: %#x.\n",
- descriptor_indexing->shaderStorageTexelBufferArrayDynamicIndexing);
-
- TRACE(" shaderUniformBufferArrayNonUniformIndexing: %#x.\n",
- descriptor_indexing->shaderUniformBufferArrayNonUniformIndexing);
- TRACE(" shaderSampledImageArrayNonUniformIndexing: %#x.\n",
- descriptor_indexing->shaderSampledImageArrayNonUniformIndexing);
- TRACE(" shaderStorageBufferArrayNonUniformIndexing: %#x.\n",
- descriptor_indexing->shaderStorageBufferArrayNonUniformIndexing);
- TRACE(" shaderStorageImageArrayNonUniformIndexing: %#x.\n",
- descriptor_indexing->shaderStorageImageArrayNonUniformIndexing);
- TRACE(" shaderInputAttachmentArrayNonUniformIndexing: %#x.\n",
- descriptor_indexing->shaderInputAttachmentArrayNonUniformIndexing);
- TRACE(" shaderUniformTexelBufferArrayNonUniformIndexing: %#x.\n",
- descriptor_indexing->shaderUniformTexelBufferArrayNonUniformIndexing);
- TRACE(" shaderStorageTexelBufferArrayNonUniformIndexing: %#x.\n",
- descriptor_indexing->shaderStorageTexelBufferArrayNonUniformIndexing);
-
- TRACE(" descriptorBindingUniformBufferUpdateAfterBind: %#x.\n",
- descriptor_indexing->descriptorBindingUniformBufferUpdateAfterBind);
- TRACE(" descriptorBindingSampledImageUpdateAfterBind: %#x.\n",
- descriptor_indexing->descriptorBindingSampledImageUpdateAfterBind);
- TRACE(" descriptorBindingStorageImageUpdateAfterBind: %#x.\n",
- descriptor_indexing->descriptorBindingStorageImageUpdateAfterBind);
- TRACE(" descriptorBindingStorageBufferUpdateAfterBind: %#x.\n",
- descriptor_indexing->descriptorBindingStorageBufferUpdateAfterBind);
- TRACE(" descriptorBindingUniformTexelBufferUpdateAfterBind: %#x.\n",
- descriptor_indexing->descriptorBindingUniformTexelBufferUpdateAfterBind);
- TRACE(" descriptorBindingStorageTexelBufferUpdateAfterBind: %#x.\n",
- descriptor_indexing->descriptorBindingStorageTexelBufferUpdateAfterBind);
-
- TRACE(" descriptorBindingUpdateUnusedWhilePending: %#x.\n",
- descriptor_indexing->descriptorBindingUpdateUnusedWhilePending);
- TRACE(" descriptorBindingPartiallyBound: %#x.\n",
- descriptor_indexing->descriptorBindingPartiallyBound);
- TRACE(" descriptorBindingVariableDescriptorCount: %#x.\n",
- descriptor_indexing->descriptorBindingVariableDescriptorCount);
- TRACE(" runtimeDescriptorArray: %#x.\n",
- descriptor_indexing->runtimeDescriptorArray);
- }
-
- depth_clip_features = vk_find_struct(features2->pNext, PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT);
- if (depth_clip_features)
- {
- TRACE(" VkPhysicalDeviceDepthClipEnableFeaturesEXT:\n");
- TRACE(" depthClipEnable: %#x.\n", depth_clip_features->depthClipEnable);
- }
-
- xfb = vk_find_struct(features2->pNext, PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT);
- if (xfb)
- {
- TRACE(" VkPhysicalDeviceTransformFeedbackFeaturesEXT:\n");
- TRACE(" transformFeedback: %#x.\n", xfb->transformFeedback);
- TRACE(" geometryStreams: %#x.\n", xfb->geometryStreams);
- }
-
- divisor_features = vk_find_struct(features2->pNext, PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT);
- if (divisor_features)
- {
- TRACE(" VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT:\n");
- TRACE(" vertexAttributeInstanceRateDivisor: %#x.\n",
- divisor_features->vertexAttributeInstanceRateDivisor);
- TRACE(" vertexAttributeInstanceRateZeroDivisor: %#x.\n",
- divisor_features->vertexAttributeInstanceRateZeroDivisor);
- }
+ descriptor_indexing = &info->descriptor_indexing_features;
+ TRACE(" VkPhysicalDeviceDescriptorIndexingFeaturesEXT:\n");
+
+ TRACE(" shaderInputAttachmentArrayDynamicIndexing: %#x.\n",
+ descriptor_indexing->shaderInputAttachmentArrayDynamicIndexing);
+ TRACE(" shaderUniformTexelBufferArrayDynamicIndexing: %#x.\n",
+ descriptor_indexing->shaderUniformTexelBufferArrayDynamicIndexing);
+ TRACE(" shaderStorageTexelBufferArrayDynamicIndexing: %#x.\n",
+ descriptor_indexing->shaderStorageTexelBufferArrayDynamicIndexing);
+
+ TRACE(" shaderUniformBufferArrayNonUniformIndexing: %#x.\n",
+ descriptor_indexing->shaderUniformBufferArrayNonUniformIndexing);
+ TRACE(" shaderSampledImageArrayNonUniformIndexing: %#x.\n",
+ descriptor_indexing->shaderSampledImageArrayNonUniformIndexing);
+ TRACE(" shaderStorageBufferArrayNonUniformIndexing: %#x.\n",
+ descriptor_indexing->shaderStorageBufferArrayNonUniformIndexing);
+ TRACE(" shaderStorageImageArrayNonUniformIndexing: %#x.\n",
+ descriptor_indexing->shaderStorageImageArrayNonUniformIndexing);
+ TRACE(" shaderInputAttachmentArrayNonUniformIndexing: %#x.\n",
+ descriptor_indexing->shaderInputAttachmentArrayNonUniformIndexing);
+ TRACE(" shaderUniformTexelBufferArrayNonUniformIndexing: %#x.\n",
+ descriptor_indexing->shaderUniformTexelBufferArrayNonUniformIndexing);
+ TRACE(" shaderStorageTexelBufferArrayNonUniformIndexing: %#x.\n",
+ descriptor_indexing->shaderStorageTexelBufferArrayNonUniformIndexing);
+
+ TRACE(" descriptorBindingUniformBufferUpdateAfterBind: %#x.\n",
+ descriptor_indexing->descriptorBindingUniformBufferUpdateAfterBind);
+ TRACE(" descriptorBindingSampledImageUpdateAfterBind: %#x.\n",
+ descriptor_indexing->descriptorBindingSampledImageUpdateAfterBind);
+ TRACE(" descriptorBindingStorageImageUpdateAfterBind: %#x.\n",
+ descriptor_indexing->descriptorBindingStorageImageUpdateAfterBind);
+ TRACE(" descriptorBindingStorageBufferUpdateAfterBind: %#x.\n",
+ descriptor_indexing->descriptorBindingStorageBufferUpdateAfterBind);
+ TRACE(" descriptorBindingUniformTexelBufferUpdateAfterBind: %#x.\n",
+ descriptor_indexing->descriptorBindingUniformTexelBufferUpdateAfterBind);
+ TRACE(" descriptorBindingStorageTexelBufferUpdateAfterBind: %#x.\n",
+ descriptor_indexing->descriptorBindingStorageTexelBufferUpdateAfterBind);
+
+ TRACE(" descriptorBindingUpdateUnusedWhilePending: %#x.\n",
+ descriptor_indexing->descriptorBindingUpdateUnusedWhilePending);
+ TRACE(" descriptorBindingPartiallyBound: %#x.\n",
+ descriptor_indexing->descriptorBindingPartiallyBound);
+ TRACE(" descriptorBindingVariableDescriptorCount: %#x.\n",
+ descriptor_indexing->descriptorBindingVariableDescriptorCount);
+ TRACE(" runtimeDescriptorArray: %#x.\n",
+ descriptor_indexing->runtimeDescriptorArray);
+
+ depth_clip_features = &info->depth_clip_features;
+ TRACE(" VkPhysicalDeviceDepthClipEnableFeaturesEXT:\n");
+ TRACE(" depthClipEnable: %#x.\n", depth_clip_features->depthClipEnable);
+
+ xfb = &info->xfb_features;
+ TRACE(" VkPhysicalDeviceTransformFeedbackFeaturesEXT:\n");
+ TRACE(" transformFeedback: %#x.\n", xfb->transformFeedback);
+ TRACE(" geometryStreams: %#x.\n", xfb->geometryStreams);
+
+ divisor_features = &info->vertex_divisor_features;
+ TRACE(" VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT:\n");
+ TRACE(" vertexAttributeInstanceRateDivisor: %#x.\n",
+ divisor_features->vertexAttributeInstanceRateDivisor);
+ TRACE(" vertexAttributeInstanceRateZeroDivisor: %#x.\n",
+ divisor_features->vertexAttributeInstanceRateZeroDivisor);
}
static void vkd3d_init_feature_level(struct vkd3d_vulkan_info *vk_info,
@@ -1181,63 +1218,40 @@ static void vkd3d_init_feature_level(struct vkd3d_vulkan_info *vk_info,
}
static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
- const struct vkd3d_device_create_info *create_info, VkPhysicalDeviceFeatures2KHR *features2,
+ const struct vkd3d_device_create_info *create_info,
+ struct vkd3d_physical_device_info *physical_device_info,
uint32_t *device_extension_count, bool **user_extension_supported)
{
const struct vkd3d_vk_instance_procs *vk_procs = &device->vkd3d_instance->vk_procs;
- VkPhysicalDeviceDescriptorIndexingPropertiesEXT descriptor_indexing_properties;
- VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_divisor_properties;
- const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *divisor_features;
const struct vkd3d_optional_device_extensions_info *optional_extensions;
- const VkPhysicalDeviceDepthClipEnableFeaturesEXT *depth_clip_features;
VkPhysicalDeviceDescriptorIndexingFeaturesEXT *descriptor_indexing;
- VkPhysicalDeviceMaintenance3Properties maintenance3_properties;
- VkPhysicalDeviceTransformFeedbackPropertiesEXT xfb_properties;
VkPhysicalDevice physical_device = device->vk_physical_device;
- VkPhysicalDeviceFeatures *features = &features2->features;
struct vkd3d_vulkan_info *vulkan_info = &device->vk_info;
- VkPhysicalDeviceProperties2KHR device_properties2;
VkExtensionProperties *vk_extensions;
+ VkPhysicalDeviceFeatures *features;
uint32_t count;
VkResult vr;
*device_extension_count = 0;
- memset(&maintenance3_properties, 0, sizeof(maintenance3_properties));
- maintenance3_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES;
- memset(&descriptor_indexing_properties, 0, sizeof(descriptor_indexing_properties));
- descriptor_indexing_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT;
- descriptor_indexing_properties.pNext = &maintenance3_properties;
- memset(&xfb_properties, 0, sizeof(xfb_properties));
- xfb_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT;
- xfb_properties.pNext = &descriptor_indexing_properties;
- memset(&vertex_divisor_properties, 0, sizeof(vertex_divisor_properties));
- vertex_divisor_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT;
- vertex_divisor_properties.pNext = &xfb_properties;
- device_properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
- device_properties2.pNext = &vertex_divisor_properties;
-
- if (vulkan_info->KHR_get_physical_device_properties2)
- VK_CALL(vkGetPhysicalDeviceProperties2KHR(physical_device, &device_properties2));
- else
- VK_CALL(vkGetPhysicalDeviceProperties(physical_device, &device_properties2.properties));
+ vkd3d_trace_physical_device(physical_device, physical_device_info, vk_procs);
+ vkd3d_trace_physical_device_features(physical_device_info);
+ vkd3d_trace_physical_device_limits(physical_device_info);
- vkd3d_trace_physical_device(physical_device, &device_properties2.properties, vk_procs);
- vkd3d_trace_physical_device_features(features2);
- vkd3d_trace_physical_device_limits(&device_properties2);
+ features = &physical_device_info->features2.features;
if (!features->sparseResidencyBuffer || !features->sparseResidencyImage2D)
{
features->sparseResidencyBuffer = VK_FALSE;
features->sparseResidencyImage2D = VK_FALSE;
- device_properties2.properties.sparseProperties.residencyNonResidentStrict = VK_FALSE;
+ physical_device_info->properties2.properties.sparseProperties.residencyNonResidentStrict = VK_FALSE;
}
- vulkan_info->device_limits = device_properties2.properties.limits;
- vulkan_info->sparse_properties = device_properties2.properties.sparseProperties;
- vulkan_info->rasterization_stream = xfb_properties.transformFeedbackRasterizationStreamSelect;
- vulkan_info->transform_feedback_queries = xfb_properties.transformFeedbackQueries;
- vulkan_info->max_vertex_attrib_divisor = max(vertex_divisor_properties.maxVertexAttribDivisor, 1);
+ vulkan_info->device_limits = physical_device_info->properties2.properties.limits;
+ vulkan_info->sparse_properties = physical_device_info->properties2.properties.sparseProperties;
+ vulkan_info->rasterization_stream = physical_device_info->xfb_properties.transformFeedbackRasterizationStreamSelect;
+ vulkan_info->transform_feedback_queries = physical_device_info->xfb_properties.transformFeedbackQueries;
+ vulkan_info->max_vertex_attrib_divisor = max(physical_device_info->vertex_divisor_properties.maxVertexAttribDivisor, 1);
device->feature_options.DoublePrecisionFloatShaderOps = features->shaderFloat64;
device->feature_options.OutputMergerLogicOp = features->logicOp;
@@ -1281,8 +1295,7 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
device->feature_options.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation = FALSE;
device->feature_options.ResourceHeapTier = D3D12_RESOURCE_HEAP_TIER_2;
- if ((vr = VK_CALL(vkEnumerateDeviceExtensionProperties(physical_device, NULL,
- &count, NULL))) < 0)
+ if ((vr = VK_CALL(vkEnumerateDeviceExtensionProperties(physical_device, NULL, &count, NULL))) < 0)
{
ERR("Failed to enumerate device extensions, vr %d.\n", vr);
return hresult_from_vk_result(vr);
@@ -1294,8 +1307,7 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
return E_OUTOFMEMORY;
TRACE("Enumerating %u device extensions.\n", count);
- if ((vr = VK_CALL(vkEnumerateDeviceExtensionProperties(physical_device, NULL,
- &count, vk_extensions))) < 0)
+ if ((vr = VK_CALL(vkEnumerateDeviceExtensionProperties(physical_device, NULL, &count, vk_extensions))) < 0)
{
ERR("Failed to enumerate device extensions, vr %d.\n", vr);
vkd3d_free(vk_extensions);
@@ -1325,16 +1337,12 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
*user_extension_supported, vulkan_info, "device",
device->vkd3d_instance->config_flags & VKD3D_CONFIG_FLAG_VULKAN_DEBUG);
- depth_clip_features = vk_find_struct(features2->pNext, PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT);
- if (depth_clip_features)
- {
- vulkan_info->EXT_depth_clip_enable = depth_clip_features->depthClipEnable;
- }
+ vulkan_info->EXT_depth_clip_enable = physical_device_info->depth_clip_features.depthClipEnable;
- divisor_features = vk_find_struct(features2->pNext, PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT);
- if (get_spec_version(vk_extensions, count, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME) >= 3
- && divisor_features)
+ if (get_spec_version(vk_extensions, count, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME) >= 3)
{
+ const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *divisor_features;
+ divisor_features = &physical_device_info->vertex_divisor_features;
if (!divisor_features->vertexAttributeInstanceRateDivisor)
vulkan_info->EXT_vertex_attribute_divisor = false;
vulkan_info->vertex_attrib_zero_divisor = divisor_features->vertexAttributeInstanceRateZeroDivisor;
@@ -1358,7 +1366,7 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
/* Disable unused Vulkan features. */
features->shaderTessellationAndGeometryPointSize = VK_FALSE;
- descriptor_indexing = vk_find_struct(features2->pNext, PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT);
+ descriptor_indexing = &physical_device_info->descriptor_indexing_features;
if (descriptor_indexing)
{
descriptor_indexing->shaderInputAttachmentArrayDynamicIndexing = VK_FALSE;
@@ -1375,7 +1383,7 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
|| descriptor_indexing->descriptorBindingStorageBufferUpdateAfterBind
|| descriptor_indexing->descriptorBindingUniformTexelBufferUpdateAfterBind
|| descriptor_indexing->descriptorBindingStorageTexelBufferUpdateAfterBind)
- && !descriptor_indexing_properties.robustBufferAccessUpdateAfterBind)
+ && !physical_device_info->descriptor_indexing_properties.robustBufferAccessUpdateAfterBind)
{
WARN("Disabling robust buffer access for the update after bind feature.\n");
features->robustBufferAccess = VK_FALSE;
@@ -1621,15 +1629,10 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device,
const struct vkd3d_device_create_info *create_info)
{
const struct vkd3d_vk_instance_procs *vk_procs = &device->vkd3d_instance->vk_procs;
- VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptor_indexing_features;
- VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT vertex_divisor_features;
const struct vkd3d_optional_device_extensions_info *optional_extensions;
- VkPhysicalDeviceDepthClipEnableFeaturesEXT depth_clip_features;
- VkPhysicalDeviceTransformFeedbackFeaturesEXT xfb_features;
- struct vkd3d_vulkan_info *vulkan_info = &device->vk_info;
+ struct vkd3d_physical_device_info physical_device_info;
struct vkd3d_device_queue_info device_queue_info;
bool *user_extension_supported = NULL;
- VkPhysicalDeviceFeatures2 features2;
VkPhysicalDevice physical_device;
VkDeviceCreateInfo device_info;
unsigned int device_index;
@@ -1661,25 +1664,9 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device,
VK_CALL(vkGetPhysicalDeviceMemoryProperties(physical_device, &device->memory_properties));
- memset(&depth_clip_features, 0, sizeof(depth_clip_features));
- depth_clip_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT;
- memset(&descriptor_indexing_features, 0, sizeof(descriptor_indexing_features));
- descriptor_indexing_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
- descriptor_indexing_features.pNext = &depth_clip_features;
- memset(&xfb_features, 0, sizeof(xfb_features));
- xfb_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT;
- xfb_features.pNext = &descriptor_indexing_features;
- memset(&vertex_divisor_features, 0, sizeof(vertex_divisor_features));
- vertex_divisor_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT;
- vertex_divisor_features.pNext = &xfb_features;
- features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
- features2.pNext = &vertex_divisor_features;
- if (vulkan_info->KHR_get_physical_device_properties2)
- VK_CALL(vkGetPhysicalDeviceFeatures2KHR(physical_device, &features2));
- else
- VK_CALL(vkGetPhysicalDeviceFeatures(physical_device, &features2.features));
+ vkd3d_physical_device_info_init(&physical_device_info, device);
- if (FAILED(hr = vkd3d_init_device_caps(device, create_info, &features2,
+ if (FAILED(hr = vkd3d_init_device_caps(device, create_info, &physical_device_info,
&extension_count, &user_extension_supported)))
return hr;
@@ -1693,7 +1680,7 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device,
/* Create device */
device_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
- device_info.pNext = &vertex_divisor_features;
+ device_info.pNext = physical_device_info.features2.pNext;
device_info.flags = 0;
device_info.queueCreateInfoCount = device_queue_info.vk_family_count;
device_info.pQueueCreateInfos = device_queue_info.vk_queue_create_info;
@@ -1707,7 +1694,7 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device,
optional_extensions ? optional_extensions->extension_count : 0,
user_extension_supported, &device->vk_info);
device_info.ppEnabledExtensionNames = extensions;
- device_info.pEnabledFeatures = &features2.features;
+ device_info.pEnabledFeatures = &physical_device_info.features2.features;
vkd3d_free(user_extension_supported);
vr = VK_CALL(vkCreateDevice(physical_device, &device_info, NULL, &vk_device));
--
2.21.0
2
1
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
include/vkd3d_d3d12.idl | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl
index ec78c6652109..2b395aa1bb4e 100644
--- a/include/vkd3d_d3d12.idl
+++ b/include/vkd3d_d3d12.idl
@@ -1639,6 +1639,23 @@ typedef struct D3D12_SUBRESOURCE_DATA
LONG_PTR SlicePitch;
} D3D12_SUBRESOURCE_DATA;
+typedef enum D3D12_MULTIPLE_FENCE_WAIT_FLAGS
+{
+ D3D12_MULTIPLE_FENCE_WAIT_FLAG_NONE = 0x0,
+ D3D12_MULTIPLE_FENCE_WAIT_FLAG_ANY = 0x1,
+ D3D12_MULTIPLE_FENCE_WAIT_FLAG_ALL = 0x0,
+} D3D12_MULTIPLE_FENCE_WAIT_FLAGS;
+cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_MULTIPLE_FENCE_WAIT_FLAGS);")
+
+typedef enum D3D12_RESIDENCY_PRIORITY
+{
+ D3D12_RESIDENCY_PRIORITY_MINIMUM = 0x28000000,
+ D3D12_RESIDENCY_PRIORITY_LOW = 0x50000000,
+ D3D12_RESIDENCY_PRIORITY_NORMAL = 0x78000000,
+ D3D12_RESIDENCY_PRIORITY_HIGH = 0xa0010000,
+ D3D12_RESIDENCY_PRIORITY_MAXIMUM = 0xc8000000,
+} D3D12_RESIDENCY_PRIORITY;
+
[
uuid(c4fec28f-7966-4e95-9f94-f431cb56c3b8),
object,
@@ -2284,6 +2301,23 @@ interface ID3D12Device : ID3D12Object
LUID GetAdapterLuid();
}
+[
+ uuid(77acce80-638e-4e65-8895-c1f23386863e),
+ object,
+ local,
+ pointer_default(unique)
+]
+interface ID3D12Device1 : ID3D12Device
+{
+ HRESULT CreatePipelineLibrary(const void *blob, SIZE_T blob_size, REFIID iid, void **lib);
+
+ HRESULT SetEventOnMultipleFenceCompletion(ID3D12Fence * const *fences,
+ const UINT64 *values, UINT fence_count, D3D12_MULTIPLE_FENCE_WAIT_FLAGS flags, HANDLE event);
+
+ HRESULT SetResidencyPriority(UINT object_count, ID3D12Pageable * const *objects,
+ const D3D12_RESIDENCY_PRIORITY *priorities);
+}
+
[
uuid(344488b7-6846-474b-b989-f027448245e0),
object,
--
2.21.0
2
1
07 Jun '19
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/mf/samplegrabber.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c
index 3f9644432d..23bfa06fce 100644
--- a/dlls/mf/samplegrabber.c
+++ b/dlls/mf/samplegrabber.c
@@ -613,6 +613,11 @@ static struct scheduled_sample *stream_get_next_sample(struct sample_grabber_str
return sample;
}
+static void sample_grabber_stream_request_sample(struct sample_grabber_stream *stream)
+{
+ IMFStreamSink_QueueEvent(&stream->IMFStreamSink_iface, MEStreamSinkRequestSample, &GUID_NULL, S_OK, NULL);
+}
+
static HRESULT WINAPI sample_grabber_stream_timer_callback_Invoke(IMFAsyncCallback *iface, IMFAsyncResult *result)
{
struct sample_grabber_stream *stream = impl_from_IMFAsyncCallback(iface);
@@ -634,6 +639,7 @@ static HRESULT WINAPI sample_grabber_stream_timer_callback_Invoke(IMFAsyncCallba
if (FAILED(hr = stream_schedule_sample(stream, sample)))
WARN("Failed to schedule a sample, hr %#x.\n", hr);
}
+ sample_grabber_stream_request_sample(stream);
}
LeaveCriticalSection(&stream->cs);
@@ -950,6 +956,7 @@ static void sample_grabber_set_state(struct sample_grabber *grabber, enum sink_s
MEStreamSinkStarted, /* SINK_STATE_RUNNING */
};
BOOL set_state = FALSE;
+ unsigned int i;
EnterCriticalSection(&grabber->cs);
@@ -970,6 +977,12 @@ static void sample_grabber_set_state(struct sample_grabber *grabber, enum sink_s
if (set_state)
{
grabber->stream->state = state;
+ if (state == SINK_STATE_RUNNING)
+ {
+ /* Every transition to running state sends a bunch requests to build up initial queue. */
+ for (i = 0; i < 4; ++i)
+ sample_grabber_stream_request_sample(grabber->stream);
+ }
IMFStreamSink_QueueEvent(&grabber->stream->IMFStreamSink_iface, events[state], &GUID_NULL, S_OK, NULL);
}
}
--
2.20.1
2
5
[PATCH 5/5] wined3d: Upload texture data through the texture ops in wined3d_cs_exec_blt_sub_resource().
by Henri Verbeet 07 Jun '19
by Henri Verbeet 07 Jun '19
07 Jun '19
Since we want to avoid directly calling GL-specific code here.
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/cs.c | 8 ++++----
dlls/wined3d/texture.c | 32 ++++++++++++++++++++++++++++++++
dlls/wined3d/wined3d_private.h | 4 ++++
3 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index e1f94f45eed..a95ba502f32 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -2242,10 +2242,10 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
wined3d_texture_get_pitch(src_texture, op->src_sub_resource_idx % src_texture->level_count,
&row_pitch, &slice_pitch);
- wined3d_texture_gl_bind_and_dirtify(wined3d_texture_gl(dst_texture), wined3d_context_gl(context), FALSE);
- wined3d_texture_upload_data(dst_texture, op->dst_sub_resource_idx, context,
- dst_texture->resource.format, &op->src_box, wined3d_const_bo_address(&addr),
- row_pitch, slice_pitch, op->dst_box.left, op->dst_box.top, op->dst_box.front, FALSE);
+ dst_texture->texture_ops->texture_upload_data(context, wined3d_const_bo_address(&addr),
+ dst_texture->resource.format, &op->src_box, row_pitch, slice_pitch, dst_texture,
+ op->dst_sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB,
+ op->dst_box.left, op->dst_box.top, op->dst_box.front);
wined3d_texture_validate_location(dst_texture, op->dst_sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_invalidate_location(dst_texture, op->dst_sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index dc60d874bd6..6e1cc047502 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -2453,9 +2453,39 @@ static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned in
}
}
+static void wined3d_texture_gl_upload_data(struct wined3d_context *context,
+ const struct wined3d_const_bo_address *src_bo_addr, const struct wined3d_format *src_format,
+ const struct wined3d_box *src_box, unsigned int src_row_pitch, unsigned int src_slice_pitch,
+ struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, unsigned int dst_location,
+ unsigned int dst_x, unsigned int dst_y, unsigned int dst_z)
+{
+ BOOL srgb = FALSE;
+
+ TRACE("context %p, src_bo_addr %s, src_format %s, src_box %s, src_row_pitch %u, src_slice_pitch %u, "
+ "dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_x %u, dst_y %u, dst_z %u.\n",
+ context, debug_const_bo_address(src_bo_addr), debug_d3dformat(src_format->id), debug_box(src_box),
+ src_row_pitch, src_slice_pitch, dst_texture, dst_sub_resource_idx,
+ wined3d_debug_location(dst_location), dst_x, dst_y, dst_z);
+
+ if (dst_location == WINED3D_LOCATION_TEXTURE_SRGB)
+ {
+ srgb = TRUE;
+ }
+ else if (dst_location != WINED3D_LOCATION_TEXTURE_RGB)
+ {
+ FIXME("Unhandled location %s.\n", wined3d_debug_location(dst_location));
+ return;
+ }
+
+ wined3d_texture_gl_bind_and_dirtify(wined3d_texture_gl(dst_texture), wined3d_context_gl(context), srgb);
+ wined3d_texture_upload_data(dst_texture, dst_sub_resource_idx, context, src_format,
+ src_box, src_bo_addr, src_row_pitch, src_slice_pitch, dst_x, dst_y, dst_z, srgb);
+}
+
static const struct wined3d_texture_ops texture2d_ops =
{
texture2d_load_location,
+ wined3d_texture_gl_upload_data,
};
struct wined3d_texture * __cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
@@ -2829,6 +2859,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
static const struct wined3d_texture_ops texture1d_ops =
{
texture1d_load_location,
+ wined3d_texture_gl_upload_data,
};
static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc,
@@ -3244,6 +3275,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
static const struct wined3d_texture_ops texture3d_ops =
{
texture3d_load_location,
+ wined3d_texture_gl_upload_data,
};
HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 42140831a0a..70a3c630039 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3382,6 +3382,10 @@ struct wined3d_texture_ops
{
BOOL (*texture_load_location)(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, DWORD location);
+ void (*texture_upload_data)(struct wined3d_context *context, const struct wined3d_const_bo_address *src_bo_addr,
+ const struct wined3d_format *src_format, const struct wined3d_box *src_box, unsigned int src_row_pitch,
+ unsigned int src_slice_pitch, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx,
+ unsigned int dst_location, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z);
};
#define WINED3D_TEXTURE_COND_NP2 0x00000001
--
2.11.0
1
0
[PATCH 4/5] wined3d: Pass a wined3d_context_gl structure to context_copy_bo_address().
by Henri Verbeet 07 Jun '19
by Henri Verbeet 07 Jun '19
07 Jun '19
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/buffer.c | 3 ++-
dlls/wined3d/context.c | 13 ++++++-------
dlls/wined3d/view.c | 3 ++-
dlls/wined3d/wined3d_private.h | 6 +++---
4 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 8dc6d4b6a1b..9fcd96b864a 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1218,7 +1218,8 @@ void wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_off
src.addr += src_offset;
context = context_acquire(dst_buffer->resource.device, NULL, 0);
- context_copy_bo_address(context, &dst, wined3d_buffer_gl(dst_buffer)->buffer_type_hint,
+ wined3d_context_gl_copy_bo_address(wined3d_context_gl(context),
+ &dst, wined3d_buffer_gl(dst_buffer)->buffer_type_hint,
&src, wined3d_buffer_gl(src_buffer)->buffer_type_hint, size);
context_release(context);
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 18a516c606e..933bf13fefc 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2634,15 +2634,14 @@ void context_unmap_bo_address(struct wined3d_context *context,
checkGLcall("Unmap buffer object");
}
-void context_copy_bo_address(struct wined3d_context *context,
+void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl,
const struct wined3d_bo_address *dst, GLenum dst_binding,
const struct wined3d_bo_address *src, GLenum src_binding, size_t size)
{
- struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
const struct wined3d_gl_info *gl_info;
BYTE *dst_ptr, *src_ptr;
- gl_info = context->gl_info;
+ gl_info = context_gl->c.gl_info;
if (dst->buffer_object && src->buffer_object)
{
@@ -2656,13 +2655,13 @@ void context_copy_bo_address(struct wined3d_context *context,
}
else
{
- src_ptr = context_map_bo_address(context, src, size, src_binding, WINED3D_MAP_READ);
- dst_ptr = context_map_bo_address(context, dst, size, dst_binding, WINED3D_MAP_WRITE);
+ src_ptr = context_map_bo_address(&context_gl->c, src, size, src_binding, WINED3D_MAP_READ);
+ dst_ptr = context_map_bo_address(&context_gl->c, dst, size, dst_binding, WINED3D_MAP_WRITE);
memcpy(dst_ptr, src_ptr, size);
- context_unmap_bo_address(context, dst, dst_binding);
- context_unmap_bo_address(context, src, src_binding);
+ context_unmap_bo_address(&context_gl->c, dst, dst_binding);
+ context_unmap_bo_address(&context_gl->c, src, src_binding);
}
}
else if (!dst->buffer_object && src->buffer_object)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 4456a10a36b..bd32b88e0eb 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -1096,6 +1096,7 @@ void wined3d_unordered_access_view_copy_counter(struct wined3d_unordered_access_
struct wined3d_buffer *buffer, unsigned int offset, struct wined3d_context *context)
{
struct wined3d_unordered_access_view_gl *view_gl = wined3d_unordered_access_view_gl(view);
+ struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
struct wined3d_bo_address dst, src;
DWORD dst_location;
@@ -1108,7 +1109,7 @@ void wined3d_unordered_access_view_copy_counter(struct wined3d_unordered_access_
src.buffer_object = view_gl->counter_bo;
src.addr = NULL;
- context_copy_bo_address(context, &dst, wined3d_buffer_gl(buffer)->buffer_type_hint,
+ wined3d_context_gl_copy_bo_address(context_gl, &dst, wined3d_buffer_gl(buffer)->buffer_type_hint,
&src, GL_ATOMIC_COUNTER_BUFFER, sizeof(GLuint));
wined3d_buffer_invalidate_location(buffer, ~dst_location);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 94623580109..42140831a0a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2086,6 +2086,9 @@ void wined3d_context_gl_bind_dummy_textures(const struct wined3d_context_gl *con
void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl,
GLenum target, GLuint name) DECLSPEC_HIDDEN;
void wined3d_context_gl_check_fbo_status(const struct wined3d_context_gl *context_gl, GLenum target) DECLSPEC_HIDDEN;
+void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl,
+ const struct wined3d_bo_address *dst, GLenum dst_binding,
+ const struct wined3d_bo_address *src, GLenum src_binding, size_t size) DECLSPEC_HIDDEN;
void wined3d_context_gl_destroy(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
void wined3d_context_gl_free_fence(struct wined3d_fence *fence) DECLSPEC_HIDDEN;
void wined3d_context_gl_free_occlusion_query(struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN;
@@ -2239,9 +2242,6 @@ void wined3d_raw_blitter_create(struct wined3d_blitter **next,
BOOL wined3d_clip_blit(const RECT *clip_rect, RECT *clipped, RECT *other) DECLSPEC_HIDDEN;
-void context_copy_bo_address(struct wined3d_context *context,
- const struct wined3d_bo_address *dst, GLenum dst_binding,
- const struct wined3d_bo_address *src, GLenum src_binding, size_t size) DECLSPEC_HIDDEN;
HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx) DECLSPEC_HIDDEN;
void context_draw_shaded_quad(struct wined3d_context *context, struct wined3d_texture_gl *texture_gl,
unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect,
--
2.11.0
1
0