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
f74de8e0
Commit
f74de8e0
authored
Dec 27, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Retrieve the frontbuffer directly from wined3d.
parent
83518a68
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
24 deletions
+3
-24
ddraw.c
dlls/ddraw/ddraw.c
+2
-22
ddraw_private.h
dlls/ddraw/ddraw_private.h
+0
-1
surface.c
dlls/ddraw/surface.c
+1
-1
No files found.
dlls/ddraw/ddraw.c
View file @
f74de8e0
...
@@ -938,7 +938,7 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window,
...
@@ -938,7 +938,7 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window,
}
}
rtv
=
wined3d_device_context_get_rendertarget_view
(
ddraw
->
immediate_context
,
0
);
rtv
=
wined3d_device_context_get_rendertarget_view
(
ddraw
->
immediate_context
,
0
);
/* Rendering to
ddraw->wined3d_
frontbuffer. */
/* Rendering to
the wined3d
frontbuffer. */
if
(
rtv
&&
!
wined3d_rendertarget_view_get_sub_resource_parent
(
rtv
))
if
(
rtv
&&
!
wined3d_rendertarget_view_get_sub_resource_parent
(
rtv
))
rtv
=
NULL
;
rtv
=
NULL
;
else
if
(
rtv
)
else
if
(
rtv
)
...
@@ -5042,43 +5042,23 @@ static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_d
...
@@ -5042,43 +5042,23 @@ static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_d
return
DD_OK
;
return
DD_OK
;
}
}
static
void
STDMETHODCALLTYPE
ddraw_frontbuffer_destroyed
(
void
*
parent
)
{
struct
ddraw
*
ddraw
=
parent
;
ddraw
->
wined3d_frontbuffer
=
NULL
;
}
static
const
struct
wined3d_parent_ops
ddraw_frontbuffer_parent_ops
=
{
ddraw_frontbuffer_destroyed
,
};
static
HRESULT
CDECL
device_parent_create_swapchain_texture
(
struct
wined3d_device_parent
*
device_parent
,
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
,
void
*
container_parent
,
const
struct
wined3d_resource_desc
*
desc
,
DWORD
texture_flags
,
struct
wined3d_texture
**
texture
)
struct
wined3d_texture
**
texture
)
{
{
struct
ddraw
*
ddraw
=
ddraw_from_device_parent
(
device_parent
);
struct
ddraw
*
ddraw
=
ddraw_from_device_parent
(
device_parent
);
const
struct
wined3d_parent_ops
*
parent_ops
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"device_parent %p, container_parent %p, desc %p, texture flags %#lx, texture %p.
\n
"
,
TRACE
(
"device_parent %p, container_parent %p, desc %p, texture flags %#lx, texture %p.
\n
"
,
device_parent
,
container_parent
,
desc
,
texture_flags
,
texture
);
device_parent
,
container_parent
,
desc
,
texture_flags
,
texture
);
if
(
!
ddraw
->
wined3d_frontbuffer
)
parent_ops
=
&
ddraw_frontbuffer_parent_ops
;
else
parent_ops
=
&
ddraw_null_wined3d_parent_ops
;
if
(
FAILED
(
hr
=
wined3d_texture_create
(
ddraw
->
wined3d_device
,
desc
,
1
,
1
,
if
(
FAILED
(
hr
=
wined3d_texture_create
(
ddraw
->
wined3d_device
,
desc
,
1
,
1
,
texture_flags
,
NULL
,
ddraw
,
parent_ops
,
texture
)))
texture_flags
,
NULL
,
ddraw
,
&
ddraw_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
;
}
}
if
(
!
ddraw
->
wined3d_frontbuffer
)
ddraw
->
wined3d_frontbuffer
=
*
texture
;
return
hr
;
return
hr
;
}
}
...
...
dlls/ddraw/ddraw_private.h
View file @
f74de8e0
...
@@ -103,7 +103,6 @@ struct ddraw
...
@@ -103,7 +103,6 @@ struct ddraw
struct
ddraw_surface
*
primary
;
struct
ddraw_surface
*
primary
;
RECT
primary_lock
;
RECT
primary_lock
;
struct
wined3d_texture
*
wined3d_frontbuffer
;
struct
wined3d_texture
*
gdi_surface
;
struct
wined3d_texture
*
gdi_surface
;
struct
wined3d_swapchain
*
wined3d_swapchain
;
struct
wined3d_swapchain
*
wined3d_swapchain
;
struct
wined3d_swapchain_state_parent
state_parent
;
struct
wined3d_swapchain_state_parent
state_parent
;
...
...
dlls/ddraw/surface.c
View file @
f74de8e0
...
@@ -133,7 +133,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface,
...
@@ -133,7 +133,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface,
if
(
swap_interval
)
if
(
swap_interval
)
dst_texture
=
wined3d_swapchain_get_back_buffer
(
ddraw
->
wined3d_swapchain
,
0
);
dst_texture
=
wined3d_swapchain_get_back_buffer
(
ddraw
->
wined3d_swapchain
,
0
);
else
else
dst_texture
=
ddraw
->
wined3d_frontbuffer
;
dst_texture
=
wined3d_swapchain_get_front_buffer
(
ddraw
->
wined3d_swapchain
)
;
if
(
SUCCEEDED
(
hr
=
wined3d_device_context_blt
(
ddraw
->
immediate_context
,
dst_texture
,
0
,
rect
,
if
(
SUCCEEDED
(
hr
=
wined3d_device_context_blt
(
ddraw
->
immediate_context
,
dst_texture
,
0
,
rect
,
ddraw_surface_get_any_texture
(
surface
,
DDRAW_SURFACE_READ
),
surface
->
sub_resource_idx
,
rect
,
0
,
ddraw_surface_get_any_texture
(
surface
,
DDRAW_SURFACE_READ
),
surface
->
sub_resource_idx
,
rect
,
0
,
...
...
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