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
9992d710
Commit
9992d710
authored
Dec 14, 2020
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Unmap the chunk if needed in wined3d_context_vk_destroy_bo().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4e7be889
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
adapter_vk.c
dlls/wined3d/adapter_vk.c
+7
-9
context_vk.c
dlls/wined3d/context_vk.c
+2
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-0
No files found.
dlls/wined3d/adapter_vk.c
View file @
9992d710
...
...
@@ -762,7 +762,6 @@ static void *wined3d_bo_vk_map(struct wined3d_bo_vk *bo, struct wined3d_context_
const
struct
wined3d_vk_info
*
vk_info
;
struct
wined3d_device_vk
*
device_vk
;
struct
wined3d_bo_slab_vk
*
slab
;
void
*
map_ptr
;
VkResult
vr
;
if
(
bo
->
map_ptr
)
...
...
@@ -773,7 +772,7 @@ static void *wined3d_bo_vk_map(struct wined3d_bo_vk *bo, struct wined3d_context_
if
((
slab
=
bo
->
slab
))
{
if
(
!
(
map_ptr
=
slab
->
map_ptr
)
&&
!
(
map_ptr
=
wined3d_bo_vk_map
(
&
slab
->
bo
,
context_vk
)))
if
(
!
(
bo
->
map_ptr
=
slab
->
map_ptr
)
&&
!
(
bo
->
map_ptr
=
wined3d_bo_vk_map
(
&
slab
->
bo
,
context_vk
)))
{
ERR
(
"Failed to map slab.
\n
"
);
return
NULL
;
...
...
@@ -784,22 +783,19 @@ static void *wined3d_bo_vk_map(struct wined3d_bo_vk *bo, struct wined3d_context_
{
struct
wined3d_allocator_chunk_vk
*
chunk_vk
=
wined3d_allocator_chunk_vk
(
bo
->
memory
->
chunk
);
if
(
!
(
map_ptr
=
wined3d_allocator_chunk_vk_map
(
chunk_vk
,
context_vk
)))
if
(
!
(
bo
->
map_ptr
=
wined3d_allocator_chunk_vk_map
(
chunk_vk
,
context_vk
)))
{
ERR
(
"Failed to map chunk.
\n
"
);
return
NULL
;
}
}
else
if
((
vr
=
VK_CALL
(
vkMapMemory
(
device_vk
->
vk_device
,
bo
->
vk_memory
,
0
,
VK_WHOLE_SIZE
,
0
,
&
map_ptr
)))
<
0
)
else
if
((
vr
=
VK_CALL
(
vkMapMemory
(
device_vk
->
vk_device
,
bo
->
vk_memory
,
0
,
VK_WHOLE_SIZE
,
0
,
&
bo
->
map_ptr
)))
<
0
)
{
ERR
(
"Failed to map memory, vr %s.
\n
"
,
wined3d_debug_vkresult
(
vr
));
return
NULL
;
}
if
(
sizeof
(
map_ptr
)
>=
sizeof
(
uint64_t
))
bo
->
map_ptr
=
map_ptr
;
return
map_ptr
;
return
bo
->
map_ptr
;
}
static
void
wined3d_bo_vk_unmap
(
struct
wined3d_bo_vk
*
bo
,
struct
wined3d_context_vk
*
context_vk
)
...
...
@@ -808,9 +804,11 @@ static void wined3d_bo_vk_unmap(struct wined3d_bo_vk *bo, struct wined3d_context
struct
wined3d_device_vk
*
device_vk
;
struct
wined3d_bo_slab_vk
*
slab
;
if
(
bo
->
map_ptr
)
if
(
wined3d_map_persistent
()
)
return
;
bo
->
map_ptr
=
NULL
;
if
((
slab
=
bo
->
slab
))
{
if
(
--
slab
->
map_count
)
...
...
dlls/wined3d/context_vk.c
View file @
9992d710
...
...
@@ -812,6 +812,8 @@ void wined3d_context_vk_destroy_bo(struct wined3d_context_vk *context_vk, const
wined3d_context_vk_destroy_buffer
(
context_vk
,
bo
->
vk_buffer
,
bo
->
command_buffer_id
);
if
(
bo
->
memory
)
{
if
(
bo
->
map_ptr
)
wined3d_allocator_chunk_vk_unmap
(
wined3d_allocator_chunk_vk
(
bo
->
memory
->
chunk
),
context_vk
);
wined3d_context_vk_destroy_allocator_block
(
context_vk
,
bo
->
memory
,
bo
->
command_buffer_id
);
return
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
9992d710
...
...
@@ -6367,6 +6367,11 @@ static inline void wined3d_context_gl_reference_bo(struct wined3d_context_gl *co
bo_gl
->
command_fence_id
=
device_gl
->
current_fence_id
;
}
static
inline
bool
wined3d_map_persistent
(
void
)
{
return
sizeof
(
void
*
)
>=
sizeof
(
uint64_t
);
}
/* 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