Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
525696fe
Commit
525696fe
authored
Jan 19, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Properly cleanup samplers on wined3d_device_reset() / wined3d_device_uninit_3d().
parent
ca06f960
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
device.c
dlls/wined3d/device.c
+4
-5
rbtree.h
include/wine/rbtree.h
+6
-2
No files found.
dlls/wined3d/device.c
View file @
525696fe
...
@@ -1032,9 +1032,8 @@ err_out:
...
@@ -1032,9 +1032,8 @@ err_out:
static
void
device_free_sampler
(
struct
wine_rb_entry
*
entry
,
void
*
context
)
static
void
device_free_sampler
(
struct
wine_rb_entry
*
entry
,
void
*
context
)
{
{
struct
wined3d_sampler
*
sampler
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
wined3d_sampler
,
entry
);
struct
wined3d_sampler
*
sampler
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
wined3d_sampler
,
entry
);
struct
wined3d_device
*
device
=
context
;
wine
_rb_remove
(
&
device
->
samplers
,
&
sampler
->
desc
);
wine
d3d_sampler_decref
(
sampler
);
}
}
HRESULT
CDECL
wined3d_device_uninit_3d
(
struct
wined3d_device
*
device
)
HRESULT
CDECL
wined3d_device_uninit_3d
(
struct
wined3d_device
*
device
)
...
@@ -1071,7 +1070,7 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
...
@@ -1071,7 +1070,7 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
resource
->
resource_ops
->
resource_unload
(
resource
);
resource
->
resource_ops
->
resource_unload
(
resource
);
}
}
wine_rb_
for_each_entry
(
&
device
->
samplers
,
device_free_sampler
,
device
);
wine_rb_
clear
(
&
device
->
samplers
,
device_free_sampler
,
NULL
);
/* Destroy the depth blt resources, they will be invalid after the reset. Also free shader
/* Destroy the depth blt resources, they will be invalid after the reset. Also free shader
* private data, it might contain opengl pointers
* private data, it might contain opengl pointers
...
@@ -4632,6 +4631,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
...
@@ -4632,6 +4631,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
device
->
exStyle
=
exStyle
;
device
->
exStyle
=
exStyle
;
}
}
wine_rb_clear
(
&
device
->
samplers
,
device_free_sampler
,
NULL
);
if
(
reset_state
)
if
(
reset_state
)
{
{
TRACE
(
"Resetting stateblock.
\n
"
);
TRACE
(
"Resetting stateblock.
\n
"
);
...
@@ -4677,8 +4678,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
...
@@ -4677,8 +4678,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
swapchain_update_render_to_fbo
(
swapchain
);
swapchain_update_render_to_fbo
(
swapchain
);
swapchain_update_draw_bindings
(
swapchain
);
swapchain_update_draw_bindings
(
swapchain
);
wine_rb_for_each_entry
(
&
device
->
samplers
,
device_free_sampler
,
device
);
if
(
reset_state
&&
device
->
d3d_initialized
)
if
(
reset_state
&&
device
->
d3d_initialized
)
hr
=
create_primary_opengl_context
(
device
,
swapchain
);
hr
=
create_primary_opengl_context
(
device
,
swapchain
);
...
...
include/wine/rbtree.h
View file @
525696fe
...
@@ -220,12 +220,16 @@ static inline void wine_rb_for_each_entry(struct wine_rb_tree *tree, wine_rb_tra
...
@@ -220,12 +220,16 @@ static inline void wine_rb_for_each_entry(struct wine_rb_tree *tree, wine_rb_tra
wine_rb_postorder
(
tree
,
callback
,
context
);
wine_rb_postorder
(
tree
,
callback
,
context
);
}
}
static
inline
void
wine_rb_
destroy
(
struct
wine_rb_tree
*
tree
,
wine_rb_traverse_func_t
*
callback
,
void
*
context
)
static
inline
void
wine_rb_
clear
(
struct
wine_rb_tree
*
tree
,
wine_rb_traverse_func_t
*
callback
,
void
*
context
)
{
{
/* Note that we use postorder here because the callback will likely free the entry. */
/* Note that we use postorder here because the callback will likely free the entry. */
if
(
callback
)
wine_rb_postorder
(
tree
,
callback
,
context
);
if
(
callback
)
wine_rb_postorder
(
tree
,
callback
,
context
);
tree
->
root
=
NULL
;
tree
->
root
=
NULL
;
}
static
inline
void
wine_rb_destroy
(
struct
wine_rb_tree
*
tree
,
wine_rb_traverse_func_t
*
callback
,
void
*
context
)
{
wine_rb_clear
(
tree
,
callback
,
context
);
tree
->
functions
->
free
(
tree
->
stack
.
entries
);
tree
->
functions
->
free
(
tree
->
stack
.
entries
);
}
}
...
...
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