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
e1448751
Commit
e1448751
authored
Aug 08, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Download buffer ranges through buffer ops.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ac7ca87a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
buffer.c
dlls/wined3d/buffer.c
+26
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/buffer.c
View file @
e1448751
...
...
@@ -628,9 +628,7 @@ static BOOL wined3d_buffer_prepare_location(struct wined3d_buffer *buffer,
BOOL
wined3d_buffer_load_location
(
struct
wined3d_buffer
*
buffer
,
struct
wined3d_context
*
context
,
DWORD
location
)
{
struct
wined3d_context_gl
*
context_gl
=
wined3d_context_gl
(
context
);
struct
wined3d_buffer_gl
*
buffer_gl
=
wined3d_buffer_gl
(
buffer
);
const
struct
wined3d_gl_info
*
gl_info
=
context_gl
->
gl_info
;
struct
wined3d_map_range
range
;
TRACE
(
"buffer %p, context %p, location %s.
\n
"
,
buffer
,
context
,
wined3d_debug_location
(
location
));
...
...
@@ -664,10 +662,10 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer,
switch
(
location
)
{
case
WINED3D_LOCATION_SYSMEM
:
wined3d_buffer_gl_bind
(
buffer_gl
,
context_gl
)
;
GL_EXTCALL
(
glGetBufferSubData
(
buffer_gl
->
buffer_type_hint
,
0
,
buffer
->
resource
.
size
,
buffer
->
resource
.
heap_memory
));
checkGLcall
(
"buffer download"
);
range
.
offset
=
0
;
range
.
size
=
buffer
->
resource
.
size
;
buffer
->
buffer_ops
->
buffer_download_ranges
(
buffer
,
context
,
buffer
->
resource
.
heap_memory
,
0
,
1
,
&
range
);
break
;
case
WINED3D_LOCATION_BUFFER
:
...
...
@@ -1463,9 +1461,30 @@ static void wined3d_buffer_gl_upload_ranges(struct wined3d_buffer *buffer, struc
checkGLcall
(
"buffer upload"
);
}
/* Context activation is done by the caller. */
static
void
wined3d_buffer_gl_download_ranges
(
struct
wined3d_buffer
*
buffer
,
struct
wined3d_context
*
context
,
void
*
data
,
unsigned
int
data_offset
,
unsigned
int
range_count
,
const
struct
wined3d_map_range
*
ranges
)
{
struct
wined3d_context_gl
*
context_gl
=
wined3d_context_gl
(
context
);
struct
wined3d_buffer_gl
*
buffer_gl
=
wined3d_buffer_gl
(
buffer
);
const
struct
wined3d_gl_info
*
gl_info
=
context_gl
->
gl_info
;
const
struct
wined3d_map_range
*
range
;
wined3d_buffer_gl_bind
(
buffer_gl
,
context_gl
);
while
(
range_count
--
)
{
range
=
&
ranges
[
range_count
];
GL_EXTCALL
(
glGetBufferSubData
(
buffer_gl
->
buffer_type_hint
,
range
->
offset
,
range
->
size
,
(
BYTE
*
)
data
+
range
->
offset
-
data_offset
));
}
checkGLcall
(
"buffer download"
);
}
static
const
struct
wined3d_buffer_ops
wined3d_buffer_gl_ops
=
{
wined3d_buffer_gl_upload_ranges
,
wined3d_buffer_gl_download_ranges
,
};
HRESULT
CDECL
wined3d_buffer_create
(
struct
wined3d_device
*
device
,
const
struct
wined3d_buffer_desc
*
desc
,
...
...
dlls/wined3d/wined3d_private.h
View file @
e1448751
...
...
@@ -4047,6 +4047,8 @@ struct wined3d_buffer_ops
{
void
(
*
buffer_upload_ranges
)(
struct
wined3d_buffer
*
buffer
,
struct
wined3d_context
*
context
,
const
void
*
data
,
unsigned
int
data_offset
,
unsigned
int
range_count
,
const
struct
wined3d_map_range
*
ranges
);
void
(
*
buffer_download_ranges
)(
struct
wined3d_buffer
*
buffer
,
struct
wined3d_context
*
context
,
void
*
data
,
unsigned
int
data_offset
,
unsigned
int
range_count
,
const
struct
wined3d_map_range
*
ranges
);
};
struct
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