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
de716491
Commit
de716491
authored
Jun 26, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Separate a wined3d_context_vk_load_buffers() helper.
Mostly just because wined3d_context_vk_apply_draw_state() is large and it's nice to split it up a bit.
parent
b2f13103
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
44 deletions
+54
-44
context_vk.c
dlls/wined3d/context_vk.c
+54
-44
No files found.
dlls/wined3d/context_vk.c
View file @
de716491
...
...
@@ -3388,6 +3388,59 @@ static VkPipeline wined3d_context_vk_get_graphics_pipeline(struct wined3d_contex
return
pipeline_vk
->
vk_pipeline
;
}
static
void
wined3d_context_vk_load_buffers
(
struct
wined3d_context_vk
*
context_vk
,
const
struct
wined3d_state
*
state
,
struct
wined3d_buffer_vk
*
indirect_vk
,
bool
indexed
)
{
const
struct
wined3d_vk_info
*
vk_info
=
context_vk
->
vk_info
;
struct
wined3d_buffer_vk
*
buffer_vk
;
struct
wined3d_buffer
*
buffer
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
state
->
streams
);
++
i
)
{
if
(
!
(
buffer
=
state
->
streams
[
i
].
buffer
))
continue
;
buffer_vk
=
wined3d_buffer_vk
(
buffer
);
wined3d_buffer_load
(
&
buffer_vk
->
b
,
&
context_vk
->
c
,
state
);
wined3d_buffer_vk_barrier
(
buffer_vk
,
context_vk
,
WINED3D_BIND_VERTEX_BUFFER
);
if
(
!
buffer_vk
->
b
.
bo_user
.
valid
)
context_invalidate_state
(
&
context_vk
->
c
,
STATE_STREAMSRC
);
}
if
(
use_transform_feedback
(
state
)
&&
vk_info
->
supported
[
WINED3D_VK_EXT_TRANSFORM_FEEDBACK
])
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
state
->
stream_output
);
++
i
)
{
if
(
!
(
buffer
=
state
->
stream_output
[
i
].
buffer
))
continue
;
buffer_vk
=
wined3d_buffer_vk
(
buffer
);
wined3d_buffer_load
(
&
buffer_vk
->
b
,
&
context_vk
->
c
,
state
);
wined3d_buffer_vk_barrier
(
buffer_vk
,
context_vk
,
WINED3D_BIND_STREAM_OUTPUT
);
wined3d_buffer_invalidate_location
(
&
buffer_vk
->
b
,
~
WINED3D_LOCATION_BUFFER
);
if
(
!
buffer_vk
->
b
.
bo_user
.
valid
)
context_vk
->
update_stream_output
=
1
;
}
context_vk
->
c
.
transform_feedback_active
=
1
;
}
if
(
indexed
||
(
wined3d_context_is_graphics_state_dirty
(
&
context_vk
->
c
,
STATE_INDEXBUFFER
)
&&
state
->
index_buffer
))
{
buffer_vk
=
wined3d_buffer_vk
(
state
->
index_buffer
);
wined3d_buffer_load
(
&
buffer_vk
->
b
,
&
context_vk
->
c
,
state
);
wined3d_buffer_vk_barrier
(
buffer_vk
,
context_vk
,
WINED3D_BIND_INDEX_BUFFER
);
if
(
!
buffer_vk
->
b
.
bo_user
.
valid
)
context_invalidate_state
(
&
context_vk
->
c
,
STATE_INDEXBUFFER
);
}
if
(
indirect_vk
)
{
wined3d_buffer_load
(
&
indirect_vk
->
b
,
&
context_vk
->
c
,
state
);
wined3d_buffer_vk_barrier
(
indirect_vk
,
context_vk
,
WINED3D_BIND_INDIRECT_BUFFER
);
}
}
static
void
wined3d_context_vk_load_shader_resources
(
struct
wined3d_context_vk
*
context_vk
,
const
struct
wined3d_state
*
state
,
enum
wined3d_pipeline
pipeline
)
{
...
...
@@ -3520,7 +3573,6 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c
VkSampleCountFlagBits
sample_count
;
VkCommandBuffer
vk_command_buffer
;
unsigned
int
i
,
invalidate_rt
=
0
;
struct
wined3d_buffer
*
buffer
;
uint32_t
null_buffer_binding
;
bool
invalidate_ds
=
false
;
...
...
@@ -3608,49 +3660,7 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c
wined3d_context_vk_load_shader_resources
(
context_vk
,
state
,
WINED3D_PIPELINE_GRAPHICS
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
state
->
streams
);
++
i
)
{
if
(
!
(
buffer
=
state
->
streams
[
i
].
buffer
))
continue
;
buffer_vk
=
wined3d_buffer_vk
(
buffer
);
wined3d_buffer_load
(
&
buffer_vk
->
b
,
&
context_vk
->
c
,
state
);
wined3d_buffer_vk_barrier
(
buffer_vk
,
context_vk
,
WINED3D_BIND_VERTEX_BUFFER
);
if
(
!
buffer_vk
->
b
.
bo_user
.
valid
)
context_invalidate_state
(
&
context_vk
->
c
,
STATE_STREAMSRC
);
}
if
(
use_transform_feedback
(
state
)
&&
vk_info
->
supported
[
WINED3D_VK_EXT_TRANSFORM_FEEDBACK
])
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
state
->
stream_output
);
++
i
)
{
if
(
!
(
buffer
=
state
->
stream_output
[
i
].
buffer
))
continue
;
buffer_vk
=
wined3d_buffer_vk
(
buffer
);
wined3d_buffer_load
(
&
buffer_vk
->
b
,
&
context_vk
->
c
,
state
);
wined3d_buffer_vk_barrier
(
buffer_vk
,
context_vk
,
WINED3D_BIND_STREAM_OUTPUT
);
wined3d_buffer_invalidate_location
(
&
buffer_vk
->
b
,
~
WINED3D_LOCATION_BUFFER
);
if
(
!
buffer_vk
->
b
.
bo_user
.
valid
)
context_vk
->
update_stream_output
=
1
;
}
context_vk
->
c
.
transform_feedback_active
=
1
;
}
if
(
indexed
||
(
wined3d_context_is_graphics_state_dirty
(
&
context_vk
->
c
,
STATE_INDEXBUFFER
)
&&
state
->
index_buffer
))
{
buffer_vk
=
wined3d_buffer_vk
(
state
->
index_buffer
);
wined3d_buffer_load
(
&
buffer_vk
->
b
,
&
context_vk
->
c
,
state
);
wined3d_buffer_vk_barrier
(
buffer_vk
,
context_vk
,
WINED3D_BIND_INDEX_BUFFER
);
if
(
!
buffer_vk
->
b
.
bo_user
.
valid
)
context_invalidate_state
(
&
context_vk
->
c
,
STATE_INDEXBUFFER
);
}
if
(
indirect_vk
)
{
wined3d_buffer_load
(
&
indirect_vk
->
b
,
&
context_vk
->
c
,
state
);
wined3d_buffer_vk_barrier
(
indirect_vk
,
context_vk
,
WINED3D_BIND_INDIRECT_BUFFER
);
}
wined3d_context_vk_load_buffers
(
context_vk
,
state
,
indirect_vk
,
indexed
);
if
(
!
(
vk_command_buffer
=
wined3d_context_vk_get_command_buffer
(
context_vk
)))
{
...
...
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