mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
libs/vkd3d: Pass signal event function pointer to vkd3d_create_device().
This commit is contained in:
parent
544c2668ca
commit
ef6a3d78a2
@ -30,9 +30,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
typedef BOOL (WINAPI *vkd3d_signal_event_pfn)(HANDLE event);
|
||||||
|
|
||||||
struct vkd3d_device_create_info
|
struct vkd3d_device_create_info
|
||||||
{
|
{
|
||||||
D3D_FEATURE_LEVEL minimum_feature_level;
|
D3D_FEATURE_LEVEL minimum_feature_level;
|
||||||
|
vkd3d_signal_event_pfn signal_event_pfn;
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT WINAPI vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
|
HRESULT WINAPI vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
|
||||||
|
@ -162,7 +162,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_fence_SetEventOnCompletion(ID3D12Fence *i
|
|||||||
|
|
||||||
if (value <= fence->value)
|
if (value <= fence->value)
|
||||||
{
|
{
|
||||||
VKD3DSignalEvent(event);
|
fence->device->signal_event(event);
|
||||||
pthread_mutex_unlock(&fence->mutex);
|
pthread_mutex_unlock(&fence->mutex);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_fence_Signal(ID3D12Fence *iface, UINT64 v
|
|||||||
|
|
||||||
if (current->value <= value)
|
if (current->value <= value)
|
||||||
{
|
{
|
||||||
VKD3DSignalEvent(current->event);
|
fence->device->signal_event(current->event);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1071,7 +1071,8 @@ static const struct ID3D12DeviceVtbl d3d12_device_vtbl =
|
|||||||
d3d12_device_GetAdapterLuid,
|
d3d12_device_GetAdapterLuid,
|
||||||
};
|
};
|
||||||
|
|
||||||
static HRESULT d3d12_device_init(struct d3d12_device *device)
|
static HRESULT d3d12_device_init(struct d3d12_device *device,
|
||||||
|
const struct vkd3d_device_create_info *create_info)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
@ -1087,10 +1088,13 @@ static HRESULT d3d12_device_init(struct d3d12_device *device)
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
device->signal_event = create_info->signal_event_pfn;
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT d3d12_device_create(struct d3d12_device **device)
|
HRESULT d3d12_device_create(const struct vkd3d_device_create_info *create_info,
|
||||||
|
struct d3d12_device **device)
|
||||||
{
|
{
|
||||||
struct d3d12_device *object;
|
struct d3d12_device *object;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
@ -1098,7 +1102,7 @@ HRESULT d3d12_device_create(struct d3d12_device **device)
|
|||||||
if (!(object = vkd3d_malloc(sizeof(*object))))
|
if (!(object = vkd3d_malloc(sizeof(*object))))
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
if (FAILED(hr = d3d12_device_init(object)))
|
if (FAILED(hr = d3d12_device_init(object, create_info)))
|
||||||
{
|
{
|
||||||
vkd3d_free(object);
|
vkd3d_free(object);
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -44,7 +44,7 @@ HRESULT WINAPI vkd3d_create_device(const struct vkd3d_device_create_info *create
|
|||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(hr = d3d12_device_create(&object)))
|
if (FAILED(hr = d3d12_device_create(create_info, &object)))
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
return return_interface((IUnknown *)&object->ID3D12Device_iface, &IID_ID3D12Device,
|
return return_interface((IUnknown *)&object->ID3D12Device_iface, &IID_ID3D12Device,
|
||||||
@ -63,6 +63,7 @@ HRESULT WINAPI D3D12CreateDevice(IUnknown *adapter, D3D_FEATURE_LEVEL minimum_fe
|
|||||||
FIXME("Ignoring adapter %p.\n", adapter);
|
FIXME("Ignoring adapter %p.\n", adapter);
|
||||||
|
|
||||||
create_info.minimum_feature_level = minimum_feature_level;
|
create_info.minimum_feature_level = minimum_feature_level;
|
||||||
|
create_info.signal_event_pfn = VKD3DSignalEvent;
|
||||||
|
|
||||||
return vkd3d_create_device(&create_info, riid, device);
|
return vkd3d_create_device(&create_info, riid, device);
|
||||||
}
|
}
|
||||||
|
@ -246,6 +246,7 @@ struct d3d12_device
|
|||||||
|
|
||||||
VkDevice vk_device;
|
VkDevice vk_device;
|
||||||
struct vkd3d_vk_device_procs vk_procs;
|
struct vkd3d_vk_device_procs vk_procs;
|
||||||
|
vkd3d_signal_event_pfn signal_event;
|
||||||
|
|
||||||
unsigned int direct_queue_family_index;
|
unsigned int direct_queue_family_index;
|
||||||
unsigned int copy_queue_family_index;
|
unsigned int copy_queue_family_index;
|
||||||
@ -254,7 +255,8 @@ struct d3d12_device
|
|||||||
struct vkd3d_instance vkd3d_instance;
|
struct vkd3d_instance vkd3d_instance;
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT d3d12_device_create(struct d3d12_device **device) DECLSPEC_HIDDEN;
|
HRESULT d3d12_device_create(const struct vkd3d_device_create_info *create_info,
|
||||||
|
struct d3d12_device **device) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* utils */
|
/* utils */
|
||||||
BOOL is_valid_feature_level(D3D_FEATURE_LEVEL feature_level) DECLSPEC_HIDDEN;
|
BOOL is_valid_feature_level(D3D_FEATURE_LEVEL feature_level) DECLSPEC_HIDDEN;
|
||||||
|
Loading…
Reference in New Issue
Block a user