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
0d7b1269
Commit
0d7b1269
authored
Nov 21, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge texture2d_unload() and texture3d_unload().
parent
f91eab6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
37 deletions
+16
-37
texture.c
dlls/wined3d/texture.c
+16
-37
No files found.
dlls/wined3d/texture.c
View file @
0d7b1269
...
...
@@ -94,7 +94,7 @@ static void gltexture_delete(const struct wined3d_gl_info *gl_info, struct gl_te
tex
->
name
=
0
;
}
static
void
wined3d_texture_unload
(
struct
wined3d_texture
*
texture
)
static
void
wined3d_texture_unload
_gl_texture
(
struct
wined3d_texture
*
texture
)
{
struct
wined3d_device
*
device
=
texture
->
resource
.
device
;
struct
wined3d_context
*
context
=
NULL
;
...
...
@@ -132,7 +132,7 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
texture
->
texture_ops
->
texture_sub_resource_cleanup
(
sub_resource
);
}
wined3d_texture_unload
(
texture
);
wined3d_texture_unload
_gl_texture
(
texture
);
HeapFree
(
GetProcessHeap
(),
0
,
texture
->
sub_resources
);
resource_cleanup
(
&
texture
->
resource
);
}
...
...
@@ -696,7 +696,14 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
wined3d_surface_decref
(
surface
);
}
static
void
texture2d_unload
(
struct
wined3d_resource
*
resource
)
static
const
struct
wined3d_texture_ops
texture2d_ops
=
{
texture2d_preload
,
texture2d_sub_resource_add_dirty_region
,
texture2d_sub_resource_cleanup
,
};
static
void
wined3d_texture_unload
(
struct
wined3d_resource
*
resource
)
{
struct
wined3d_texture
*
texture
=
wined3d_texture_from_resource
(
resource
);
UINT
sub_count
=
texture
->
level_count
*
texture
->
layer_count
;
...
...
@@ -711,19 +718,12 @@ static void texture2d_unload(struct wined3d_resource *resource)
sub_resource
->
resource_ops
->
resource_unload
(
sub_resource
);
}
wined3d_texture_unload
(
texture
);
wined3d_texture_unload
_gl_texture
(
texture
);
}
static
const
struct
wined3d_texture_ops
texture2d_ops
=
{
texture2d_preload
,
texture2d_sub_resource_add_dirty_region
,
texture2d_sub_resource_cleanup
,
};
static
const
struct
wined3d_resource_ops
texture2d_resource_ops
=
static
const
struct
wined3d_resource_ops
texture_resource_ops
=
{
texture2d
_unload
,
wined3d_texture
_unload
,
};
static
HRESULT
cubetexture_init
(
struct
wined3d_texture
*
texture
,
const
struct
wined3d_resource_desc
*
desc
,
...
...
@@ -794,7 +794,7 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi
}
if
(
FAILED
(
hr
=
wined3d_texture_init
(
texture
,
&
texture2d_ops
,
6
,
levels
,
desc
,
device
,
parent
,
parent_ops
,
&
texture
2d
_resource_ops
)))
desc
,
device
,
parent
,
parent_ops
,
&
texture_resource_ops
)))
{
WARN
(
"Failed to initialize texture, returning %#x
\n
"
,
hr
);
return
hr
;
...
...
@@ -919,7 +919,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
}
if
(
FAILED
(
hr
=
wined3d_texture_init
(
texture
,
&
texture2d_ops
,
1
,
levels
,
desc
,
device
,
parent
,
parent_ops
,
&
texture
2d
_resource_ops
)))
desc
,
device
,
parent
,
parent_ops
,
&
texture_resource_ops
)))
{
WARN
(
"Failed to initialize texture, returning %#x.
\n
"
,
hr
);
return
hr
;
...
...
@@ -1047,22 +1047,6 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource
wined3d_volume_decref
(
volume
);
}
static
void
texture3d_unload
(
struct
wined3d_resource
*
resource
)
{
struct
wined3d_texture
*
texture
=
wined3d_texture_from_resource
(
resource
);
UINT
i
;
TRACE
(
"texture %p.
\n
"
,
texture
);
for
(
i
=
0
;
i
<
texture
->
level_count
;
++
i
)
{
struct
wined3d_resource
*
sub_resource
=
texture
->
sub_resources
[
i
];
sub_resource
->
resource_ops
->
resource_unload
(
sub_resource
);
}
wined3d_texture_unload
(
texture
);
}
static
const
struct
wined3d_texture_ops
texture3d_ops
=
{
texture3d_preload
,
...
...
@@ -1070,11 +1054,6 @@ static const struct wined3d_texture_ops texture3d_ops =
texture3d_sub_resource_cleanup
,
};
static
const
struct
wined3d_resource_ops
texture3d_resource_ops
=
{
texture3d_unload
,
};
static
HRESULT
volumetexture_init
(
struct
wined3d_texture
*
texture
,
const
struct
wined3d_resource_desc
*
desc
,
UINT
levels
,
struct
wined3d_device
*
device
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
{
...
...
@@ -1149,7 +1128,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
}
if
(
FAILED
(
hr
=
wined3d_texture_init
(
texture
,
&
texture3d_ops
,
1
,
levels
,
desc
,
device
,
parent
,
parent_ops
,
&
texture
3d
_resource_ops
)))
desc
,
device
,
parent
,
parent_ops
,
&
texture_resource_ops
)))
{
WARN
(
"Failed to initialize texture, returning %#x.
\n
"
,
hr
);
return
hr
;
...
...
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