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
b9d28851
Commit
b9d28851
authored
Sep 11, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use dynamic state for patch vertex count if possible.
parent
6f6ef6cd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
3 deletions
+23
-3
adapter_vk.c
dlls/wined3d/adapter_vk.c
+1
-0
context.c
dlls/wined3d/context.c
+1
-0
context_vk.c
dlls/wined3d/context_vk.c
+11
-1
cs.c
dlls/wined3d/cs.c
+5
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-1
wined3d_vk.h
dlls/wined3d/wined3d_vk.h
+3
-1
No files found.
dlls/wined3d/adapter_vk.c
View file @
b9d28851
...
...
@@ -2350,6 +2350,7 @@ static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter_vk *adapter_
vk_info
->
multiple_viewports
=
device_info
.
features2
.
features
.
multiViewport
;
vk_info
->
dynamic_state2
=
device_info
.
dynamic_state2_features
.
extendedDynamicState2
;
vk_info
->
dynamic_patch_vertex_count
=
device_info
.
dynamic_state2_features
.
extendedDynamicState2PatchControlPoints
;
}
static
bool
wined3d_adapter_vk_init_device_extensions
(
struct
wined3d_adapter_vk
*
adapter_vk
)
...
...
dlls/wined3d/context.c
View file @
b9d28851
...
...
@@ -115,6 +115,7 @@ void wined3d_context_init(struct wined3d_context *context, struct wined3d_swapch
|
(
1u
<<
WINED3D_SHADER_TYPE_COMPUTE
);
context
->
update_primitive_type
=
1
;
context
->
update_patch_vertex_count
=
1
;
}
HRESULT
wined3d_context_no3d_init
(
struct
wined3d_context
*
context_no3d
,
struct
wined3d_swapchain
*
swapchain
)
...
...
dlls/wined3d/context_vk.c
View file @
b9d28851
...
...
@@ -1906,6 +1906,7 @@ void wined3d_context_vk_submit_command_buffer(struct wined3d_context_vk *context
context_vk
->
c
.
update_unordered_access_view_bindings
=
1
;
context_vk
->
c
.
update_compute_unordered_access_view_bindings
=
1
;
context_vk
->
c
.
update_primitive_type
=
1
;
context_vk
->
c
.
update_patch_vertex_count
=
1
;
context_invalidate_state
(
&
context_vk
->
c
,
STATE_STREAMSRC
);
context_invalidate_state
(
&
context_vk
->
c
,
STATE_INDEXBUFFER
);
context_invalidate_state
(
&
context_vk
->
c
,
STATE_BLEND_FACTOR
);
...
...
@@ -2142,6 +2143,8 @@ static void wined3d_context_vk_init_graphics_pipeline_key(struct wined3d_context
if
(
!
(
context_vk
->
c
.
d3d_info
->
wined3d_creation_flags
&
WINED3D_NO_PRIMITIVE_RESTART
))
dynamic_states
[
dynamic_state_count
++
]
=
VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT
;
}
if
(
vk_info
->
dynamic_patch_vertex_count
)
dynamic_states
[
dynamic_state_count
++
]
=
VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT
;
key
=
&
context_vk
->
graphics
.
pipeline_key_vk
;
memset
(
key
,
0
,
sizeof
(
*
key
));
...
...
@@ -2508,7 +2511,7 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
}
}
if
(
key
->
ts_desc
.
patchControlPoints
!=
state
->
patch_vertex_count
)
if
(
!
vk_info
->
dynamic_patch_vertex_count
&&
key
->
ts_desc
.
patchControlPoints
!=
state
->
patch_vertex_count
)
{
key
->
ts_desc
.
patchControlPoints
=
state
->
patch_vertex_count
;
...
...
@@ -3868,6 +3871,13 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c
context_vk
->
c
.
update_primitive_type
=
0
;
}
if
(
vk_info
->
dynamic_patch_vertex_count
&&
context_vk
->
c
.
update_patch_vertex_count
)
{
if
(
state
->
patch_vertex_count
)
VK_CALL
(
vkCmdSetPatchControlPointsEXT
(
vk_command_buffer
,
state
->
patch_vertex_count
));
context_vk
->
c
.
update_patch_vertex_count
=
0
;
}
if
(
vk_info
->
supported
[
WINED3D_VK_EXT_EXTENDED_DYNAMIC_STATE
]
&&
(
wined3d_context_is_graphics_state_dirty
(
&
context_vk
->
c
,
STATE_DEPTH_STENCIL
)
||
wined3d_context_is_graphics_state_dirty
(
&
context_vk
->
c
,
STATE_FRAMEBUFFER
)))
...
...
dlls/wined3d/cs.c
View file @
b9d28851
...
...
@@ -1047,6 +1047,11 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
for
(
i
=
0
;
i
<
device
->
context_count
;
++
i
)
device
->
contexts
[
i
]
->
update_primitive_type
=
1
;
}
if
(
state
->
patch_vertex_count
!=
op
->
patch_vertex_count
)
{
for
(
i
=
0
;
i
<
device
->
context_count
;
++
i
)
device
->
contexts
[
i
]
->
update_patch_vertex_count
=
1
;
}
state
->
patch_vertex_count
=
op
->
patch_vertex_count
;
cs
->
c
.
device
->
adapter
->
adapter_ops
->
adapter_draw_primitive
(
cs
->
c
.
device
,
state
,
&
op
->
parameters
);
...
...
dlls/wined3d/wined3d_private.h
View file @
b9d28851
...
...
@@ -1968,7 +1968,8 @@ struct wined3d_context
DWORD
destroy_delayed
:
1
;
DWORD
namedArraysLoaded
:
1
;
DWORD
update_primitive_type
:
1
;
DWORD
padding
:
4
;
DWORD
update_patch_vertex_count
:
1
;
DWORD
padding
:
3
;
DWORD
clip_distance_mask
:
8
;
/* WINED3D_MAX_CLIP_DISTANCES, 8 */
...
...
dlls/wined3d/wined3d_vk.h
View file @
b9d28851
...
...
@@ -187,6 +187,7 @@ struct wined3d_device_vk;
VK_DEVICE_EXT_PFN(vkCmdSetStencilOpEXT) \
VK_DEVICE_EXT_PFN(vkCmdSetStencilTestEnableEXT) \
/* VK_EXT_extended_dynamic_state2 */
\
VK_DEVICE_EXT_PFN(vkCmdSetPatchControlPointsEXT) \
VK_DEVICE_EXT_PFN(vkCmdSetPrimitiveRestartEnableEXT) \
/* VK_EXT_transform_feedback */
\
VK_DEVICE_EXT_PFN(vkCmdBeginQueryIndexedEXT) \
...
...
@@ -247,6 +248,7 @@ struct wined3d_vk_info
bool
multiple_viewports
;
bool
dynamic_state2
;
bool
dynamic_patch_vertex_count
;
};
#define VK_CALL(f) (vk_info->vk_ops.f)
...
...
@@ -569,7 +571,7 @@ struct wined3d_context_vk
const
struct
wined3d_vk_info
*
vk_info
;
VkDynamicState
dynamic_states
[
1
3
];
VkDynamicState
dynamic_states
[
1
4
];
uint32_t
update_compute_pipeline
:
1
;
uint32_t
update_stream_output
:
1
;
...
...
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