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
fd3d4d0a
Commit
fd3d4d0a
authored
Apr 11, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
May 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Pass the container to d3d8_surface_create().
parent
9a6d889b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
d3d8_private.h
dlls/d3d8/d3d8_private.h
+1
-1
device.c
dlls/d3d8/device.c
+6
-5
surface.c
dlls/d3d8/surface.c
+3
-2
swapchain.c
dlls/d3d8/swapchain.c
+4
-2
No files found.
dlls/d3d8/d3d8_private.h
View file @
fd3d4d0a
...
@@ -203,7 +203,7 @@ struct d3d8_surface
...
@@ -203,7 +203,7 @@ struct d3d8_surface
struct
wined3d_rendertarget_view
*
d3d8_surface_acquire_rendertarget_view
(
struct
d3d8_surface
*
surface
)
DECLSPEC_HIDDEN
;
struct
wined3d_rendertarget_view
*
d3d8_surface_acquire_rendertarget_view
(
struct
d3d8_surface
*
surface
)
DECLSPEC_HIDDEN
;
struct
d3d8_surface
*
d3d8_surface_create
(
struct
wined3d_texture
*
wined3d_texture
,
struct
d3d8_surface
*
d3d8_surface_create
(
struct
wined3d_texture
*
wined3d_texture
,
unsigned
int
sub_resource_idx
)
DECLSPEC_HIDDEN
;
unsigned
int
sub_resource_idx
,
IUnknown
*
container
)
DECLSPEC_HIDDEN
;
struct
d3d8_device
*
d3d8_surface_get_device
(
const
struct
d3d8_surface
*
surface
)
DECLSPEC_HIDDEN
;
struct
d3d8_device
*
d3d8_surface_get_device
(
const
struct
d3d8_surface
*
surface
)
DECLSPEC_HIDDEN
;
void
d3d8_surface_release_rendertarget_view
(
struct
d3d8_surface
*
surface
,
void
d3d8_surface_release_rendertarget_view
(
struct
d3d8_surface
*
surface
,
struct
wined3d_rendertarget_view
*
rtv
)
DECLSPEC_HIDDEN
;
struct
wined3d_rendertarget_view
*
rtv
)
DECLSPEC_HIDDEN
;
...
...
dlls/d3d8/device.c
View file @
fd3d4d0a
...
@@ -989,7 +989,8 @@ static HRESULT WINAPI d3d8_device_Reset(IDirect3DDevice8 *iface,
...
@@ -989,7 +989,8 @@ static HRESULT WINAPI d3d8_device_Reset(IDirect3DDevice8 *iface,
struct
wined3d_resource
*
resource
=
wined3d_rendertarget_view_get_resource
(
rtv
);
struct
wined3d_resource
*
resource
=
wined3d_rendertarget_view_get_resource
(
rtv
);
struct
d3d8_surface
*
surface
;
struct
d3d8_surface
*
surface
;
if
((
surface
=
d3d8_surface_create
(
wined3d_texture_from_resource
(
resource
),
0
)))
if
((
surface
=
d3d8_surface_create
(
wined3d_texture_from_resource
(
resource
),
0
,
(
IUnknown
*
)
&
device
->
IDirect3DDevice8_iface
)))
surface
->
parent_device
=
&
device
->
IDirect3DDevice8_iface
;
surface
->
parent_device
=
&
device
->
IDirect3DDevice8_iface
;
}
}
...
@@ -1121,7 +1122,7 @@ static HRESULT WINAPI d3d8_device_CreateTexture(IDirect3DDevice8 *iface,
...
@@ -1121,7 +1122,7 @@ static HRESULT WINAPI d3d8_device_CreateTexture(IDirect3DDevice8 *iface,
levels
=
wined3d_texture_get_level_count
(
object
->
wined3d_texture
);
levels
=
wined3d_texture_get_level_count
(
object
->
wined3d_texture
);
for
(
i
=
0
;
i
<
levels
;
++
i
)
for
(
i
=
0
;
i
<
levels
;
++
i
)
{
{
if
(
!
d3d8_surface_create
(
object
->
wined3d_texture
,
i
))
if
(
!
d3d8_surface_create
(
object
->
wined3d_texture
,
i
,
(
IUnknown
*
)
&
object
->
IDirect3DBaseTexture8_iface
))
{
{
IDirect3DTexture8_Release
(
&
object
->
IDirect3DBaseTexture8_iface
);
IDirect3DTexture8_Release
(
&
object
->
IDirect3DBaseTexture8_iface
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -1195,7 +1196,7 @@ static HRESULT WINAPI d3d8_device_CreateCubeTexture(IDirect3DDevice8 *iface, UIN
...
@@ -1195,7 +1196,7 @@ static HRESULT WINAPI d3d8_device_CreateCubeTexture(IDirect3DDevice8 *iface, UIN
levels
=
wined3d_texture_get_level_count
(
object
->
wined3d_texture
);
levels
=
wined3d_texture_get_level_count
(
object
->
wined3d_texture
);
for
(
i
=
0
;
i
<
levels
*
6
;
++
i
)
for
(
i
=
0
;
i
<
levels
*
6
;
++
i
)
{
{
if
(
!
d3d8_surface_create
(
object
->
wined3d_texture
,
i
))
if
(
!
d3d8_surface_create
(
object
->
wined3d_texture
,
i
,
(
IUnknown
*
)
&
object
->
IDirect3DBaseTexture8_iface
))
{
{
IDirect3DTexture8_Release
(
&
object
->
IDirect3DBaseTexture8_iface
);
IDirect3DTexture8_Release
(
&
object
->
IDirect3DBaseTexture8_iface
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -1297,7 +1298,7 @@ static HRESULT d3d8_device_create_surface(struct d3d8_device *device, enum wined
...
@@ -1297,7 +1298,7 @@ static HRESULT d3d8_device_create_surface(struct d3d8_device *device, enum wined
return
hr
;
return
hr
;
}
}
if
(
!
(
surface_impl
=
d3d8_surface_create
(
texture
,
0
)))
if
(
!
(
surface_impl
=
d3d8_surface_create
(
texture
,
0
,
NULL
)))
{
{
wined3d_texture_decref
(
texture
);
wined3d_texture_decref
(
texture
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
...
@@ -3634,7 +3635,7 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic
...
@@ -3634,7 +3635,7 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic
device_parent
,
container_parent
,
desc
,
texture_flags
,
texture
);
device_parent
,
container_parent
,
desc
,
texture_flags
,
texture
);
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
->
wined3d_device
,
desc
,
1
,
1
,
texture_flags
,
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
->
wined3d_device
,
desc
,
1
,
1
,
texture_flags
,
NULL
,
&
device
->
IDirect3DDevice8_iface
,
&
d3d8_null_wined3d_parent_ops
,
texture
)))
NULL
,
NULL
,
&
d3d8_null_wined3d_parent_ops
,
texture
)))
{
{
WARN
(
"Failed to create texture, hr %#lx.
\n
"
,
hr
);
WARN
(
"Failed to create texture, hr %#lx.
\n
"
,
hr
);
return
hr
;
return
hr
;
...
...
dlls/d3d8/surface.c
View file @
fd3d4d0a
...
@@ -309,7 +309,8 @@ static const struct wined3d_parent_ops d3d8_surface_wined3d_parent_ops =
...
@@ -309,7 +309,8 @@ static const struct wined3d_parent_ops d3d8_surface_wined3d_parent_ops =
surface_wined3d_object_destroyed
,
surface_wined3d_object_destroyed
,
};
};
struct
d3d8_surface
*
d3d8_surface_create
(
struct
wined3d_texture
*
wined3d_texture
,
unsigned
int
sub_resource_idx
)
struct
d3d8_surface
*
d3d8_surface_create
(
struct
wined3d_texture
*
wined3d_texture
,
unsigned
int
sub_resource_idx
,
IUnknown
*
container
)
{
{
IDirect3DBaseTexture8
*
texture
;
IDirect3DBaseTexture8
*
texture
;
struct
d3d8_surface
*
surface
;
struct
d3d8_surface
*
surface
;
...
@@ -321,7 +322,7 @@ struct d3d8_surface *d3d8_surface_create(struct wined3d_texture *wined3d_texture
...
@@ -321,7 +322,7 @@ struct d3d8_surface *d3d8_surface_create(struct wined3d_texture *wined3d_texture
d3d8_resource_init
(
&
surface
->
resource
);
d3d8_resource_init
(
&
surface
->
resource
);
surface
->
resource
.
refcount
=
0
;
surface
->
resource
.
refcount
=
0
;
list_init
(
&
surface
->
rtv_entry
);
list_init
(
&
surface
->
rtv_entry
);
surface
->
container
=
wined3d_texture_get_parent
(
wined3d_texture
)
;
surface
->
container
=
container
;
surface
->
wined3d_texture
=
wined3d_texture
;
surface
->
wined3d_texture
=
wined3d_texture
;
surface
->
sub_resource_idx
=
sub_resource_idx
;
surface
->
sub_resource_idx
=
sub_resource_idx
;
...
...
dlls/d3d8/swapchain.c
View file @
fd3d4d0a
...
@@ -211,7 +211,8 @@ HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapcha
...
@@ -211,7 +211,8 @@ HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapcha
for
(
i
=
0
;
i
<
desc
->
backbuffer_count
;
++
i
)
for
(
i
=
0
;
i
<
desc
->
backbuffer_count
;
++
i
)
{
{
if
(
!
(
surface
=
d3d8_surface_create
(
wined3d_swapchain_get_back_buffer
(
object
->
wined3d_swapchain
,
i
),
0
)))
if
(
!
(
surface
=
d3d8_surface_create
(
wined3d_swapchain_get_back_buffer
(
object
->
wined3d_swapchain
,
i
),
0
,
(
IUnknown
*
)
&
device
->
IDirect3DDevice8_iface
)))
{
{
IDirect3DSwapChain8_Release
(
&
object
->
IDirect3DSwapChain8_iface
);
IDirect3DSwapChain8_Release
(
&
object
->
IDirect3DSwapChain8_iface
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -224,7 +225,8 @@ HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapcha
...
@@ -224,7 +225,8 @@ HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapcha
{
{
struct
wined3d_resource
*
resource
=
wined3d_rendertarget_view_get_resource
(
wined3d_dsv
);
struct
wined3d_resource
*
resource
=
wined3d_rendertarget_view_get_resource
(
wined3d_dsv
);
if
(
!
(
surface
=
d3d8_surface_create
(
wined3d_texture_from_resource
(
resource
),
0
)))
if
(
!
(
surface
=
d3d8_surface_create
(
wined3d_texture_from_resource
(
resource
),
0
,
(
IUnknown
*
)
&
device
->
IDirect3DDevice8_iface
)))
{
{
IDirect3DSwapChain8_Release
(
&
object
->
IDirect3DSwapChain8_iface
);
IDirect3DSwapChain8_Release
(
&
object
->
IDirect3DSwapChain8_iface
);
return
E_OUTOFMEMORY
;
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