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
498f0f11
Commit
498f0f11
authored
Jan 13, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
May 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use system memory for version 4 vertex buffers.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=44863
parent
cb723c6d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
device.c
dlls/ddraw/device.c
+2
-2
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+14
-1
No files found.
dlls/ddraw/ddraw_private.h
View file @
498f0f11
...
...
@@ -595,6 +595,7 @@ struct d3d_vertex_buffer
DWORD
size
;
BOOL
dynamic
;
bool
discarded
;
bool
sysmem
;
};
HRESULT
d3d_vertex_buffer_create
(
struct
d3d_vertex_buffer
**
buffer
,
struct
ddraw
*
ddraw
,
...
...
dlls/ddraw/device.c
View file @
498f0f11
...
...
@@ -4128,7 +4128,7 @@ static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVE
stride
=
get_flexible_vertex_size
(
vb_impl
->
fvf
);
if
(
vb_impl
->
Caps
&
D3DVBCAPS_SYSTEMMEMORY
)
if
(
vb_impl
->
sysmem
)
{
TRACE
(
"Drawing from D3DVBCAPS_SYSTEMMEMORY vertex buffer, forwarding to DrawPrimitive().
\n
"
);
wined3d_mutex_lock
();
...
...
@@ -4246,7 +4246,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
vb_impl
->
discarded
=
false
;
if
(
vb_impl
->
Caps
&
D3DVBCAPS_SYSTEMMEMORY
)
if
(
vb_impl
->
sysmem
)
{
TRACE
(
"Drawing from D3DVBCAPS_SYSTEMMEMORY vertex buffer, forwarding to DrawIndexedPrimitive().
\n
"
);
wined3d_mutex_lock
();
...
...
dlls/ddraw/vertexbuffer.c
View file @
498f0f11
...
...
@@ -120,7 +120,7 @@ static HRESULT d3d_vertex_buffer_create_wined3d_buffer(struct d3d_vertex_buffer
if
(
dynamic
)
desc
.
usage
|=
WINED3DUSAGE_DYNAMIC
;
desc
.
bind_flags
=
WINED3D_BIND_VERTEX_BUFFER
;
if
(
buffer
->
Caps
&
D3DVBCAPS_SYSTEMMEMORY
)
if
(
buffer
->
sysmem
)
desc
.
access
=
WINED3D_RESOURCE_ACCESS_CPU
|
WINED3D_RESOURCE_ACCESS_MAP_R
|
WINED3D_RESOURCE_ACCESS_MAP_W
;
else
desc
.
access
=
WINED3D_RESOURCE_ACCESS_GPU
|
WINED3D_RESOURCE_ACCESS_MAP_R
|
WINED3D_RESOURCE_ACCESS_MAP_W
;
...
...
@@ -466,6 +466,19 @@ HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **vertex_buf,
buffer
->
fvf
=
desc
->
dwFVF
;
buffer
->
size
=
get_flexible_vertex_size
(
desc
->
dwFVF
)
*
desc
->
dwNumVertices
;
/* ddraw4 vertex buffers ignore DISCARD and NOOVERWRITE, even on
* pretransformed geometry, which means that a GPU-based buffer cannot
* perform well.
*
* While at least one contemporaneous card (Geforce 4) does seem to show a
* difference in its performance characteristics based on whether
* D3DVBCAPS_SYSTEMMEMORY is set, it also doesn't *improve* performance to
* use a non-SYSTEMMEMORY buffer with ddraw4. For wined3d it should always
* be better to use sysmem.
*
* This improves performance in Prince of Persia 3D. */
buffer
->
sysmem
=
((
buffer
->
Caps
&
D3DVBCAPS_SYSTEMMEMORY
)
||
buffer
->
version
<
7
);
wined3d_mutex_lock
();
if
(
FAILED
(
hr
=
d3d_vertex_buffer_create_wined3d_buffer
(
buffer
,
FALSE
,
&
buffer
->
wined3d_buffer
)))
...
...
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