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
7a61760c
Commit
7a61760c
authored
Dec 24, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Move sysmem_fallback setting to ddraw_surface_create_wined3d_texture().
parent
fbcd01ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
surface.c
dlls/ddraw/surface.c
+14
-7
No files found.
dlls/ddraw/surface.c
View file @
7a61760c
...
...
@@ -6049,8 +6049,9 @@ static bool need_draw_texture(unsigned int draw_bind_flags, const struct wined3d
return
true
;
}
static
HRESULT
ddraw_surface_create_wined3d_texture
(
struct
ddraw
*
ddraw
,
unsigned
int
layers
,
unsigned
int
levels
,
struct
ddraw_texture
*
texture
,
struct
wined3d_texture
**
wined3d_texture
)
static
HRESULT
ddraw_surface_create_wined3d_texture
(
struct
ddraw
*
ddraw
,
unsigned
int
layers
,
unsigned
int
levels
,
struct
ddraw_texture
*
texture
,
bool
sysmem_fallback
,
struct
wined3d_texture
**
wined3d_texture
)
{
struct
wined3d_device
*
wined3d_device
=
ddraw
->
wined3d_device
;
const
DDSURFACEDESC2
*
desc
=
&
texture
->
surface_desc
;
...
...
@@ -6172,6 +6173,13 @@ static HRESULT ddraw_surface_create_wined3d_texture(struct ddraw *ddraw, unsigne
return
hr
;
}
for
(
i
=
0
;
i
<
layers
*
levels
;
++
i
)
{
struct
ddraw_surface
*
surface
=
wined3d_texture_get_sub_resource_parent
(
*
wined3d_texture
,
i
);
surface
->
sysmem_fallback
=
sysmem_fallback
;
}
wined3d_texture_decref
(
*
wined3d_texture
);
TRACE
(
"Surface %p, created draw_texture %p, wined3d_texture %p.
\n
"
,
...
...
@@ -6614,7 +6622,8 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
if
(
desc
->
ddsCaps
.
dwCaps2
&
DDSCAPS2_CUBEMAP
)
layers
=
6
;
if
(
FAILED
(
hr
=
ddraw_surface_create_wined3d_texture
(
ddraw
,
layers
,
levels
,
texture
,
&
wined3d_texture
)))
if
(
FAILED
(
hr
=
ddraw_surface_create_wined3d_texture
(
ddraw
,
layers
,
levels
,
texture
,
sysmem_fallback
,
&
wined3d_texture
)))
{
WARN
(
"Failed to create wined3d texture, hr %#lx.
\n
"
,
hr
);
heap_free
(
texture
);
...
...
@@ -6624,7 +6633,6 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
root
=
wined3d_texture_get_sub_resource_parent
(
wined3d_texture
,
0
);
root
->
is_root
=
TRUE
;
root
->
sysmem_fallback
=
sysmem_fallback
;
texture
->
root
=
root
;
wined3d_device_incref
(
texture
->
wined3d_device
=
ddraw
->
wined3d_device
);
...
...
@@ -6648,7 +6656,6 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
for
(
j
=
0
;
j
<
levels
;
++
j
)
{
mip
=
wined3d_texture_get_sub_resource_parent
(
wined3d_texture
,
i
*
levels
+
j
);
mip
->
sysmem_fallback
=
sysmem_fallback
;
mip_desc
=
&
mip
->
surface_desc
;
if
(
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_MIPMAP
)
mip_desc
->
u2
.
dwMipMapCount
=
levels
-
j
;
...
...
@@ -6739,7 +6746,8 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
desc
->
ddsCaps
.
dwCaps
|=
DDSCAPS_BACKBUFFER
;
desc
->
u5
.
dwBackBufferCount
=
0
;
if
(
FAILED
(
hr
=
ddraw_surface_create_wined3d_texture
(
ddraw
,
1
,
1
,
texture
,
&
wined3d_texture
)))
if
(
FAILED
(
hr
=
ddraw_surface_create_wined3d_texture
(
ddraw
,
1
,
1
,
texture
,
sysmem_fallback
,
&
wined3d_texture
)))
{
heap_free
(
texture
);
hr
=
hr_ddraw_from_wined3d
(
hr
);
...
...
@@ -6747,7 +6755,6 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
}
last
=
wined3d_texture_get_sub_resource_parent
(
wined3d_texture
,
0
);
last
->
sysmem_fallback
=
sysmem_fallback
;
texture
->
root
=
last
;
wined3d_device_incref
(
texture
->
wined3d_device
=
ddraw
->
wined3d_device
);
...
...
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