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
ed230a42
Commit
ed230a42
authored
Aug 19, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Explicitly destroy the surface in texture2d_sub_resource_cleanup().
Like volumes. We can do this now because we no longer have standalone surfaces.
parent
64a1fde1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
45 deletions
+18
-45
surface.c
dlls/wined3d/surface.c
+16
-42
texture.c
dlls/wined3d/texture.c
+1
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/surface.c
View file @
ed230a42
...
...
@@ -103,6 +103,15 @@ static void surface_cleanup(struct wined3d_surface *surface)
resource_cleanup
(
&
surface
->
resource
);
}
void
wined3d_surface_destroy
(
struct
wined3d_surface
*
surface
)
{
TRACE
(
"surface %p.
\n
"
,
surface
);
surface_cleanup
(
surface
);
surface
->
resource
.
parent_ops
->
wined3d_object_destroyed
(
surface
->
resource
.
parent
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
}
void
surface_update_draw_binding
(
struct
wined3d_surface
*
surface
)
{
if
(
!
surface_is_offscreen
(
surface
)
||
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
)
...
...
@@ -151,14 +160,6 @@ void surface_set_swapchain(struct wined3d_surface *surface, struct wined3d_swapc
surface_update_draw_binding
(
surface
);
}
void
surface_set_container
(
struct
wined3d_surface
*
surface
,
struct
wined3d_texture
*
container
)
{
TRACE
(
"surface %p, container %p.
\n
"
,
surface
,
container
);
surface
->
container
=
container
;
surface_update_draw_binding
(
surface
);
}
struct
blt_info
{
GLenum
binding
;
...
...
@@ -2135,49 +2136,24 @@ static inline unsigned short float_32_to_16(const float *in)
ULONG
CDECL
wined3d_surface_incref
(
struct
wined3d_surface
*
surface
)
{
ULONG
refcount
;
TRACE
(
"surface %p, swapchain %p, container %p.
\n
"
,
surface
,
surface
->
swapchain
,
surface
->
container
);
if
(
surface
->
swapchain
)
return
wined3d_swapchain_incref
(
surface
->
swapchain
);
if
(
surface
->
container
)
return
wined3d_texture_incref
(
surface
->
container
);
refcount
=
InterlockedIncrement
(
&
surface
->
resource
.
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
surface
,
refcount
);
return
refcount
;
return
wined3d_texture_incref
(
surface
->
container
);
}
ULONG
CDECL
wined3d_surface_decref
(
struct
wined3d_surface
*
surface
)
{
ULONG
refcount
;
TRACE
(
"surface %p, swapchain %p, container %p.
\n
"
,
surface
,
surface
->
swapchain
,
surface
->
container
);
if
(
surface
->
swapchain
)
return
wined3d_swapchain_decref
(
surface
->
swapchain
);
if
(
surface
->
container
)
return
wined3d_texture_decref
(
surface
->
container
);
refcount
=
InterlockedDecrement
(
&
surface
->
resource
.
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
surface
,
refcount
);
if
(
!
refcount
)
{
surface_cleanup
(
surface
);
surface
->
resource
.
parent_ops
->
wined3d_object_destroyed
(
surface
->
resource
.
parent
);
TRACE
(
"Destroyed surface %p.
\n
"
,
surface
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
}
return
refcount
;
return
wined3d_texture_decref
(
surface
->
container
);
}
void
CDECL
wined3d_surface_preload
(
struct
wined3d_surface
*
surface
)
...
...
@@ -6016,7 +5992,8 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
return
hr
;
}
surface_set_container
(
surface
,
container
);
surface
->
container
=
container
;
surface_update_draw_binding
(
surface
);
surface_validate_location
(
surface
,
WINED3D_LOCATION_SYSMEM
);
list_init
(
&
surface
->
renderbuffers
);
list_init
(
&
surface
->
overlays
);
...
...
@@ -6036,11 +6013,9 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
surface
->
texture_level
=
level
;
/* Call the private setup routine */
hr
=
surface
->
surface_ops
->
surface_private_setup
(
surface
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
=
surface
->
surface_ops
->
surface_private_setup
(
surface
)))
{
ERR
(
"Private setup failed, returning %#x
\n
"
,
hr
);
surface_set_container
(
surface
,
NULL
);
ERR
(
"Private setup failed, hr %#x.
\n
"
,
hr
);
surface_cleanup
(
surface
);
return
hr
;
}
...
...
@@ -6091,8 +6066,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w
wined3d_texture_get_parent
(
container
),
object
,
&
parent
,
&
parent_ops
)))
{
WARN
(
"Failed to create surface parent, hr %#x.
\n
"
,
hr
);
surface_set_container
(
object
,
NULL
);
wined3d_surface_decref
(
object
);
wined3d_surface_destroy
(
object
);
return
hr
;
}
...
...
dlls/wined3d/texture.c
View file @
ed230a42
...
...
@@ -742,8 +742,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
{
struct
wined3d_surface
*
surface
=
surface_from_resource
(
sub_resource
);
surface_set_container
(
surface
,
NULL
);
wined3d_surface_decref
(
surface
);
wined3d_surface_destroy
(
surface
);
}
static
const
struct
wined3d_texture_ops
texture2d_ops
=
...
...
dlls/wined3d/wined3d_private.h
View file @
ed230a42
...
...
@@ -2303,7 +2303,6 @@ void surface_prepare_texture(struct wined3d_surface *surface,
struct
wined3d_context
*
context
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
surface_set_compatible_renderbuffer
(
struct
wined3d_surface
*
surface
,
const
struct
wined3d_surface
*
rt
)
DECLSPEC_HIDDEN
;
void
surface_set_container
(
struct
wined3d_surface
*
surface
,
struct
wined3d_texture
*
container
)
DECLSPEC_HIDDEN
;
void
surface_set_swapchain
(
struct
wined3d_surface
*
surface
,
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
void
surface_set_texture_target
(
struct
wined3d_surface
*
surface
,
GLenum
target
,
GLint
level
)
DECLSPEC_HIDDEN
;
void
surface_translate_drawable_coords
(
const
struct
wined3d_surface
*
surface
,
HWND
window
,
RECT
*
rect
)
DECLSPEC_HIDDEN
;
...
...
@@ -2313,6 +2312,7 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
void
surface_validate_location
(
struct
wined3d_surface
*
surface
,
DWORD
location
)
DECLSPEC_HIDDEN
;
HRESULT
wined3d_surface_create
(
struct
wined3d_texture
*
container
,
const
struct
wined3d_resource_desc
*
desc
,
GLenum
target
,
GLint
level
,
DWORD
flags
,
struct
wined3d_surface
**
surface
)
DECLSPEC_HIDDEN
;
void
wined3d_surface_destroy
(
struct
wined3d_surface
*
surface
)
DECLSPEC_HIDDEN
;
void
surface_prepare_map_memory
(
struct
wined3d_surface
*
surface
)
DECLSPEC_HIDDEN
;
void
draw_textured_quad
(
const
struct
wined3d_surface
*
src_surface
,
struct
wined3d_context
*
context
,
...
...
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