mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d: Use vkd3d_waiting_fence structure in more places.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3d681737c9
commit
1a42564eb9
@ -247,6 +247,7 @@ static HRESULT vkd3d_enqueue_gpu_fence(struct vkd3d_fence_worker *worker,
|
|||||||
VkFence vk_fence, struct d3d12_fence *fence, uint64_t value,
|
VkFence vk_fence, struct d3d12_fence *fence, uint64_t value,
|
||||||
struct vkd3d_queue *queue, uint64_t queue_sequence_number)
|
struct vkd3d_queue *queue, uint64_t queue_sequence_number)
|
||||||
{
|
{
|
||||||
|
struct vkd3d_waiting_fence *waiting_fence;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
TRACE("worker %p, fence %p, value %#"PRIx64".\n", worker, fence, value);
|
TRACE("worker %p, fence %p, value %#"PRIx64".\n", worker, fence, value);
|
||||||
@ -266,10 +267,11 @@ static HRESULT vkd3d_enqueue_gpu_fence(struct vkd3d_fence_worker *worker,
|
|||||||
}
|
}
|
||||||
|
|
||||||
worker->enqueued_fences[worker->enqueued_fence_count].vk_fence = vk_fence;
|
worker->enqueued_fences[worker->enqueued_fence_count].vk_fence = vk_fence;
|
||||||
worker->enqueued_fences[worker->enqueued_fence_count].fence = fence;
|
waiting_fence = &worker->enqueued_fences[worker->enqueued_fence_count].waiting_fence;
|
||||||
worker->enqueued_fences[worker->enqueued_fence_count].value = value;
|
waiting_fence->fence = fence;
|
||||||
worker->enqueued_fences[worker->enqueued_fence_count].queue = queue;
|
waiting_fence->value = value;
|
||||||
worker->enqueued_fences[worker->enqueued_fence_count].queue_sequence_number = queue_sequence_number;
|
waiting_fence->queue = queue;
|
||||||
|
waiting_fence->queue_sequence_number = queue_sequence_number;
|
||||||
++worker->enqueued_fence_count;
|
++worker->enqueued_fence_count;
|
||||||
|
|
||||||
InterlockedIncrement(&fence->pending_worker_operation_count);
|
InterlockedIncrement(&fence->pending_worker_operation_count);
|
||||||
@ -337,12 +339,7 @@ static void vkd3d_fence_worker_move_enqueued_fences_locked(struct vkd3d_fence_wo
|
|||||||
struct vkd3d_enqueued_fence *current = &worker->enqueued_fences[i];
|
struct vkd3d_enqueued_fence *current = &worker->enqueued_fences[i];
|
||||||
|
|
||||||
worker->vk_fences[worker->fence_count] = current->vk_fence;
|
worker->vk_fences[worker->fence_count] = current->vk_fence;
|
||||||
|
worker->fences[worker->fence_count] = current->waiting_fence;
|
||||||
worker->fences[worker->fence_count].fence = current->fence;
|
|
||||||
worker->fences[worker->fence_count].value = current->value;
|
|
||||||
worker->fences[worker->fence_count].queue = current->queue;
|
|
||||||
worker->fences[worker->fence_count].queue_sequence_number = current->queue_sequence_number;
|
|
||||||
|
|
||||||
++worker->fence_count;
|
++worker->fence_count;
|
||||||
}
|
}
|
||||||
assert(worker->fence_count == count);
|
assert(worker->fence_count == count);
|
||||||
|
@ -152,6 +152,14 @@ HRESULT vkd3d_create_thread(struct vkd3d_instance *instance,
|
|||||||
PFN_vkd3d_thread thread_main, void *data, union vkd3d_thread_handle *thread) DECLSPEC_HIDDEN;
|
PFN_vkd3d_thread thread_main, void *data, union vkd3d_thread_handle *thread) DECLSPEC_HIDDEN;
|
||||||
HRESULT vkd3d_join_thread(struct vkd3d_instance *instance, union vkd3d_thread_handle *thread) DECLSPEC_HIDDEN;
|
HRESULT vkd3d_join_thread(struct vkd3d_instance *instance, union vkd3d_thread_handle *thread) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
struct vkd3d_waiting_fence
|
||||||
|
{
|
||||||
|
struct d3d12_fence *fence;
|
||||||
|
uint64_t value;
|
||||||
|
struct vkd3d_queue *queue;
|
||||||
|
uint64_t queue_sequence_number;
|
||||||
|
};
|
||||||
|
|
||||||
struct vkd3d_fence_worker
|
struct vkd3d_fence_worker
|
||||||
{
|
{
|
||||||
union vkd3d_thread_handle thread;
|
union vkd3d_thread_handle thread;
|
||||||
@ -165,23 +173,14 @@ struct vkd3d_fence_worker
|
|||||||
struct vkd3d_enqueued_fence
|
struct vkd3d_enqueued_fence
|
||||||
{
|
{
|
||||||
VkFence vk_fence;
|
VkFence vk_fence;
|
||||||
struct d3d12_fence *fence;
|
struct vkd3d_waiting_fence waiting_fence;
|
||||||
uint64_t value;
|
|
||||||
struct vkd3d_queue *queue;
|
|
||||||
uint64_t queue_sequence_number;
|
|
||||||
} *enqueued_fences;
|
} *enqueued_fences;
|
||||||
size_t enqueued_fences_size;
|
size_t enqueued_fences_size;
|
||||||
|
|
||||||
size_t fence_count;
|
size_t fence_count;
|
||||||
VkFence *vk_fences;
|
VkFence *vk_fences;
|
||||||
size_t vk_fences_size;
|
size_t vk_fences_size;
|
||||||
struct vkd3d_waiting_fence
|
struct vkd3d_waiting_fence *fences;
|
||||||
{
|
|
||||||
struct d3d12_fence *fence;
|
|
||||||
uint64_t value;
|
|
||||||
struct vkd3d_queue *queue;
|
|
||||||
uint64_t queue_sequence_number;
|
|
||||||
} *fences;
|
|
||||||
size_t fences_size;
|
size_t fences_size;
|
||||||
|
|
||||||
struct d3d12_device *device;
|
struct d3d12_device *device;
|
||||||
|
Loading…
Reference in New Issue
Block a user