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
ba99b0d7
Commit
ba99b0d7
authored
Apr 10, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Pass the container to d3d9_surface_create().
parent
7b719533
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
13 deletions
+14
-13
d3d9_private.h
dlls/d3d9/d3d9_private.h
+1
-1
device.c
dlls/d3d9/device.c
+6
-8
surface.c
dlls/d3d9/surface.c
+3
-2
swapchain.c
dlls/d3d9/swapchain.c
+4
-2
No files found.
dlls/d3d9/d3d9_private.h
View file @
ba99b0d7
...
...
@@ -180,7 +180,7 @@ struct d3d9_surface
struct
wined3d_rendertarget_view
*
d3d9_surface_acquire_rendertarget_view
(
struct
d3d9_surface
*
surface
)
DECLSPEC_HIDDEN
;
struct
d3d9_surface
*
d3d9_surface_create
(
struct
wined3d_texture
*
wined3d_texture
,
unsigned
int
sub_resource_idx
)
DECLSPEC_HIDDEN
;
unsigned
int
sub_resource_idx
,
IUnknown
*
container
)
DECLSPEC_HIDDEN
;
struct
d3d9_device
*
d3d9_surface_get_device
(
const
struct
d3d9_surface
*
surface
)
DECLSPEC_HIDDEN
;
void
d3d9_surface_release_rendertarget_view
(
struct
d3d9_surface
*
surface
,
struct
wined3d_rendertarget_view
*
rtv
)
DECLSPEC_HIDDEN
;
...
...
dlls/d3d9/device.c
View file @
ba99b0d7
...
...
@@ -1148,7 +1148,8 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device,
struct
wined3d_resource
*
resource
=
wined3d_rendertarget_view_get_resource
(
rtv
);
struct
d3d9_surface
*
surface
;
if
((
surface
=
d3d9_surface_create
(
wined3d_texture_from_resource
(
resource
),
0
)))
if
((
surface
=
d3d9_surface_create
(
wined3d_texture_from_resource
(
resource
),
0
,
(
IUnknown
*
)
&
device
->
IDirect3DDevice9Ex_iface
)))
surface
->
parent_device
=
&
device
->
IDirect3DDevice9Ex_iface
;
}
}
...
...
@@ -1353,7 +1354,7 @@ static HRESULT WINAPI d3d9_device_CreateTexture(IDirect3DDevice9Ex *iface,
levels
=
wined3d_texture_get_level_count
(
object
->
wined3d_texture
);
for
(
i
=
0
;
i
<
levels
;
++
i
)
{
if
(
!
d3d9_surface_create
(
object
->
wined3d_texture
,
i
))
if
(
!
d3d9_surface_create
(
object
->
wined3d_texture
,
i
,
(
IUnknown
*
)
&
object
->
IDirect3DBaseTexture9_iface
))
{
IDirect3DTexture9_Release
(
&
object
->
IDirect3DBaseTexture9_iface
);
return
E_OUTOFMEMORY
;
...
...
@@ -1456,7 +1457,7 @@ static HRESULT WINAPI d3d9_device_CreateCubeTexture(IDirect3DDevice9Ex *iface,
levels
=
wined3d_texture_get_level_count
(
object
->
wined3d_texture
);
for
(
i
=
0
;
i
<
levels
*
6
;
++
i
)
{
if
(
!
d3d9_surface_create
(
object
->
wined3d_texture
,
i
))
if
(
!
d3d9_surface_create
(
object
->
wined3d_texture
,
i
,
(
IUnknown
*
)
&
object
->
IDirect3DBaseTexture9_iface
))
{
IDirect3DTexture9_Release
(
&
object
->
IDirect3DBaseTexture9_iface
);
return
E_OUTOFMEMORY
;
...
...
@@ -1599,7 +1600,7 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, unsigned i
return
hr
;
}
if
(
!
(
surface_impl
=
d3d9_surface_create
(
texture
,
0
)))
if
(
!
(
surface_impl
=
d3d9_surface_create
(
texture
,
0
,
NULL
)))
{
wined3d_texture_decref
(
texture
);
wined3d_mutex_unlock
();
...
...
@@ -4564,11 +4565,8 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic
TRACE
(
"device_parent %p, container_parent %p, desc %p, texture flags %#lx, texture %p.
\n
"
,
device_parent
,
container_parent
,
desc
,
texture_flags
,
texture
);
if
(
container_parent
==
device_parent
)
container_parent
=
&
device
->
IDirect3DDevice9Ex_iface
;
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
->
wined3d_device
,
desc
,
1
,
1
,
texture_flags
,
NULL
,
container_parent
,
&
d3d9_null_wined3d_parent_ops
,
texture
)))
texture_flags
,
NULL
,
NULL
,
&
d3d9_null_wined3d_parent_ops
,
texture
)))
{
WARN
(
"Failed to create texture, hr %#lx.
\n
"
,
hr
);
return
hr
;
...
...
dlls/d3d9/surface.c
View file @
ba99b0d7
...
...
@@ -347,7 +347,8 @@ static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops =
surface_wined3d_object_destroyed
,
};
struct
d3d9_surface
*
d3d9_surface_create
(
struct
wined3d_texture
*
wined3d_texture
,
unsigned
int
sub_resource_idx
)
struct
d3d9_surface
*
d3d9_surface_create
(
struct
wined3d_texture
*
wined3d_texture
,
unsigned
int
sub_resource_idx
,
IUnknown
*
container
)
{
IDirect3DBaseTexture9
*
texture
;
struct
d3d9_surface
*
surface
;
...
...
@@ -359,7 +360,7 @@ struct d3d9_surface *d3d9_surface_create(struct wined3d_texture *wined3d_texture
d3d9_resource_init
(
&
surface
->
resource
);
surface
->
resource
.
refcount
=
0
;
list_init
(
&
surface
->
rtv_entry
);
surface
->
container
=
wined3d_texture_get_parent
(
wined3d_texture
)
;
surface
->
container
=
container
;
surface
->
wined3d_texture
=
wined3d_texture
;
surface
->
sub_resource_idx
=
sub_resource_idx
;
...
...
dlls/d3d9/swapchain.c
View file @
ba99b0d7
...
...
@@ -411,7 +411,8 @@ HRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapcha
for
(
i
=
0
;
i
<
desc
->
backbuffer_count
;
++
i
)
{
if
(
!
(
surface
=
d3d9_surface_create
(
wined3d_swapchain_get_back_buffer
(
object
->
wined3d_swapchain
,
i
),
0
)))
if
(
!
(
surface
=
d3d9_surface_create
(
wined3d_swapchain_get_back_buffer
(
object
->
wined3d_swapchain
,
i
),
0
,
(
IUnknown
*
)
&
object
->
IDirect3DSwapChain9Ex_iface
)))
{
IDirect3DSwapChain9Ex_Release
(
&
object
->
IDirect3DSwapChain9Ex_iface
);
return
E_OUTOFMEMORY
;
...
...
@@ -424,7 +425,8 @@ HRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapcha
{
struct
wined3d_resource
*
resource
=
wined3d_rendertarget_view_get_resource
(
wined3d_dsv
);
if
(
!
(
surface
=
d3d9_surface_create
(
wined3d_texture_from_resource
(
resource
),
0
)))
if
(
!
(
surface
=
d3d9_surface_create
(
wined3d_texture_from_resource
(
resource
),
0
,
(
IUnknown
*
)
&
device
->
IDirect3DDevice9Ex_iface
)))
{
IDirect3DSwapChain9Ex_Release
(
&
object
->
IDirect3DSwapChain9Ex_iface
);
return
E_OUTOFMEMORY
;
...
...
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