Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6cb23836
Commit
6cb23836
authored
Apr 19, 2023
by
Giovanni Mascellani
Committed by
Alexandre Julliard
Jun 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Factor out d3d12_swapchain_create_image_resources().
parent
237062d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
33 deletions
+40
-33
swapchain.c
dlls/dxgi/swapchain.c
+40
-33
No files found.
dlls/dxgi/swapchain.c
View file @
6cb23836
...
@@ -1513,45 +1513,13 @@ static HRESULT d3d12_swapchain_create_command_buffers(struct d3d12_swapchain *sw
...
@@ -1513,45 +1513,13 @@ static HRESULT d3d12_swapchain_create_command_buffers(struct d3d12_swapchain *sw
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
d3d12_swapchain_create_
buffer
s
(
struct
d3d12_swapchain
*
swapchain
)
static
HRESULT
d3d12_swapchain_create_
image_resource
s
(
struct
d3d12_swapchain
*
swapchain
)
{
{
const
struct
dxgi_vk_funcs
*
vk_funcs
=
&
swapchain
->
vk_funcs
;
struct
vkd3d_image_resource_create_info
resource_info
;
struct
vkd3d_image_resource_create_info
resource_info
;
VkSwapchainKHR
vk_swapchain
=
swapchain
->
vk_swapchain
;
ID3D12CommandQueue
*
queue
=
swapchain
->
command_queue
;
VkDevice
vk_device
=
swapchain
->
vk_device
;
ID3D12Device
*
device
=
swapchain
->
device
;
ID3D12Device
*
device
=
swapchain
->
device
;
uint32_t
image_count
,
queue_family_index
;
unsigned
int
i
;
unsigned
int
i
;
VkResult
vr
;
HRESULT
hr
;
HRESULT
hr
;
if
((
vr
=
vk_funcs
->
p_vkGetSwapchainImagesKHR
(
vk_device
,
vk_swapchain
,
&
image_count
,
NULL
))
<
0
)
{
WARN
(
"Failed to get Vulkan swapchain images, vr %d.
\n
"
,
vr
);
return
hresult_from_vk_result
(
vr
);
}
if
(
image_count
>
ARRAY_SIZE
(
swapchain
->
vk_swapchain_images
))
{
FIXME
(
"Unsupported Vulkan swapchain image count %u.
\n
"
,
image_count
);
return
E_FAIL
;
}
swapchain
->
buffer_count
=
image_count
;
if
((
vr
=
vk_funcs
->
p_vkGetSwapchainImagesKHR
(
vk_device
,
vk_swapchain
,
&
image_count
,
swapchain
->
vk_swapchain_images
))
<
0
)
{
WARN
(
"Failed to get Vulkan swapchain images, vr %d.
\n
"
,
vr
);
return
hresult_from_vk_result
(
vr
);
}
queue_family_index
=
vkd3d_get_vk_queue_family_index
(
queue
);
if
(
FAILED
(
hr
=
d3d12_swapchain_create_user_buffers
(
swapchain
)))
return
hr
;
if
(
FAILED
(
hr
=
d3d12_swapchain_create_command_buffers
(
swapchain
,
queue_family_index
)))
return
hr
;
if
(
swapchain
->
buffers
[
0
])
if
(
swapchain
->
buffers
[
0
])
return
S_OK
;
return
S_OK
;
...
@@ -1588,6 +1556,45 @@ static HRESULT d3d12_swapchain_create_buffers(struct d3d12_swapchain *swapchain)
...
@@ -1588,6 +1556,45 @@ static HRESULT d3d12_swapchain_create_buffers(struct d3d12_swapchain *swapchain)
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
d3d12_swapchain_create_buffers
(
struct
d3d12_swapchain
*
swapchain
)
{
const
struct
dxgi_vk_funcs
*
vk_funcs
=
&
swapchain
->
vk_funcs
;
VkSwapchainKHR
vk_swapchain
=
swapchain
->
vk_swapchain
;
ID3D12CommandQueue
*
queue
=
swapchain
->
command_queue
;
VkDevice
vk_device
=
swapchain
->
vk_device
;
uint32_t
image_count
,
queue_family_index
;
VkResult
vr
;
HRESULT
hr
;
if
((
vr
=
vk_funcs
->
p_vkGetSwapchainImagesKHR
(
vk_device
,
vk_swapchain
,
&
image_count
,
NULL
))
<
0
)
{
WARN
(
"Failed to get Vulkan swapchain images, vr %d.
\n
"
,
vr
);
return
hresult_from_vk_result
(
vr
);
}
if
(
image_count
>
ARRAY_SIZE
(
swapchain
->
vk_swapchain_images
))
{
FIXME
(
"Unsupported Vulkan swapchain image count %u.
\n
"
,
image_count
);
return
E_FAIL
;
}
swapchain
->
buffer_count
=
image_count
;
if
((
vr
=
vk_funcs
->
p_vkGetSwapchainImagesKHR
(
vk_device
,
vk_swapchain
,
&
image_count
,
swapchain
->
vk_swapchain_images
))
<
0
)
{
WARN
(
"Failed to get Vulkan swapchain images, vr %d.
\n
"
,
vr
);
return
hresult_from_vk_result
(
vr
);
}
queue_family_index
=
vkd3d_get_vk_queue_family_index
(
queue
);
if
(
FAILED
(
hr
=
d3d12_swapchain_create_user_buffers
(
swapchain
)))
return
hr
;
if
(
FAILED
(
hr
=
d3d12_swapchain_create_command_buffers
(
swapchain
,
queue_family_index
)))
return
hr
;
return
d3d12_swapchain_create_image_resources
(
swapchain
);
}
static
VkResult
d3d12_swapchain_acquire_next_vulkan_image
(
struct
d3d12_swapchain
*
swapchain
)
static
VkResult
d3d12_swapchain_acquire_next_vulkan_image
(
struct
d3d12_swapchain
*
swapchain
)
{
{
const
struct
dxgi_vk_funcs
*
vk_funcs
=
&
swapchain
->
vk_funcs
;
const
struct
dxgi_vk_funcs
*
vk_funcs
=
&
swapchain
->
vk_funcs
;
...
...
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