Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vkd3d
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wine
vkd3d
Commits
c558118f
Commit
c558118f
authored
8 years ago
by
Józef Kucia
Browse files
Options
Downloads
Patches
Plain Diff
libs/vkd3d: Re-use vkd3d_array_reserve() in d3d12_fence_SetEventOnCompletion().
parent
b224b637
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libs/vkd3d/command.c
+7
-20
7 additions, 20 deletions
libs/vkd3d/command.c
libs/vkd3d/vkd3d_private.h
+2
-2
2 additions, 2 deletions
libs/vkd3d/vkd3d_private.h
with
9 additions
and
22 deletions
libs/vkd3d/command.c
+
7
−
20
View file @
c558118f
...
...
@@ -179,21 +179,12 @@ static HRESULT STDMETHODCALLTYPE d3d12_fence_SetEventOnCompletion(ID3D12Fence *i
}
}
if
(
fence
->
event_array_size
==
fence
->
event_count
)
if
(
!
vkd3d_array_reserve
((
void
**
)
&
fence
->
events
,
&
fence
->
events_size
,
fence
->
event_count
+
1
,
sizeof
(
*
fence
->
events
)))
{
unsigned
int
new_size
=
2
*
fence
->
event_array_size
;
struct
vkd3d_waiting_event
*
new_events
;
TRACE
(
"Resizing waiting events array from %u to %u.
\n
"
,
fence
->
event_array_size
,
new_size
);
if
(
!
(
new_events
=
vkd3d_realloc
(
fence
->
events
,
new_size
*
sizeof
(
*
fence
->
events
))))
{
pthread_mutex_unlock
(
&
fence
->
mutex
);
return
E_OUTOFMEMORY
;
}
fence
->
event_array_size
=
new_size
;
fence
->
events
=
new_events
;
WARN
(
"Failed to add event.
\n
"
);
pthread_mutex_unlock
(
&
fence
->
mutex
);
return
E_OUTOFMEMORY
;
}
fence
->
events
[
fence
->
event_count
].
value
=
value
;
...
...
@@ -280,12 +271,8 @@ static HRESULT d3d12_fence_init(struct d3d12_fence *fence, struct d3d12_device *
if
(
flags
)
FIXME
(
"Ignoring flags %#x.
\n
"
,
flags
);
fence
->
event_array_size
=
2
;
if
(
!
(
fence
->
events
=
vkd3d_calloc
(
fence
->
event_array_size
,
sizeof
(
*
fence
->
events
))))
{
pthread_mutex_destroy
(
&
fence
->
mutex
);
return
E_OUTOFMEMORY
;
}
fence
->
events
=
NULL
;
fence
->
events_size
=
0
;
fence
->
event_count
=
0
;
fence
->
device
=
device
;
...
...
This diff is collapsed.
Click to expand it.
libs/vkd3d/vkd3d_private.h
+
2
−
2
View file @
c558118f
...
...
@@ -69,9 +69,9 @@ struct d3d12_fence
UINT64
value
;
pthread_mutex_t
mutex
;
unsigned
int
event_array_size
;
unsigned
int
event_count
;
struct
vkd3d_waiting_event
*
events
;
size_t
events_size
;
size_t
event_count
;
struct
d3d12_device
*
device
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment