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
ef127f12
Commit
ef127f12
authored
Oct 21, 2022
by
Anton Baskanov
Committed by
Alexandre Julliard
Nov 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Factor out and expose functions to map/unmap wined3d_streaming_buffer.
parent
e0f32f53
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
6 deletions
+31
-6
buffer.c
dlls/wined3d/buffer.c
+25
-6
wined3d.spec
dlls/wined3d/wined3d.spec
+2
-0
wined3d.h
include/wine/wined3d.h
+4
-0
No files found.
dlls/wined3d/buffer.c
View file @
ef127f12
...
@@ -1685,8 +1685,9 @@ static HRESULT wined3d_streaming_buffer_prepare(struct wined3d_device *device,
...
@@ -1685,8 +1685,9 @@ static HRESULT wined3d_streaming_buffer_prepare(struct wined3d_device *device,
return
hr
;
return
hr
;
}
}
HRESULT
CDECL
wined3d_streaming_buffer_upload
(
struct
wined3d_device
*
device
,
struct
wined3d_streaming_buffer
*
buffer
,
HRESULT
CDECL
wined3d_streaming_buffer_map
(
struct
wined3d_device
*
device
,
const
void
*
data
,
unsigned
int
size
,
unsigned
int
stride
,
unsigned
int
*
ret_pos
)
struct
wined3d_streaming_buffer
*
buffer
,
unsigned
int
size
,
unsigned
int
stride
,
unsigned
int
*
ret_pos
,
void
**
ret_data
)
{
{
unsigned
int
map_flags
=
WINED3D_MAP_WRITE
;
unsigned
int
map_flags
=
WINED3D_MAP_WRITE
;
struct
wined3d_resource
*
resource
;
struct
wined3d_resource
*
resource
;
...
@@ -1695,8 +1696,8 @@ HRESULT CDECL wined3d_streaming_buffer_upload(struct wined3d_device *device, str
...
@@ -1695,8 +1696,8 @@ HRESULT CDECL wined3d_streaming_buffer_upload(struct wined3d_device *device, str
struct
wined3d_box
box
;
struct
wined3d_box
box
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"device %p, buffer %p,
data %p, size %u, stride %u, ret_pos
%p.
\n
"
,
TRACE
(
"device %p, buffer %p,
size %u, stride %u, ret_pos %p, ret_data
%p.
\n
"
,
device
,
buffer
,
data
,
size
,
stride
,
ret_pos
);
device
,
buffer
,
size
,
stride
,
ret_pos
,
ret_data
);
if
(
FAILED
(
hr
=
wined3d_streaming_buffer_prepare
(
device
,
buffer
,
size
)))
if
(
FAILED
(
hr
=
wined3d_streaming_buffer_prepare
(
device
,
buffer
,
size
)))
return
hr
;
return
hr
;
...
@@ -1719,10 +1720,28 @@ HRESULT CDECL wined3d_streaming_buffer_upload(struct wined3d_device *device, str
...
@@ -1719,10 +1720,28 @@ HRESULT CDECL wined3d_streaming_buffer_upload(struct wined3d_device *device, str
wined3d_box_set
(
&
box
,
pos
,
0
,
pos
+
size
,
1
,
0
,
1
);
wined3d_box_set
(
&
box
,
pos
,
0
,
pos
+
size
,
1
,
0
,
1
);
if
(
SUCCEEDED
(
hr
=
wined3d_resource_map
(
resource
,
0
,
&
map_desc
,
&
box
,
map_flags
)))
if
(
SUCCEEDED
(
hr
=
wined3d_resource_map
(
resource
,
0
,
&
map_desc
,
&
box
,
map_flags
)))
{
{
memcpy
(
map_desc
.
data
,
data
,
size
);
wined3d_resource_unmap
(
resource
,
0
);
*
ret_pos
=
pos
;
*
ret_pos
=
pos
;
*
ret_data
=
map_desc
.
data
;
buffer
->
pos
=
pos
+
size
;
buffer
->
pos
=
pos
+
size
;
}
}
return
hr
;
return
hr
;
}
}
void
CDECL
wined3d_streaming_buffer_unmap
(
struct
wined3d_streaming_buffer
*
buffer
)
{
wined3d_resource_unmap
(
&
buffer
->
buffer
->
resource
,
0
);
}
HRESULT
CDECL
wined3d_streaming_buffer_upload
(
struct
wined3d_device
*
device
,
struct
wined3d_streaming_buffer
*
buffer
,
const
void
*
data
,
unsigned
int
size
,
unsigned
int
stride
,
unsigned
int
*
ret_pos
)
{
void
*
dst_data
;
HRESULT
hr
;
if
(
SUCCEEDED
(
hr
=
wined3d_streaming_buffer_map
(
device
,
buffer
,
size
,
stride
,
ret_pos
,
&
dst_data
)))
{
memcpy
(
dst_data
,
data
,
size
);
wined3d_streaming_buffer_unmap
(
buffer
);
}
return
hr
;
}
dlls/wined3d/wined3d.spec
View file @
ef127f12
...
@@ -260,6 +260,8 @@
...
@@ -260,6 +260,8 @@
@ cdecl wined3d_stateblock_set_vs_consts_f(ptr long long ptr)
@ cdecl wined3d_stateblock_set_vs_consts_f(ptr long long ptr)
@ cdecl wined3d_stateblock_set_vs_consts_i(ptr long long ptr)
@ cdecl wined3d_stateblock_set_vs_consts_i(ptr long long ptr)
@ cdecl wined3d_streaming_buffer_map(ptr ptr long long ptr ptr)
@ cdecl wined3d_streaming_buffer_unmap(ptr)
@ cdecl wined3d_streaming_buffer_upload(ptr ptr ptr long long ptr)
@ cdecl wined3d_streaming_buffer_upload(ptr ptr ptr long long ptr)
@ cdecl wined3d_swapchain_create(ptr ptr ptr ptr ptr ptr)
@ cdecl wined3d_swapchain_create(ptr ptr ptr ptr ptr ptr)
...
...
include/wine/wined3d.h
View file @
ef127f12
...
@@ -2788,6 +2788,10 @@ HRESULT __cdecl wined3d_stateblock_set_vs_consts_f(struct wined3d_stateblock *st
...
@@ -2788,6 +2788,10 @@ HRESULT __cdecl wined3d_stateblock_set_vs_consts_f(struct wined3d_stateblock *st
HRESULT
__cdecl
wined3d_stateblock_set_vs_consts_i
(
struct
wined3d_stateblock
*
stateblock
,
HRESULT
__cdecl
wined3d_stateblock_set_vs_consts_i
(
struct
wined3d_stateblock
*
stateblock
,
unsigned
int
start_idx
,
unsigned
int
count
,
const
struct
wined3d_ivec4
*
constants
);
unsigned
int
start_idx
,
unsigned
int
count
,
const
struct
wined3d_ivec4
*
constants
);
HRESULT
__cdecl
wined3d_streaming_buffer_map
(
struct
wined3d_device
*
device
,
struct
wined3d_streaming_buffer
*
buffer
,
unsigned
int
size
,
unsigned
int
stride
,
unsigned
int
*
ret_pos
,
void
**
ret_data
);
void
__cdecl
wined3d_streaming_buffer_unmap
(
struct
wined3d_streaming_buffer
*
buffer
);
HRESULT
__cdecl
wined3d_streaming_buffer_upload
(
struct
wined3d_device
*
device
,
struct
wined3d_streaming_buffer
*
buffer
,
HRESULT
__cdecl
wined3d_streaming_buffer_upload
(
struct
wined3d_device
*
device
,
struct
wined3d_streaming_buffer
*
buffer
,
const
void
*
data
,
unsigned
int
size
,
unsigned
int
stride
,
unsigned
int
*
pos
);
const
void
*
data
,
unsigned
int
size
,
unsigned
int
stride
,
unsigned
int
*
pos
);
...
...
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