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
5505e1ae
Commit
5505e1ae
authored
Sep 01, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Use resource mapping functions in d3d9_device_DrawPrimitiveUP().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
76ddf58c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
device.c
dlls/d3d9/device.c
+10
-6
No files found.
dlls/d3d9/device.c
View file @
5505e1ae
...
...
@@ -2362,9 +2362,11 @@ static HRESULT WINAPI d3d9_device_DrawPrimitiveUP(IDirect3DDevice9Ex *iface,
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
HRESULT
hr
;
UINT
vtx_count
=
vertex_count_from_primitive_count
(
primitive_type
,
primitive_count
);
struct
wined3d_map_desc
wined3d_map_desc
;
struct
wined3d_box
wined3d_box
=
{
0
};
UINT
size
=
vtx_count
*
stride
;
struct
wined3d_resource
*
vb
;
UINT
vb_pos
,
align
;
BYTE
*
buffer_data
;
TRACE
(
"iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.
\n
"
,
iface
,
primitive_type
,
primitive_count
,
data
,
stride
);
...
...
@@ -2396,12 +2398,14 @@ static HRESULT WINAPI d3d9_device_DrawPrimitiveUP(IDirect3DDevice9Ex *iface,
else
vb_pos
+=
align
;
hr
=
wined3d_buffer_map
(
device
->
vertex_buffer
,
vb_pos
,
size
,
&
buffer_data
,
vb_pos
?
WINED3D_MAP_NOOVERWRITE
:
WINED3D_MAP_DISCARD
);
if
(
FAILED
(
hr
))
wined3d_box
.
left
=
vb_pos
;
wined3d_box
.
right
=
vb_pos
+
size
;
vb
=
wined3d_buffer_get_resource
(
device
->
vertex_buffer
);
if
(
FAILED
(
hr
=
wined3d_resource_map
(
vb
,
0
,
&
wined3d_map_desc
,
&
wined3d_box
,
vb_pos
?
WINED3D_MAP_NOOVERWRITE
:
WINED3D_MAP_DISCARD
)))
goto
done
;
memcpy
(
buffer_
data
,
data
,
size
);
wined3d_
buffer_unmap
(
device
->
vertex_buffer
);
memcpy
(
wined3d_map_desc
.
data
,
data
,
size
);
wined3d_
resource_unmap
(
vb
,
0
);
device
->
vertex_buffer_pos
=
vb_pos
+
size
;
hr
=
wined3d_device_set_stream_source
(
device
->
wined3d_device
,
0
,
device
->
vertex_buffer
,
0
,
stride
);
...
...
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