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
79f0b4d9
Commit
79f0b4d9
authored
Nov 19, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Avoid resetting device state for d3d9ex resets.
parent
0a7e2acc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
16 deletions
+38
-16
device.c
dlls/d3d8/device.c
+2
-1
device.c
dlls/d3d9/device.c
+4
-7
ddraw.c
dlls/ddraw/ddraw.c
+1
-1
device.c
dlls/wined3d/device.c
+29
-5
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-1
wined3d.h
include/wine/wined3d.h
+1
-1
No files found.
dlls/d3d8/device.c
View file @
79f0b4d9
...
...
@@ -597,7 +597,8 @@ static HRESULT WINAPI d3d8_device_Reset(IDirect3DDevice8 *iface,
wined3d_mutex_lock
();
wined3d_swapchain_desc_from_present_parameters
(
&
swapchain_desc
,
present_parameters
);
if
(
SUCCEEDED
(
hr
=
wined3d_device_reset
(
device
->
wined3d_device
,
&
swapchain_desc
,
NULL
,
reset_enum_callback
)))
if
(
SUCCEEDED
(
hr
=
wined3d_device_reset
(
device
->
wined3d_device
,
&
swapchain_desc
,
NULL
,
reset_enum_callback
,
TRUE
)))
{
wined3d_device_set_render_state
(
device
->
wined3d_device
,
WINED3D_RS_POINTSIZE_MIN
,
0
);
device
->
lost
=
FALSE
;
...
...
dlls/d3d9/device.c
View file @
79f0b4d9
...
...
@@ -582,8 +582,9 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_Reset(IDirect3DDevice9Ex *if
wined3d_mutex_lock
();
wined3d_swapchain_desc_from_present_parameters
(
&
swapchain_desc
,
present_parameters
);
hr
=
wined3d_device_reset
(
device
->
wined3d_device
,
&
swapchain_desc
,
NULL
,
reset_enum_callback
);
if
(
FAILED
(
hr
))
hr
=
wined3d_device_reset
(
device
->
wined3d_device
,
&
swapchain_desc
,
NULL
,
reset_enum_callback
,
!
device
->
d3d_parent
->
extended
);
if
(
FAILED
(
hr
)
&&
!
device
->
d3d_parent
->
extended
)
device
->
not_reset
=
TRUE
;
else
device
->
not_reset
=
FALSE
;
...
...
@@ -2907,11 +2908,7 @@ static HRESULT WINAPI d3d9_device_ResetEx(IDirect3DDevice9Ex *iface,
wined3d_mutex_lock
();
wined3d_swapchain_desc_from_present_parameters
(
&
swapchain_desc
,
present_parameters
);
hr
=
wined3d_device_reset
(
device
->
wined3d_device
,
&
swapchain_desc
,
mode
?
&
wined3d_mode
:
NULL
,
reset_enum_callback
);
if
(
FAILED
(
hr
))
device
->
not_reset
=
TRUE
;
else
device
->
not_reset
=
FALSE
;
mode
?
&
wined3d_mode
:
NULL
,
reset_enum_callback
,
FALSE
);
wined3d_mutex_unlock
();
return
hr
;
...
...
dlls/ddraw/ddraw.c
View file @
79f0b4d9
...
...
@@ -2867,7 +2867,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
swapchain_desc
.
backbuffer_format
=
mode
.
format_id
;
hr
=
wined3d_device_reset
(
ddraw
->
wined3d_device
,
&
swapchain_desc
,
NULL
,
ddraw_reset_enum_callback
);
&
swapchain_desc
,
NULL
,
ddraw_reset_enum_callback
,
TRUE
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to reset device.
\n
"
);
...
...
dlls/wined3d/device.c
View file @
79f0b4d9
...
...
@@ -4974,15 +4974,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru
/* Do not call while under the GL lock. */
HRESULT
CDECL
wined3d_device_reset
(
struct
wined3d_device
*
device
,
const
struct
wined3d_swapchain_desc
*
swapchain_desc
,
const
struct
wined3d_display_mode
*
mode
,
wined3d_device_reset_cb
callback
)
wined3d_device_reset_cb
callback
,
BOOL
reset_state
)
{
struct
wined3d_resource
*
resource
,
*
cursor
;
struct
wined3d_swapchain
*
swapchain
;
struct
wined3d_display_mode
m
;
BOOL
DisplayModeChanged
=
FALSE
;
BOOL
update_desc
=
FALSE
;
HRESULT
hr
=
WINED3D_OK
;
unsigned
int
i
;
HRESULT
hr
;
TRACE
(
"device %p, swapchain_desc %p, mode %p, callback %p.
\n
"
,
device
,
swapchain_desc
,
mode
,
callback
);
...
...
@@ -4992,7 +4992,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
return
WINED3DERR_INVALIDCALL
;
}
if
(
reset_state
)
stateblock_unbind_resources
(
device
->
stateBlock
);
if
(
device
->
fb
.
render_targets
)
{
if
(
swapchain
->
back_buffers
&&
swapchain
->
back_buffers
[
0
])
...
...
@@ -5012,12 +5014,15 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
device
->
onscreen_depth_stencil
=
NULL
;
}
if
(
reset_state
)
{
LIST_FOR_EACH_ENTRY_SAFE
(
resource
,
cursor
,
&
device
->
resources
,
struct
wined3d_resource
,
resource_list_entry
)
{
TRACE
(
"Enumerating resource %p.
\n
"
,
resource
);
if
(
FAILED
(
hr
=
callback
(
resource
)))
return
hr
;
}
}
/* Is it necessary to recreate the gl context? Actually every setting can be changed
* on an existing gl context, so there's no real need for recreation.
...
...
@@ -5067,8 +5072,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if
(
swapchain_desc
->
enable_auto_depth_stencil
&&
!
device
->
auto_depth_stencil
)
{
HRESULT
hr
;
TRACE
(
"Creating the depth stencil buffer
\n
"
);
if
(
FAILED
(
hr
=
device
->
device_parent
->
ops
->
create_swapchain_surface
(
device
->
device_parent
,
...
...
@@ -5222,6 +5225,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
device
->
exStyle
=
exStyle
;
}
if
(
reset_state
)
{
TRACE
(
"Resetting stateblock.
\n
"
);
wined3d_stateblock_decref
(
device
->
updateStateBlock
);
wined3d_stateblock_decref
(
device
->
stateBlock
);
...
...
@@ -5239,11 +5244,30 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_stateblock_incref
(
device
->
updateStateBlock
);
stateblock_init_default_state
(
device
->
stateBlock
);
}
else
{
struct
wined3d_surface
*
rt
=
device
->
fb
.
render_targets
[
0
];
struct
wined3d_state
*
state
=
&
device
->
stateBlock
->
state
;
/* Note the min_z / max_z is not reset. */
state
->
viewport
.
x
=
0
;
state
->
viewport
.
y
=
0
;
state
->
viewport
.
width
=
rt
->
resource
.
width
;
state
->
viewport
.
height
=
rt
->
resource
.
height
;
device_invalidate_state
(
device
,
STATE_VIEWPORT
);
state
->
scissor_rect
.
top
=
0
;
state
->
scissor_rect
.
left
=
0
;
state
->
scissor_rect
.
right
=
rt
->
resource
.
width
;
state
->
scissor_rect
.
bottom
=
rt
->
resource
.
height
;
device_invalidate_state
(
device
,
STATE_SCISSORRECT
);
}
swapchain_update_render_to_fbo
(
swapchain
);
swapchain_update_draw_bindings
(
swapchain
);
if
(
device
->
d3d_initialized
)
if
(
reset_state
&&
device
->
d3d_initialized
)
hr
=
create_primary_opengl_context
(
device
,
swapchain
);
/* All done. There is no need to reload resources or shaders, this will happen automatically on the
...
...
dlls/wined3d/wined3d.spec
View file @
79f0b4d9
...
...
@@ -102,7 +102,7 @@
@ cdecl wined3d_device_present(ptr ptr ptr ptr ptr long)
@ cdecl wined3d_device_process_vertices(ptr long long long ptr ptr long long)
@ cdecl wined3d_device_release_focus_window(ptr)
@ cdecl wined3d_device_reset(ptr ptr ptr ptr)
@ cdecl wined3d_device_reset(ptr ptr ptr ptr
long
)
@ cdecl wined3d_device_restore_fullscreen_window(ptr ptr)
@ cdecl wined3d_device_set_base_vertex_index(ptr long)
@ cdecl wined3d_device_set_clip_plane(ptr long ptr)
...
...
include/wine/wined3d.h
View file @
79f0b4d9
...
...
@@ -2184,7 +2184,7 @@ HRESULT __cdecl wined3d_device_process_vertices(struct wined3d_device *device,
void
__cdecl
wined3d_device_release_focus_window
(
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_reset
(
struct
wined3d_device
*
device
,
const
struct
wined3d_swapchain_desc
*
swapchain_desc
,
const
struct
wined3d_display_mode
*
mode
,
wined3d_device_reset_cb
callback
);
wined3d_device_reset_cb
callback
,
BOOL
reset_state
);
void
__cdecl
wined3d_device_restore_fullscreen_window
(
struct
wined3d_device
*
device
,
HWND
window
);
void
__cdecl
wined3d_device_set_base_vertex_index
(
struct
wined3d_device
*
device
,
INT
base_index
);
HRESULT
__cdecl
wined3d_device_set_clip_plane
(
struct
wined3d_device
*
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