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
422fa496
Commit
422fa496
authored
Sep 24, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Make the adapter responsible for copying between buffer objects.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f2c668e7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
3 deletions
+61
-3
adapter_gl.c
dlls/wined3d/adapter_gl.c
+15
-0
adapter_vk.c
dlls/wined3d/adapter_vk.c
+19
-0
buffer.c
dlls/wined3d/buffer.c
+2
-3
directx.c
dlls/wined3d/directx.c
+14
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+11
-0
No files found.
dlls/wined3d/adapter_gl.c
View file @
422fa496
...
...
@@ -4611,6 +4611,20 @@ static void adapter_gl_unmap_bo_address(struct wined3d_context *context, const s
wined3d_context_gl_unmap_bo_address
(
context_gl
,
data
,
binding
,
range_count
,
ranges
);
}
static
void
adapter_gl_copy_bo_address
(
struct
wined3d_context
*
context
,
const
struct
wined3d_bo_address
*
dst
,
uint32_t
dst_bind_flags
,
const
struct
wined3d_bo_address
*
src
,
uint32_t
src_bind_flags
,
size_t
size
)
{
struct
wined3d_context_gl
*
context_gl
;
GLenum
dst_binding
,
src_binding
;
context_gl
=
wined3d_context_gl
(
context
);
dst_binding
=
wined3d_buffer_gl_binding_from_bind_flags
(
context_gl
->
gl_info
,
dst_bind_flags
);
src_binding
=
wined3d_buffer_gl_binding_from_bind_flags
(
context_gl
->
gl_info
,
src_bind_flags
);
wined3d_context_gl_copy_bo_address
(
context_gl
,
dst
,
dst_binding
,
src
,
src_binding
,
size
);
}
static
HRESULT
adapter_gl_create_swapchain
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
desc
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_swapchain
**
swapchain
)
{
...
...
@@ -5095,6 +5109,7 @@ static const struct wined3d_adapter_ops wined3d_adapter_gl_ops =
adapter_gl_uninit_3d
,
adapter_gl_map_bo_address
,
adapter_gl_unmap_bo_address
,
adapter_gl_copy_bo_address
,
adapter_gl_create_swapchain
,
adapter_gl_destroy_swapchain
,
adapter_gl_create_buffer
,
...
...
dlls/wined3d/adapter_vk.c
View file @
422fa496
...
...
@@ -490,6 +490,24 @@ static void adapter_vk_unmap_bo_address(struct wined3d_context *context, const s
ERR
(
"Unsupported buffer object %#lx.
\n
"
,
data
->
buffer_object
);
}
static
void
adapter_vk_copy_bo_address
(
struct
wined3d_context
*
context
,
const
struct
wined3d_bo_address
*
dst
,
uint32_t
dst_bind_flags
,
const
struct
wined3d_bo_address
*
src
,
uint32_t
src_bind_flags
,
size_t
size
)
{
struct
wined3d_map_range
range
;
void
*
dst_ptr
,
*
src_ptr
;
src_ptr
=
adapter_vk_map_bo_address
(
context
,
src
,
size
,
src_bind_flags
,
WINED3D_MAP_READ
);
dst_ptr
=
adapter_vk_map_bo_address
(
context
,
dst
,
size
,
dst_bind_flags
,
WINED3D_MAP_WRITE
);
memcpy
(
dst_ptr
,
src_ptr
,
size
);
range
.
offset
=
0
;
range
.
size
=
size
;
adapter_vk_unmap_bo_address
(
context
,
dst
,
dst_bind_flags
,
1
,
&
range
);
adapter_vk_unmap_bo_address
(
context
,
src
,
src_bind_flags
,
0
,
NULL
);
}
static
HRESULT
adapter_vk_create_swapchain
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
desc
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_swapchain
**
swapchain
)
{
...
...
@@ -821,6 +839,7 @@ static const struct wined3d_adapter_ops wined3d_adapter_vk_ops =
adapter_vk_uninit_3d
,
adapter_vk_map_bo_address
,
adapter_vk_unmap_bo_address
,
adapter_vk_copy_bo_address
,
adapter_vk_create_swapchain
,
adapter_vk_destroy_swapchain
,
adapter_vk_create_buffer
,
...
...
dlls/wined3d/buffer.c
View file @
422fa496
...
...
@@ -1188,9 +1188,8 @@ void wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_off
src
.
addr
+=
src_offset
;
context
=
context_acquire
(
dst_buffer
->
resource
.
device
,
NULL
,
0
);
wined3d_context_gl_copy_bo_address
(
wined3d_context_gl
(
context
),
&
dst
,
wined3d_buffer_gl
(
dst_buffer
)
->
buffer_type_hint
,
&
src
,
wined3d_buffer_gl
(
src_buffer
)
->
buffer_type_hint
,
size
);
wined3d_context_copy_bo_address
(
context
,
&
dst
,
dst_buffer
->
resource
.
bind_flags
,
&
src
,
src_buffer
->
resource
.
bind_flags
,
size
);
context_release
(
context
);
wined3d_buffer_invalidate_range
(
dst_buffer
,
~
dst_location
,
dst_offset
,
size
);
...
...
dlls/wined3d/directx.c
View file @
422fa496
...
...
@@ -2372,6 +2372,19 @@ static void adapter_no3d_unmap_bo_address(struct wined3d_context *context, const
ERR
(
"Unsupported buffer object %#lx.
\n
"
,
data
->
buffer_object
);
}
static
void
adapter_no3d_copy_bo_address
(
struct
wined3d_context
*
context
,
const
struct
wined3d_bo_address
*
dst
,
uint32_t
dst_bind_flags
,
const
struct
wined3d_bo_address
*
src
,
uint32_t
src_bind_flags
,
size_t
size
)
{
if
(
dst
->
buffer_object
)
ERR
(
"Unsupported dst buffer object %#lx.
\n
"
,
dst
->
buffer_object
);
if
(
src
->
buffer_object
)
ERR
(
"Unsupported src buffer object %#lx.
\n
"
,
src
->
buffer_object
);
if
(
dst
->
buffer_object
||
src
->
buffer_object
)
return
;
memcpy
(
dst
->
addr
,
src
->
addr
,
size
);
}
static
HRESULT
adapter_no3d_create_swapchain
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
desc
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_swapchain
**
swapchain
)
{
...
...
@@ -2626,6 +2639,7 @@ static const struct wined3d_adapter_ops wined3d_adapter_no3d_ops =
adapter_no3d_uninit_3d
,
adapter_no3d_map_bo_address
,
adapter_no3d_unmap_bo_address
,
adapter_no3d_copy_bo_address
,
adapter_no3d_create_swapchain
,
adapter_no3d_destroy_swapchain
,
adapter_no3d_create_buffer
,
...
...
dlls/wined3d/wined3d_private.h
View file @
422fa496
...
...
@@ -2821,6 +2821,9 @@ struct wined3d_adapter_ops
const
struct
wined3d_bo_address
*
data
,
size_t
size
,
uint32_t
bind_flags
,
uint32_t
map_flags
);
void
(
*
adapter_unmap_bo_address
)(
struct
wined3d_context
*
context
,
const
struct
wined3d_bo_address
*
data
,
uint32_t
bind_flags
,
unsigned
int
range_count
,
const
struct
wined3d_map_range
*
ranges
);
void
(
*
adapter_copy_bo_address
)(
struct
wined3d_context
*
context
,
const
struct
wined3d_bo_address
*
dst
,
uint32_t
dst_bind_flags
,
const
struct
wined3d_bo_address
*
src
,
uint32_t
src_bind_flags
,
size_t
size
);
HRESULT
(
*
adapter_create_swapchain
)(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
desc
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_swapchain
**
swapchain
);
void
(
*
adapter_destroy_swapchain
)(
struct
wined3d_swapchain
*
swapchain
);
...
...
@@ -5267,6 +5270,14 @@ static inline void wined3d_context_unmap_bo_address(struct wined3d_context *cont
context
->
device
->
adapter
->
adapter_ops
->
adapter_unmap_bo_address
(
context
,
data
,
bind_flags
,
range_count
,
ranges
);
}
static
inline
void
wined3d_context_copy_bo_address
(
struct
wined3d_context
*
context
,
const
struct
wined3d_bo_address
*
dst
,
uint32_t
dst_bind_flags
,
const
struct
wined3d_bo_address
*
src
,
uint32_t
src_bind_flags
,
size_t
size
)
{
context
->
device
->
adapter
->
adapter_ops
->
adapter_copy_bo_address
(
context
,
dst
,
dst_bind_flags
,
src
,
src_bind_flags
,
size
);
}
/* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */
#define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL"
...
...
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