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
c7d8a1b4
Commit
c7d8a1b4
authored
Apr 11, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
May 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Directly call wined3d_texture_create() to create swapchain textures.
Get rid of the create_swapchain_texture callback.
parent
fd3d4d0a
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
87 deletions
+8
-87
device.c
dlls/d3d11/device.c
+0
-14
device.c
dlls/d3d8/device.c
+0
-21
device.c
dlls/d3d9/device.c
+0
-21
ddraw.c
dlls/ddraw/ddraw.c
+0
-21
device.c
dlls/wined3d/device.c
+2
-2
swapchain.c
dlls/wined3d/swapchain.c
+6
-6
wined3d.h
include/wine/wined3d.h
+0
-2
No files found.
dlls/d3d11/device.c
View file @
c7d8a1b4
...
...
@@ -6893,26 +6893,12 @@ static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_d
return
S_OK
;
}
static
HRESULT
CDECL
device_parent_create_swapchain_texture
(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
const
struct
wined3d_resource_desc
*
wined3d_desc
,
DWORD
texture_flags
,
struct
wined3d_texture
**
wined3d_texture
)
{
struct
d3d_device
*
device
=
device_from_wined3d_device_parent
(
device_parent
);
TRACE
(
"device_parent %p, container_parent %p, wined3d_desc %p, texture_flags %#lx, wined3d_texture %p.
\n
"
,
device_parent
,
container_parent
,
wined3d_desc
,
texture_flags
,
wined3d_texture
);
return
wined3d_texture_create
(
device
->
wined3d_device
,
wined3d_desc
,
1
,
1
,
texture_flags
,
NULL
,
NULL
,
&
d3d_null_wined3d_parent_ops
,
wined3d_texture
);
}
static
const
struct
wined3d_device_parent_ops
d3d_wined3d_device_parent_ops
=
{
device_parent_wined3d_device_created
,
device_parent_mode_changed
,
device_parent_activate
,
device_parent_texture_sub_resource_created
,
device_parent_create_swapchain_texture
,
};
static
int
d3d_sampler_state_compare
(
const
void
*
key
,
const
struct
wine_rb_entry
*
entry
)
...
...
dlls/d3d8/device.c
View file @
c7d8a1b4
...
...
@@ -3624,33 +3624,12 @@ static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_d
return
D3D_OK
;
}
static
HRESULT
CDECL
device_parent_create_swapchain_texture
(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
const
struct
wined3d_resource_desc
*
desc
,
DWORD
texture_flags
,
struct
wined3d_texture
**
texture
)
{
struct
d3d8_device
*
device
=
device_from_device_parent
(
device_parent
);
HRESULT
hr
;
TRACE
(
"device_parent %p, container_parent %p, desc %p, texture flags %#lx, texture %p.
\n
"
,
device_parent
,
container_parent
,
desc
,
texture_flags
,
texture
);
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
->
wined3d_device
,
desc
,
1
,
1
,
texture_flags
,
NULL
,
NULL
,
&
d3d8_null_wined3d_parent_ops
,
texture
)))
{
WARN
(
"Failed to create texture, hr %#lx.
\n
"
,
hr
);
return
hr
;
}
return
hr
;
}
static
const
struct
wined3d_device_parent_ops
d3d8_wined3d_device_parent_ops
=
{
device_parent_wined3d_device_created
,
device_parent_mode_changed
,
device_parent_activate
,
device_parent_texture_sub_resource_created
,
device_parent_create_swapchain_texture
,
};
static
void
setup_fpu
(
void
)
...
...
dlls/d3d9/device.c
View file @
c7d8a1b4
...
...
@@ -4555,33 +4555,12 @@ static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_d
return
D3D_OK
;
}
static
HRESULT
CDECL
device_parent_create_swapchain_texture
(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
const
struct
wined3d_resource_desc
*
desc
,
DWORD
texture_flags
,
struct
wined3d_texture
**
texture
)
{
struct
d3d9_device
*
device
=
device_from_device_parent
(
device_parent
);
HRESULT
hr
;
TRACE
(
"device_parent %p, container_parent %p, desc %p, texture flags %#lx, texture %p.
\n
"
,
device_parent
,
container_parent
,
desc
,
texture_flags
,
texture
);
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
->
wined3d_device
,
desc
,
1
,
1
,
texture_flags
,
NULL
,
NULL
,
&
d3d9_null_wined3d_parent_ops
,
texture
)))
{
WARN
(
"Failed to create texture, hr %#lx.
\n
"
,
hr
);
return
hr
;
}
return
hr
;
}
static
const
struct
wined3d_device_parent_ops
d3d9_wined3d_device_parent_ops
=
{
device_parent_wined3d_device_created
,
device_parent_mode_changed
,
device_parent_activate
,
device_parent_texture_sub_resource_created
,
device_parent_create_swapchain_texture
,
};
static
void
setup_fpu
(
void
)
...
...
dlls/ddraw/ddraw.c
View file @
c7d8a1b4
...
...
@@ -5042,33 +5042,12 @@ static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_d
return
DD_OK
;
}
static
HRESULT
CDECL
device_parent_create_swapchain_texture
(
struct
wined3d_device_parent
*
device_parent
,
void
*
container_parent
,
const
struct
wined3d_resource_desc
*
desc
,
DWORD
texture_flags
,
struct
wined3d_texture
**
texture
)
{
struct
ddraw
*
ddraw
=
ddraw_from_device_parent
(
device_parent
);
HRESULT
hr
;
TRACE
(
"device_parent %p, container_parent %p, desc %p, texture flags %#lx, texture %p.
\n
"
,
device_parent
,
container_parent
,
desc
,
texture_flags
,
texture
);
if
(
FAILED
(
hr
=
wined3d_texture_create
(
ddraw
->
wined3d_device
,
desc
,
1
,
1
,
texture_flags
,
NULL
,
ddraw
,
&
ddraw_null_wined3d_parent_ops
,
texture
)))
{
WARN
(
"Failed to create texture, hr %#lx.
\n
"
,
hr
);
return
hr
;
}
return
hr
;
}
static
const
struct
wined3d_device_parent_ops
ddraw_wined3d_device_parent_ops
=
{
device_parent_wined3d_device_created
,
device_parent_mode_changed
,
device_parent_activate
,
device_parent_texture_sub_resource_created
,
device_parent_create_swapchain_texture
,
};
HRESULT
ddraw_init
(
struct
ddraw
*
ddraw
,
DWORD
flags
,
enum
wined3d_device_type
device_type
)
...
...
dlls/wined3d/device.c
View file @
c7d8a1b4
...
...
@@ -5993,8 +5993,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
texture_desc
.
depth
=
1
;
texture_desc
.
size
=
0
;
if
(
FAILED
(
hr
=
device
->
device_parent
->
ops
->
create_swapchain_texture
(
device
->
device_parent
,
device
->
device_parent
,
&
texture_desc
,
0
,
&
texture
)))
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
,
&
texture_desc
,
1
,
1
,
0
,
NULL
,
NULL
,
&
wined3d_null_parent_ops
,
&
texture
)))
{
ERR
(
"Failed to create the auto depth/stencil surface, hr %#lx.
\n
"
,
hr
);
return
WINED3DERR_INVALIDCALL
;
...
...
dlls/wined3d/swapchain.c
View file @
c7d8a1b4
...
...
@@ -1541,8 +1541,8 @@ static HRESULT wined3d_swapchain_init(struct wined3d_swapchain *swapchain, struc
if
(
swapchain
->
state
.
desc
.
flags
&
WINED3D_SWAPCHAIN_GDI_COMPATIBLE
)
texture_flags
|=
WINED3D_TEXTURE_CREATE_GET_DC
;
if
(
FAILED
(
hr
=
device
->
device_parent
->
ops
->
create_swapchain_texture
(
device
->
device_parent
,
parent
,
&
texture_desc
,
texture_flag
s
,
&
swapchain
->
front_buffer
)))
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
,
&
texture_desc
,
1
,
1
,
texture_flags
,
NULL
,
NULL
,
&
wined3d_null_parent_op
s
,
&
swapchain
->
front_buffer
)))
{
WARN
(
"Failed to create front buffer, hr %#lx.
\n
"
,
hr
);
goto
err
;
...
...
@@ -1587,8 +1587,8 @@ static HRESULT wined3d_swapchain_init(struct wined3d_swapchain *swapchain, struc
for
(
i
=
0
;
i
<
swapchain
->
state
.
desc
.
backbuffer_count
;
++
i
)
{
TRACE
(
"Creating back buffer %u.
\n
"
,
i
);
if
(
FAILED
(
hr
=
device
->
device_parent
->
ops
->
create_swapchain_texture
(
device
->
device_parent
,
parent
,
&
texture_desc
,
texture_flag
s
,
&
swapchain
->
back_buffers
[
i
])))
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
,
&
texture_desc
,
1
,
1
,
texture_flags
,
NULL
,
NULL
,
&
wined3d_null_parent_op
s
,
&
swapchain
->
back_buffers
[
i
])))
{
WARN
(
"Failed to create back buffer %u, hr %#lx.
\n
"
,
i
,
hr
);
swapchain
->
state
.
desc
.
backbuffer_count
=
i
;
...
...
@@ -1615,8 +1615,8 @@ static HRESULT wined3d_swapchain_init(struct wined3d_swapchain *swapchain, struc
else
texture_desc
.
access
=
WINED3D_RESOURCE_ACCESS_GPU
;
if
(
FAILED
(
hr
=
device
->
device_parent
->
ops
->
create_swapchain_texture
(
device
->
device_parent
,
device
->
device_parent
,
&
texture_desc
,
0
,
&
ds
)))
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
,
&
texture_desc
,
1
,
1
,
0
,
NULL
,
NULL
,
&
wined3d_null_parent_ops
,
&
ds
)))
{
WARN
(
"Failed to create the auto depth/stencil surface, hr %#lx.
\n
"
,
hr
);
goto
err
;
...
...
include/wine/wined3d.h
View file @
c7d8a1b4
...
...
@@ -2241,8 +2241,6 @@ struct wined3d_device_parent_ops
HRESULT
(
__cdecl
*
texture_sub_resource_created
)(
struct
wined3d_device_parent
*
device_parent
,
enum
wined3d_resource_type
type
,
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
void
**
parent
,
const
struct
wined3d_parent_ops
**
parent_ops
);
HRESULT
(
__cdecl
*
create_swapchain_texture
)(
struct
wined3d_device_parent
*
device_parent
,
void
*
parent
,
const
struct
wined3d_resource_desc
*
desc
,
DWORD
texture_flags
,
struct
wined3d_texture
**
texture
);
};
struct
wined3d_swapchain_state_parent
...
...
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