Henri Verbeet : wined3d: Avoid referencing empty command buffers in wined3d_query_event_vk_issue().
Alexandre Julliard
julliard at winehq.org
Tue Dec 15 16:21:02 CST 2020
Module: wine
Branch: master
Commit: 619c87bb59dbad74c51db2d3e490113c0e9c03ed
URL: https://source.winehq.org/git/wine.git/?a=commit;h=619c87bb59dbad74c51db2d3e490113c0e9c03ed
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Tue Dec 15 17:02:21 2020 +0330
wined3d: Avoid referencing empty command buffers in wined3d_query_event_vk_issue().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/query.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 9e0e22b32e5..4670bbfddff 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -1720,6 +1720,14 @@ static BOOL wined3d_query_event_vk_issue(struct wined3d_query *query, uint32_t f
{
context_vk = wined3d_context_vk(context_acquire(&device_vk->d, NULL, 0));
wined3d_context_vk_reference_query(context_vk, query_vk);
+ /* Because we don't actually submit any commands to the command buffer
+ * for event queries, the context's current command buffer may still
+ * be empty, and we should wait on the preceding command buffer
+ * instead. That's not merely an optimisation; if the command buffer
+ * referenced by the query is still empty by the time the application
+ * waits for it, that wait will never complete. */
+ if (!context_vk->current_command_buffer.vk_command_buffer)
+ --query_vk->command_buffer_id;
context_release(&context_vk->c);
return TRUE;
More information about the wine-cvs
mailing list