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
8744ae25
Commit
8744ae25
authored
May 18, 2020
by
Henri Verbeet
Committed by
Alexandre Julliard
May 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement indirect Vulkan draws.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eccff1ad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
adapter_vk.c
dlls/wined3d/adapter_vk.c
+21
-2
context_vk.c
dlls/wined3d/context_vk.c
+4
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/adapter_vk.c
View file @
8744ae25
...
...
@@ -1521,6 +1521,7 @@ static void adapter_vk_flush_context(struct wined3d_context *context)
static
void
adapter_vk_draw_primitive
(
struct
wined3d_device
*
device
,
const
struct
wined3d_state
*
state
,
const
struct
wined3d_draw_parameters
*
parameters
)
{
struct
wined3d_buffer_vk
*
indirect_vk
=
NULL
;
const
struct
wined3d_vk_info
*
vk_info
;
struct
wined3d_context_vk
*
context_vk
;
VkCommandBuffer
vk_command_buffer
;
...
...
@@ -1531,14 +1532,32 @@ static void adapter_vk_draw_primitive(struct wined3d_device *device,
context_vk
=
wined3d_context_vk
(
context_acquire
(
device
,
NULL
,
0
));
vk_info
=
context_vk
->
vk_info
;
if
(
!
(
vk_command_buffer
=
wined3d_context_vk_apply_draw_state
(
context_vk
,
state
)))
if
(
parameters
->
indirect
)
indirect_vk
=
wined3d_buffer_vk
(
parameters
->
u
.
indirect
.
buffer
);
if
(
!
(
vk_command_buffer
=
wined3d_context_vk_apply_draw_state
(
context_vk
,
state
,
indirect_vk
)))
{
ERR
(
"Failed to apply draw state.
\n
"
);
context_release
(
&
context_vk
->
c
);
return
;
}
if
(
!
parameters
->
indirect
&&
!
parameters
->
indexed
)
if
(
parameters
->
indirect
)
{
struct
wined3d_bo_vk
*
bo
=
&
indirect_vk
->
bo
;
uint32_t
stride
,
size
;
if
(
!
parameters
->
indexed
)
{
wined3d_context_vk_reference_bo
(
context_vk
,
bo
);
size
=
indirect_vk
->
b
.
resource
.
size
-
parameters
->
u
.
indirect
.
offset
;
stride
=
sizeof
(
VkDrawIndirectCommand
);
VK_CALL
(
vkCmdDrawIndirect
(
vk_command_buffer
,
bo
->
vk_buffer
,
bo
->
buffer_offset
+
parameters
->
u
.
indirect
.
offset
,
size
/
stride
,
stride
));
}
}
else
if
(
!
parameters
->
indexed
)
{
instance_count
=
parameters
->
u
.
direct
.
instance_count
;
if
(
context_vk
->
c
.
instance_count
)
...
...
dlls/wined3d/context_vk.c
View file @
8744ae25
...
...
@@ -1887,7 +1887,7 @@ static void wined3d_context_vk_load_shader_resources(struct wined3d_context_vk *
}
VkCommandBuffer
wined3d_context_vk_apply_draw_state
(
struct
wined3d_context_vk
*
context_vk
,
const
struct
wined3d_state
*
state
)
const
struct
wined3d_state
*
state
,
struct
wined3d_buffer_vk
*
indirect_vk
)
{
struct
wined3d_device_vk
*
device_vk
=
wined3d_device_vk
(
context_vk
->
c
.
device
);
const
struct
wined3d_vk_info
*
vk_info
=
context_vk
->
vk_info
;
...
...
@@ -1950,6 +1950,9 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c
wined3d_context_vk_load_shader_resources
(
context_vk
,
state
,
WINED3D_PIPELINE_GRAPHICS
);
if
(
indirect_vk
)
wined3d_buffer_load
(
&
indirect_vk
->
b
,
&
context_vk
->
c
,
state
);
if
(
!
(
vk_command_buffer
=
wined3d_context_vk_get_command_buffer
(
context_vk
)))
{
ERR
(
"Failed to get command buffer.
\n
"
);
...
...
dlls/wined3d/wined3d_private.h
View file @
8744ae25
...
...
@@ -2412,7 +2412,7 @@ VkDeviceMemory wined3d_context_vk_allocate_vram_chunk_memory(struct wined3d_cont
VkCommandBuffer
wined3d_context_vk_apply_compute_state
(
struct
wined3d_context_vk
*
context_vk
,
const
struct
wined3d_state
*
state
,
struct
wined3d_buffer_vk
*
indirect_vk
)
DECLSPEC_HIDDEN
;
VkCommandBuffer
wined3d_context_vk_apply_draw_state
(
struct
wined3d_context_vk
*
context_vk
,
const
struct
wined3d_state
*
state
)
DECLSPEC_HIDDEN
;
const
struct
wined3d_state
*
state
,
struct
wined3d_buffer_vk
*
indirect_vk
)
DECLSPEC_HIDDEN
;
void
wined3d_context_vk_cleanup
(
struct
wined3d_context_vk
*
context_vk
)
DECLSPEC_HIDDEN
;
BOOL
wined3d_context_vk_create_bo
(
struct
wined3d_context_vk
*
context_vk
,
VkDeviceSize
size
,
VkBufferUsageFlags
usage
,
VkMemoryPropertyFlags
memory_type
,
struct
wined3d_bo_vk
*
bo
)
DECLSPEC_HIDDEN
;
...
...
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