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
aee3c0fa
Commit
aee3c0fa
authored
Aug 26, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a separate function for cleaning up a wined3d_state structure.
parent
4e755d26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
16 deletions
+22
-16
stateblock.c
dlls/wined3d/stateblock.c
+22
-16
No files found.
dlls/wined3d/stateblock.c
View file @
aee3c0fa
...
...
@@ -588,6 +588,27 @@ void state_unbind_resources(struct wined3d_state *state)
}
}
static
void
state_cleanup
(
struct
wined3d_state
*
state
)
{
unsigned
int
counter
;
state_unbind_resources
(
state
);
for
(
counter
=
0
;
counter
<
LIGHTMAP_SIZE
;
++
counter
)
{
struct
list
*
e1
,
*
e2
;
LIST_FOR_EACH_SAFE
(
e1
,
e2
,
&
state
->
light_map
[
counter
])
{
struct
wined3d_light_info
*
light
=
LIST_ENTRY
(
e1
,
struct
wined3d_light_info
,
entry
);
list_remove
(
&
light
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
light
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
state
->
vs_consts_f
);
HeapFree
(
GetProcessHeap
(),
0
,
state
->
ps_consts_f
);
}
ULONG
CDECL
wined3d_stateblock_decref
(
struct
wined3d_stateblock
*
stateblock
)
{
ULONG
refcount
=
InterlockedDecrement
(
&
stateblock
->
ref
);
...
...
@@ -596,24 +617,9 @@ ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
if
(
!
refcount
)
{
int
counter
;
state_unbind_resources
(
&
stateblock
->
state
);
for
(
counter
=
0
;
counter
<
LIGHTMAP_SIZE
;
++
counter
)
{
struct
list
*
e1
,
*
e2
;
LIST_FOR_EACH_SAFE
(
e1
,
e2
,
&
stateblock
->
state
.
light_map
[
counter
])
{
struct
wined3d_light_info
*
light
=
LIST_ENTRY
(
e1
,
struct
wined3d_light_info
,
entry
);
list_remove
(
&
light
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
light
);
}
}
state_cleanup
(
&
stateblock
->
state
);
HeapFree
(
GetProcessHeap
(),
0
,
stateblock
->
state
.
vs_consts_f
);
HeapFree
(
GetProcessHeap
(),
0
,
stateblock
->
changed
.
vertexShaderConstantsF
);
HeapFree
(
GetProcessHeap
(),
0
,
stateblock
->
state
.
ps_consts_f
);
HeapFree
(
GetProcessHeap
(),
0
,
stateblock
->
changed
.
pixelShaderConstantsF
);
HeapFree
(
GetProcessHeap
(),
0
,
stateblock
->
contained_vs_consts_f
);
HeapFree
(
GetProcessHeap
(),
0
,
stateblock
->
contained_ps_consts_f
);
...
...
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