mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
dzn: Use the vk_sync_binary abstraction
D3D12 fences are capable of handling binary operations, but the current dzn_sync implementation doesn't match vk_sync expectations when sync objects are used to back semaphores. In that case, the wait operation is supposed to set the sync object back to an unsignaled state after the wait succeeded, but there's no way of knowing what the sync object is used for, and this implicit-reset behavior is not expected on fence objects, which also use the sync primitive. That means we currently have a semaphore implementation that works only once, and, as soon as the semaphore object has been signaled it stays in a signaled state until it's destroyed. We could extend the sync framework to pass an implicit-reset-after-wait flag, but, given no one else seems to need that, it's probably simpler to drop the binary sync capability and rely on the binary-on-top-of-timeline emulation provided by the core. Fixes:a012b21964("microsoft: Initial vulkan-on-12 driver") Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16629> (cherry picked from commit1eaba553e2)
This commit is contained in:
parent
a15759a568
commit
8d54a44028
4 changed files with 9 additions and 6 deletions
|
|
@ -139,7 +139,7 @@
|
|||
"description": "dzn: Use the vk_sync_binary abstraction",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "a012b219640e875aa552b37dfdaf69336d5863c7"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -185,6 +185,8 @@ dzn_instance_create(const VkInstanceCreateInfo *pCreateInfo,
|
|||
if (instance->debug_flags & DZN_DEBUG_GBV)
|
||||
d3d12_enable_gpu_validation();
|
||||
|
||||
instance->sync_binary_type = vk_sync_binary_get_type(&dzn_sync_type);
|
||||
|
||||
*out = dzn_instance_to_handle(instance);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
@ -258,6 +260,7 @@ dzn_physical_device_create(dzn_instance *instance,
|
|||
|
||||
uint32_t num_sync_types = 0;
|
||||
pdev->sync_types[num_sync_types++] = &dzn_sync_type;
|
||||
pdev->sync_types[num_sync_types++] = &instance->sync_binary_type.sync;
|
||||
pdev->sync_types[num_sync_types++] = &vk_sync_dummy_type;
|
||||
pdev->sync_types[num_sync_types] = NULL;
|
||||
assert(num_sync_types <= MAX_SYNC_TYPES);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "vk_log.h"
|
||||
#include "vk_physical_device.h"
|
||||
#include "vk_sync.h"
|
||||
#include "vk_sync_binary.h"
|
||||
#include "vk_queue.h"
|
||||
#include "vk_shader_module.h"
|
||||
#include "wsi_common.h"
|
||||
|
|
@ -159,7 +160,7 @@ struct dzn_meta_blits {
|
|||
const dzn_meta_blit *
|
||||
dzn_meta_blits_get_context(dzn_device *device, const dzn_meta_blit_key *key);
|
||||
|
||||
#define MAX_SYNC_TYPES 2
|
||||
#define MAX_SYNC_TYPES 3
|
||||
#define MAX_QUEUE_FAMILIES 3
|
||||
|
||||
struct dzn_physical_device {
|
||||
|
|
@ -947,6 +948,8 @@ struct dzn_instance {
|
|||
bool physical_devices_enumerated;
|
||||
uint32_t debug_flags;
|
||||
|
||||
struct vk_sync_binary_type sync_binary_type;
|
||||
|
||||
struct list_head physical_devices;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -183,12 +183,9 @@ dzn_sync_wait(struct vk_device *device,
|
|||
const struct vk_sync_type dzn_sync_type = {
|
||||
.size = sizeof(dzn_sync),
|
||||
.features = (enum vk_sync_features)
|
||||
(VK_SYNC_FEATURE_BINARY |
|
||||
VK_SYNC_FEATURE_TIMELINE |
|
||||
(VK_SYNC_FEATURE_TIMELINE |
|
||||
VK_SYNC_FEATURE_GPU_WAIT |
|
||||
VK_SYNC_FEATURE_GPU_MULTI_WAIT |
|
||||
VK_SYNC_FEATURE_CPU_WAIT |
|
||||
VK_SYNC_FEATURE_CPU_RESET |
|
||||
VK_SYNC_FEATURE_CPU_SIGNAL |
|
||||
VK_SYNC_FEATURE_WAIT_ANY |
|
||||
VK_SYNC_FEATURE_WAIT_BEFORE_SIGNAL),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue