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
56464f5e
Commit
56464f5e
authored
Mar 13, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a texture and sub-resource index to texture2d_destroy_dc().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a7c0904a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
19 deletions
+17
-19
texture.c
dlls/wined3d/texture.c
+17
-11
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-8
No files found.
dlls/wined3d/texture.c
View file @
56464f5e
...
...
@@ -1406,18 +1406,20 @@ static void texture2d_create_dc(void *object)
static
void
texture2d_destroy_dc
(
void
*
object
)
{
struct
wined3d_surface
*
surface
=
object
;
const
struct
wined3d_texture_idx
*
idx
=
object
;
D3DKMT_DESTROYDCFROMMEMORY
destroy_desc
;
struct
wined3d_context
*
context
=
NULL
;
struct
wined3d_texture
*
texture
;
struct
wined3d_surface
*
surface
;
struct
wined3d_bo_address
data
;
unsigned
int
sub_resource_idx
;
struct
wined3d_device
*
device
;
NTSTATUS
status
;
texture
=
surface
->
container
;
sub_resource_idx
=
surface_get_sub_resource_idx
(
surface
)
;
texture
=
idx
->
texture
;
sub_resource_idx
=
idx
->
sub_resource_idx
;
device
=
texture
->
resource
.
device
;
surface
=
texture
->
sub_resources
[
sub_resource_idx
].
u
.
surface
;
if
(
!
surface
->
dc
)
{
...
...
@@ -1453,7 +1455,6 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
const
struct
wined3d_format
*
format
=
wined3d_get_format
(
gl_info
,
format_id
,
texture
->
resource
.
usage
);
UINT
resource_size
=
wined3d_format_calculate_size
(
format
,
device
->
surface_alignment
,
width
,
height
,
1
);
struct
wined3d_texture_sub_resource
*
sub_resource
;
struct
wined3d_surface
*
surface
;
DWORD
valid_location
=
0
;
BOOL
create_dib
=
FALSE
;
...
...
@@ -1500,10 +1501,11 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
wined3d_resource_wait_idle
(
&
texture
->
resource
);
sub_resource
=
&
texture
->
sub_resources
[
0
];
surface
=
sub_resource
->
u
.
surface
;
if
(
surface
->
dc
)
if
(
sub_resource
->
u
.
surface
->
dc
)
{
wined3d_cs_destroy_object
(
device
->
cs
,
texture2d_destroy_dc
,
surface
);
struct
wined3d_texture_idx
texture_idx
=
{
texture
,
0
};
wined3d_cs_destroy_object
(
device
->
cs
,
texture2d_destroy_dc
,
&
texture_idx
);
device
->
cs
->
ops
->
finish
(
device
->
cs
,
WINED3D_CS_QUEUE_DEFAULT
);
create_dib
=
TRUE
;
}
...
...
@@ -1889,7 +1891,11 @@ static void texture2d_cleanup_sub_resources(struct wined3d_texture *texture)
TRACE
(
"surface %p.
\n
"
,
surface
);
if
(
surface
->
dc
)
texture2d_destroy_dc
(
surface
);
{
struct
wined3d_texture_idx
texture_idx
=
{
texture
,
i
};
texture2d_destroy_dc
(
&
texture_idx
);
}
}
if
(
context
)
context_release
(
context
);
...
...
@@ -2360,8 +2366,6 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
surface
=
&
surfaces
[
idx
];
surface
->
container
=
texture
;
surface
->
texture_level
=
i
;
surface
->
texture_layer
=
j
;
sub_resource
=
&
texture
->
sub_resources
[
idx
];
sub_resource
->
locations
=
WINED3D_LOCATION_DISCARDED
;
...
...
@@ -3224,7 +3228,9 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
if
(
!
(
texture
->
resource
.
usage
&
WINED3DUSAGE_OWNDC
)
&&
!
(
device
->
wined3d
->
flags
&
WINED3D_NO3D
))
{
wined3d_cs_destroy_object
(
device
->
cs
,
texture2d_destroy_dc
,
surface
);
struct
wined3d_texture_idx
texture_idx
=
{
texture
,
sub_resource_idx
};
wined3d_cs_destroy_object
(
device
->
cs
,
texture2d_destroy_dc
,
&
texture_idx
);
device
->
cs
->
ops
->
finish
(
device
->
cs
,
WINED3D_CS_QUEUE_DEFAULT
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
56464f5e
...
...
@@ -3335,19 +3335,11 @@ struct wined3d_surface
{
struct
wined3d_texture
*
container
;
unsigned
int
texture_level
;
unsigned
int
texture_layer
;
/* For GetDC */
HBITMAP
bitmap
;
HDC
dc
;
};
static
inline
unsigned
int
surface_get_sub_resource_idx
(
const
struct
wined3d_surface
*
surface
)
{
return
surface
->
texture_layer
*
surface
->
container
->
level_count
+
surface
->
texture_level
;
}
void
wined3d_surface_upload_data
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_format
*
format
,
const
RECT
*
src_rect
,
unsigned
int
src_pitch
,
const
POINT
*
dst_point
,
BOOL
srgb
,
...
...
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