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
a7c0904a
Commit
a7c0904a
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_create_dc().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
991b1b77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
texture.c
dlls/wined3d/texture.c
+22
-8
No files found.
dlls/wined3d/texture.c
View file @
a7c0904a
...
...
@@ -1334,23 +1334,30 @@ void wined3d_texture_set_compatible_renderbuffer(struct wined3d_texture *texture
checkGLcall
(
"set_compatible_renderbuffer"
);
}
struct
wined3d_texture_idx
{
struct
wined3d_texture
*
texture
;
unsigned
int
sub_resource_idx
;
};
static
void
texture2d_create_dc
(
void
*
object
)
{
struct
wined3d_surface
*
surface
=
object
;
const
struct
wined3d_texture_idx
*
idx
=
object
;
struct
wined3d_context
*
context
=
NULL
;
unsigned
int
sub_resource_idx
,
level
;
const
struct
wined3d_format
*
format
;
unsigned
int
row_pitch
,
slice_pitch
;
struct
wined3d_texture
*
texture
;
struct
wined3d_surface
*
surface
;
struct
wined3d_bo_address
data
;
D3DKMT_CREATEDCFROMMEMORY
desc
;
struct
wined3d_device
*
device
;
NTSTATUS
status
;
TRACE
(
"
surface %p.
\n
"
,
surface
);
TRACE
(
"
texture %p, sub_resource_idx %u.
\n
"
,
idx
->
texture
,
idx
->
sub_resource_idx
);
texture
=
surface
->
container
;
sub_resource_idx
=
surface_get_sub_resource_idx
(
surface
)
;
texture
=
idx
->
texture
;
sub_resource_idx
=
idx
->
sub_resource_idx
;
level
=
sub_resource_idx
%
texture
->
level_count
;
device
=
texture
->
resource
.
device
;
...
...
@@ -1390,10 +1397,11 @@ static void texture2d_create_dc(void *object)
return
;
}
surface
=
texture
->
sub_resources
[
sub_resource_idx
].
u
.
surface
;
surface
->
dc
=
desc
.
hDc
;
surface
->
bitmap
=
desc
.
hBitmap
;
TRACE
(
"Created DC %p, bitmap %p for
surface %p.
\n
"
,
surface
->
dc
,
surface
->
bitmap
,
surface
);
TRACE
(
"Created DC %p, bitmap %p for
texture %p, %u.
\n
"
,
surface
->
dc
,
surface
->
bitmap
,
texture
,
sub_resource_idx
);
}
static
void
texture2d_destroy_dc
(
void
*
object
)
...
...
@@ -1563,7 +1571,9 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
if
(
create_dib
)
{
wined3d_cs_init_object
(
device
->
cs
,
texture2d_create_dc
,
surface
);
struct
wined3d_texture_idx
texture_idx
=
{
texture
,
0
};
wined3d_cs_init_object
(
device
->
cs
,
texture2d_create_dc
,
&
texture_idx
);
device
->
cs
->
ops
->
finish
(
device
->
cs
,
WINED3D_CS_QUEUE_DEFAULT
);
}
...
...
@@ -2377,7 +2387,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
if
((
desc
->
usage
&
WINED3DUSAGE_OWNDC
)
||
(
device
->
wined3d
->
flags
&
WINED3D_NO3D
))
{
wined3d_cs_init_object
(
device
->
cs
,
texture2d_create_dc
,
surface
);
struct
wined3d_texture_idx
texture_idx
=
{
texture
,
idx
};
wined3d_cs_init_object
(
device
->
cs
,
texture2d_create_dc
,
&
texture_idx
);
device
->
cs
->
ops
->
finish
(
device
->
cs
,
WINED3D_CS_QUEUE_DEFAULT
);
if
(
!
surface
->
dc
)
{
...
...
@@ -3163,7 +3175,9 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
if
(
!
surface
->
dc
)
{
wined3d_cs_init_object
(
device
->
cs
,
texture2d_create_dc
,
surface
);
struct
wined3d_texture_idx
texture_idx
=
{
texture
,
sub_resource_idx
};
wined3d_cs_init_object
(
device
->
cs
,
texture2d_create_dc
,
&
texture_idx
);
device
->
cs
->
ops
->
finish
(
device
->
cs
,
WINED3D_CS_QUEUE_DEFAULT
);
}
if
(
!
surface
->
dc
)
...
...
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