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
b7ed6b9b
Commit
b7ed6b9b
authored
Mar 14, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the "container" field from struct wined3d_surface.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
50920453
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
41 deletions
+32
-41
cs.c
dlls/wined3d/cs.c
+5
-7
device.c
dlls/wined3d/device.c
+17
-8
swapchain.c
dlls/wined3d/swapchain.c
+10
-10
texture.c
dlls/wined3d/texture.c
+0
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-15
No files found.
dlls/wined3d/cs.c
View file @
b7ed6b9b
...
...
@@ -1011,16 +1011,14 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
struct
wined3d_device
*
device
=
cs
->
device
;
struct
wined3d_rendertarget_view
*
prev
;
if
((
prev
=
cs
->
state
.
fb
->
depth_stencil
))
if
((
prev
=
cs
->
state
.
fb
->
depth_stencil
)
&&
prev
->
resource
->
type
!=
WINED3D_RTYPE_BUFFER
)
{
struct
wined3d_
surface
*
prev_surface
=
wined3d_rendertarget_view_get_surface
(
prev
);
struct
wined3d_
texture
*
prev_texture
=
texture_from_resource
(
prev
->
resource
);
if
(
prev_surface
&&
(
device
->
swapchains
[
0
]
->
desc
.
flags
&
WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL
||
prev_surface
->
container
->
flags
&
WINED3D_TEXTURE_DISCARD
))
{
wined3d_texture_validate_location
(
prev_surface
->
container
,
if
(
device
->
swapchains
[
0
]
->
desc
.
flags
&
WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL
||
prev_texture
->
flags
&
WINED3D_TEXTURE_DISCARD
)
wined3d_texture_validate_location
(
prev_texture
,
prev
->
sub_resource_idx
,
WINED3D_LOCATION_DISCARDED
);
}
}
cs
->
fb
.
depth_stencil
=
op
->
view
;
...
...
dlls/wined3d/device.c
View file @
b7ed6b9b
...
...
@@ -226,11 +226,11 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
float
depth
,
DWORD
stencil
)
{
struct
wined3d_rendertarget_view
*
rtv
=
rt_count
?
fb
->
render_targets
[
0
]
:
NULL
;
struct
wined3d_surface
*
target
=
rtv
?
wined3d_rendertarget_view_get_surface
(
rtv
)
:
NULL
;
struct
wined3d_rendertarget_view
*
dsv
=
fb
->
depth_stencil
;
struct
wined3d_surface
*
depth_stencil
=
dsv
?
wined3d_rendertarget_view_get_surface
(
dsv
)
:
NULL
;
const
struct
wined3d_state
*
state
=
&
device
->
cs
->
state
;
struct
wined3d_texture
*
depth_stencil
=
NULL
;
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_texture
*
target
=
NULL
;
UINT
drawable_width
,
drawable_height
;
struct
wined3d_color
corrected_color
;
struct
wined3d_context
*
context
;
...
...
@@ -238,10 +238,19 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
BOOL
render_offscreen
;
unsigned
int
i
;
if
(
target
)
context
=
context_acquire
(
device
,
target
->
container
,
rtv
->
sub_resource_idx
);
if
(
rtv
&&
rtv
->
resource
->
type
!=
WINED3D_RTYPE_BUFFER
)
{
target
=
texture_from_resource
(
rtv
->
resource
);
context
=
context_acquire
(
device
,
target
,
rtv
->
sub_resource_idx
);
}
else
{
context
=
context_acquire
(
device
,
NULL
,
0
);
}
if
(
dsv
&&
dsv
->
resource
->
type
!=
WINED3D_RTYPE_BUFFER
)
depth_stencil
=
texture_from_resource
(
dsv
->
resource
);
if
(
!
context
->
valid
)
{
context_release
(
context
);
...
...
@@ -281,11 +290,11 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
}
else
{
unsigned
int
ds_level
=
dsv
->
sub_resource_idx
%
depth_stencil
->
container
->
level_count
;
unsigned
int
ds_level
=
dsv
->
sub_resource_idx
%
depth_stencil
->
level_count
;
render_offscreen
=
TRUE
;
drawable_width
=
wined3d_texture_get_level_pow2_width
(
depth_stencil
->
container
,
ds_level
);
drawable_height
=
wined3d_texture_get_level_pow2_height
(
depth_stencil
->
container
,
ds_level
);
drawable_width
=
wined3d_texture_get_level_pow2_width
(
depth_stencil
,
ds_level
);
drawable_height
=
wined3d_texture_get_level_pow2_height
(
depth_stencil
,
ds_level
);
}
if
(
depth_stencil
)
...
...
@@ -449,7 +458,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
}
if
(
wined3d_settings
.
strict_draw_ordering
||
(
flags
&
WINED3DCLEAR_TARGET
&&
target
->
container
->
swapchain
&&
target
->
container
->
swapchain
->
front_buffer
==
target
->
container
))
&&
target
->
swapchain
&&
target
->
swapchain
->
front_buffer
==
target
))
gl_info
->
gl_ops
.
gl
.
p_glFlush
();
/* Flush to ensure ordering across contexts. */
context_release
(
context
);
...
...
dlls/wined3d/swapchain.c
View file @
b7ed6b9b
...
...
@@ -385,6 +385,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
{
struct
wined3d_texture
*
back_buffer
=
swapchain
->
back_buffers
[
0
];
const
struct
wined3d_fb_state
*
fb
=
&
swapchain
->
device
->
cs
->
fb
;
struct
wined3d_rendertarget_view
*
dsv
=
fb
->
depth_stencil
;
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_texture
*
logo_texture
;
struct
wined3d_context
*
context
;
...
...
@@ -509,14 +510,13 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
wined3d_texture_validate_location
(
swapchain
->
back_buffers
[
swapchain
->
desc
.
backbuffer_count
-
1
],
0
,
WINED3D_LOCATION_DISCARDED
);
if
(
fb
->
depth_stencil
)
if
(
dsv
&&
dsv
->
resource
->
type
!=
WINED3D_RTYPE_BUFFER
)
{
struct
wined3d_
surface
*
ds
=
wined3d_rendertarget_view_get_surface
(
fb
->
depth_stencil
);
struct
wined3d_
texture
*
ds
=
texture_from_resource
(
dsv
->
resource
);
if
(
ds
&&
(
swapchain
->
desc
.
flags
&
WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL
||
ds
->
container
->
flags
&
WINED3D_TEXTURE_DISCARD
))
wined3d_texture_validate_location
(
ds
->
container
,
fb
->
depth_stencil
->
sub_resource_idx
,
WINED3D_LOCATION_DISCARDED
);
if
((
swapchain
->
desc
.
flags
&
WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL
||
ds
->
flags
&
WINED3D_TEXTURE_DISCARD
))
wined3d_texture_validate_location
(
ds
,
dsv
->
sub_resource_idx
,
WINED3D_LOCATION_DISCARDED
);
}
context_release
(
context
);
...
...
@@ -553,7 +553,7 @@ static void swapchain_gdi_frontbuffer_updated(struct wined3d_swapchain *swapchai
if
(
swapchain
->
palette
)
wined3d_palette_apply_to_dc
(
swapchain
->
palette
,
front
->
dc
);
if
(
front
->
contain
er
->
resource
.
map_count
)
if
(
swapchain
->
front_buff
er
->
resource
.
map_count
)
ERR
(
"Trying to blit a mapped surface.
\n
"
);
TRACE
(
"Copying surface %p to screen.
\n
"
,
front
);
...
...
@@ -595,15 +595,15 @@ static void swapchain_gdi_present(struct wined3d_swapchain *swapchain,
/* Flip the surface data. */
dc
=
front
->
dc
;
bitmap
=
front
->
bitmap
;
data
=
front
->
contain
er
->
resource
.
heap_memory
;
data
=
swapchain
->
front_buff
er
->
resource
.
heap_memory
;
front
->
dc
=
back
->
dc
;
front
->
bitmap
=
back
->
bitmap
;
front
->
container
->
resource
.
heap_memory
=
back
->
container
->
resource
.
heap_memory
;
swapchain
->
front_buffer
->
resource
.
heap_memory
=
swapchain
->
back_buffers
[
0
]
->
resource
.
heap_memory
;
back
->
dc
=
dc
;
back
->
bitmap
=
bitmap
;
back
->
container
->
resource
.
heap_memory
=
data
;
swapchain
->
back_buffers
[
0
]
->
resource
.
heap_memory
=
data
;
/* FPS support */
if
(
TRACE_ON
(
fps
))
...
...
dlls/wined3d/texture.c
View file @
b7ed6b9b
...
...
@@ -2365,7 +2365,6 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
struct
wined3d_surface
*
surface
;
surface
=
&
surfaces
[
idx
];
surface
->
container
=
texture
;
sub_resource
=
&
texture
->
sub_resources
[
idx
];
sub_resource
->
locations
=
WINED3D_LOCATION_DISCARDED
;
...
...
dlls/wined3d/wined3d_private.h
View file @
b7ed6b9b
...
...
@@ -3337,8 +3337,6 @@ struct fbo_entry
struct
wined3d_surface
{
struct
wined3d_texture
*
container
;
/* For GetDC */
HBITMAP
bitmap
;
HDC
dc
;
...
...
@@ -3716,19 +3714,6 @@ struct wined3d_rendertarget_view
struct
wined3d_view_desc
desc
;
};
static
inline
struct
wined3d_surface
*
wined3d_rendertarget_view_get_surface
(
const
struct
wined3d_rendertarget_view
*
view
)
{
struct
wined3d_texture
*
texture
;
if
(
!
view
||
view
->
resource
->
type
!=
WINED3D_RTYPE_TEXTURE_2D
)
return
NULL
;
texture
=
texture_from_resource
(
view
->
resource
);
return
texture
->
sub_resources
[
view
->
sub_resource_idx
].
u
.
surface
;
}
void
wined3d_rendertarget_view_get_drawable_size
(
const
struct
wined3d_rendertarget_view
*
view
,
const
struct
wined3d_context
*
context
,
unsigned
int
*
width
,
unsigned
int
*
height
)
DECLSPEC_HIDDEN
;
void
wined3d_rendertarget_view_invalidate_location
(
struct
wined3d_rendertarget_view
*
view
,
...
...
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