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
b4e109f2
Commit
b4e109f2
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 slab 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
9992d710
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
13 deletions
+42
-13
adapter_vk.c
dlls/wined3d/adapter_vk.c
+31
-10
context_vk.c
dlls/wined3d/context_vk.c
+6
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-0
No files found.
dlls/wined3d/adapter_vk.c
View file @
b4e109f2
...
...
@@ -772,12 +772,11 @@ static void *wined3d_bo_vk_map(struct wined3d_bo_vk *bo, struct wined3d_context_
if
((
slab
=
bo
->
slab
))
{
if
(
!
(
bo
->
map_ptr
=
slab
->
map_ptr
)
&&
!
(
bo
->
map_ptr
=
wined3d_bo_vk_map
(
&
slab
->
bo
,
context_vk
)))
if
(
!
(
bo
->
map_ptr
=
wined3d_bo_slab_vk_map
(
slab
,
context_vk
)))
{
ERR
(
"Failed to map slab.
\n
"
);
return
NULL
;
}
++
slab
->
map_count
;
}
else
if
(
bo
->
memory
)
{
...
...
@@ -811,21 +810,43 @@ static void wined3d_bo_vk_unmap(struct wined3d_bo_vk *bo, struct wined3d_context
if
((
slab
=
bo
->
slab
))
{
if
(
--
slab
->
map_count
)
return
;
wined3d_bo_slab_vk_unmap
(
slab
,
context_vk
);
return
;
}
wined3d_bo_vk_unmap
(
&
slab
->
bo
,
context_vk
);
slab
->
map_ptr
=
NULL
;
if
(
bo
->
memory
)
{
wined3d_allocator_chunk_vk_unmap
(
wined3d_allocator_chunk_vk
(
bo
->
memory
->
chunk
),
context_vk
);
return
;
}
vk_info
=
context_vk
->
vk_info
;
device_vk
=
wined3d_device_vk
(
context_vk
->
c
.
device
);
VK_CALL
(
vkUnmapMemory
(
device_vk
->
vk_device
,
bo
->
vk_memory
));
}
if
(
bo
->
memory
)
wined3d_allocator_chunk_vk_unmap
(
wined3d_allocator_chunk_vk
(
bo
->
memory
->
chunk
),
context_vk
);
else
VK_CALL
(
vkUnmapMemory
(
device_vk
->
vk_device
,
bo
->
vk_memory
));
void
*
wined3d_bo_slab_vk_map
(
struct
wined3d_bo_slab_vk
*
slab_vk
,
struct
wined3d_context_vk
*
context_vk
)
{
TRACE
(
"slab_vk %p, context_vk %p.
\n
"
,
slab_vk
,
context_vk
);
if
(
!
slab_vk
->
map_ptr
&&
!
(
slab_vk
->
map_ptr
=
wined3d_bo_vk_map
(
&
slab_vk
->
bo
,
context_vk
)))
{
ERR
(
"Failed to map slab.
\n
"
);
return
NULL
;
}
++
slab_vk
->
map_count
;
return
slab_vk
->
map_ptr
;
}
void
wined3d_bo_slab_vk_unmap
(
struct
wined3d_bo_slab_vk
*
slab_vk
,
struct
wined3d_context_vk
*
context_vk
)
{
if
(
--
slab_vk
->
map_count
)
return
;
wined3d_bo_vk_unmap
(
&
slab_vk
->
bo
,
context_vk
);
slab_vk
->
map_ptr
=
NULL
;
}
static
VkAccessFlags
vk_access_mask_from_buffer_usage
(
VkBufferUsageFlags
usage
)
...
...
dlls/wined3d/context_vk.c
View file @
b4e109f2
...
...
@@ -797,15 +797,18 @@ void wined3d_context_vk_destroy_bo(struct wined3d_context_vk *context_vk, const
{
struct
wined3d_device_vk
*
device_vk
=
wined3d_device_vk
(
context_vk
->
c
.
device
);
const
struct
wined3d_vk_info
*
vk_info
=
context_vk
->
vk_info
;
struct
wined3d_bo_slab_vk
*
slab_vk
;
size_t
object_size
,
idx
;
TRACE
(
"context_vk %p, bo %p.
\n
"
,
context_vk
,
bo
);
if
(
bo
->
slab
)
if
(
(
slab_vk
=
bo
->
slab
)
)
{
object_size
=
bo
->
slab
->
bo
.
size
/
32
;
if
(
bo
->
map_ptr
)
wined3d_bo_slab_vk_unmap
(
slab_vk
,
context_vk
);
object_size
=
slab_vk
->
bo
.
size
/
32
;
idx
=
bo
->
buffer_offset
/
object_size
;
wined3d_context_vk_destroy_bo_slab_slice
(
context_vk
,
bo
->
slab
,
idx
,
bo
->
command_buffer_id
);
wined3d_context_vk_destroy_bo_slab_slice
(
context_vk
,
slab_vk
,
idx
,
bo
->
command_buffer_id
);
return
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
b4e109f2
...
...
@@ -1633,6 +1633,11 @@ struct wined3d_bo_slab_vk
uint32_t
map
;
};
void
*
wined3d_bo_slab_vk_map
(
struct
wined3d_bo_slab_vk
*
slab_vk
,
struct
wined3d_context_vk
*
context_vk
)
DECLSPEC_HIDDEN
;
void
wined3d_bo_slab_vk_unmap
(
struct
wined3d_bo_slab_vk
*
slab_vk
,
struct
wined3d_context_vk
*
context_vk
)
DECLSPEC_HIDDEN
;
struct
wined3d_bo_address
{
UINT_PTR
buffer_object
;
...
...
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