Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
23a16426
Commit
23a16426
authored
Jul 02, 2023
by
Giovanni Mascellani
Committed by
Alexandre Julliard
Jul 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Acquire and release the Vulkan queue inside d3d12_swapchain_queue_present().
parent
3dad51fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
swapchain.c
dlls/dxgi/swapchain.c
+9
-12
No files found.
dlls/dxgi/swapchain.c
View file @
23a16426
...
...
@@ -2068,13 +2068,14 @@ static HRESULT d3d12_swapchain_set_sync_interval(struct d3d12_swapchain *swapcha
return
d3d12_swapchain_create_vulkan_resources
(
swapchain
);
}
static
VkResult
d3d12_swapchain_queue_present
(
struct
d3d12_swapchain
*
swapchain
,
Vk
Queue
vk_queue
,
Vk
Image
vk_src_image
)
static
VkResult
d3d12_swapchain_queue_present
(
struct
d3d12_swapchain
*
swapchain
,
VkImage
vk_src_image
)
{
const
struct
dxgi_vk_funcs
*
vk_funcs
=
&
swapchain
->
vk_funcs
;
VkPresentInfoKHR
present_info
;
VkCommandBuffer
vk_cmd_buffer
;
VkSubmitInfo
submit_info
;
VkImage
vk_dst_image
;
VkQueue
vk_queue
;
VkResult
vr
;
if
(
swapchain
->
vk_image_index
==
INVALID_VK_IMAGE_INDEX
)
...
...
@@ -2098,6 +2099,8 @@ static VkResult d3d12_swapchain_queue_present(struct d3d12_swapchain *swapchain,
vk_cmd_buffer
,
vk_dst_image
,
vk_src_image
))
<
0
)
return
vr
;
vk_queue
=
vkd3d_acquire_vk_queue
(
swapchain
->
command_queue
);
submit_info
.
sType
=
VK_STRUCTURE_TYPE_SUBMIT_INFO
;
submit_info
.
pNext
=
NULL
;
submit_info
.
waitSemaphoreCount
=
0
;
...
...
@@ -2111,6 +2114,7 @@ static VkResult d3d12_swapchain_queue_present(struct d3d12_swapchain *swapchain,
if
((
vr
=
vk_funcs
->
p_vkQueueSubmit
(
vk_queue
,
1
,
&
submit_info
,
VK_NULL_HANDLE
))
<
0
)
{
ERR
(
"Failed to blit swapchain buffer, vr %d.
\n
"
,
vr
);
vkd3d_release_vk_queue
(
swapchain
->
command_queue
);
return
vr
;
}
...
...
@@ -2128,39 +2132,32 @@ static VkResult d3d12_swapchain_queue_present(struct d3d12_swapchain *swapchain,
if
((
vr
=
vk_funcs
->
p_vkQueuePresentKHR
(
vk_queue
,
&
present_info
))
>=
0
)
swapchain
->
vk_image_index
=
INVALID_VK_IMAGE_INDEX
;
vkd3d_release_vk_queue
(
swapchain
->
command_queue
);
return
vr
;
}
static
HRESULT
d3d12_swapchain_op_present_execute
(
struct
d3d12_swapchain
*
swapchain
,
struct
d3d12_swapchain_op
*
op
)
{
VkQueue
vk_queue
;
VkResult
vr
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
d3d12_swapchain_set_sync_interval
(
swapchain
,
op
->
present
.
sync_interval
)))
return
hr
;
vk_queue
=
vkd3d_acquire_vk_queue
(
swapchain
->
command_queue
);
vr
=
d3d12_swapchain_queue_present
(
swapchain
,
vk_queue
,
op
->
present
.
vk_image
);
vr
=
d3d12_swapchain_queue_present
(
swapchain
,
op
->
present
.
vk_image
);
if
(
vr
==
VK_ERROR_OUT_OF_DATE_KHR
)
{
vkd3d_release_vk_queue
(
swapchain
->
command_queue
);
TRACE
(
"Recreating Vulkan swapchain.
\n
"
);
d3d12_swapchain_destroy_vulkan_resources
(
swapchain
);
if
(
FAILED
(
hr
=
d3d12_swapchain_create_vulkan_resources
(
swapchain
)))
return
hr
;
vk_queue
=
vkd3d_acquire_vk_queue
(
swapchain
->
command_queue
);
if
((
vr
=
d3d12_swapchain_queue_present
(
swapchain
,
vk_queue
,
op
->
present
.
vk_image
))
<
0
)
if
((
vr
=
d3d12_swapchain_queue_present
(
swapchain
,
op
->
present
.
vk_image
))
<
0
)
ERR
(
"Failed to present after recreating swapchain, vr %d.
\n
"
,
vr
);
}
vkd3d_release_vk_queue
(
swapchain
->
command_queue
);
if
(
vr
<
0
)
{
ERR
(
"Failed to queue present, vr %d.
\n
"
,
vr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment