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
8866d733
Commit
8866d733
authored
Sep 25, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a function to initialize swapchain specific device state.
parent
cfe16a4b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
36 deletions
+20
-36
device.c
dlls/wined3d/device.c
+19
-32
stateblock.c
dlls/wined3d/stateblock.c
+1
-4
No files found.
dlls/wined3d/device.c
View file @
8866d733
...
...
@@ -827,21 +827,23 @@ void CDECL wined3d_device_release_focus_window(struct wined3d_device *device)
InterlockedExchangePointer
((
void
**
)
&
device
->
focus_window
,
NULL
);
}
static
void
device_
reset_viewport_scissor
(
struct
wined3d_device
*
device
,
UINT
width
,
UINT
height
)
static
void
device_
init_swapchain_state
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain
*
swapchain
)
{
struct
wined3d_state
*
state
=
&
device
->
state
;
BOOL
ds_enable
=
!!
swapchain
->
desc
.
enable_auto_depth_stencil
;
unsigned
int
i
;
state
->
viewport
.
x
=
0
;
state
->
viewport
.
y
=
0
;
state
->
viewport
.
width
=
width
;
state
->
viewport
.
height
=
height
;
state
->
viewport
.
min_z
=
0
.
0
f
;
state
->
viewport
.
max_z
=
1
.
0
f
;
if
(
device
->
fb
.
render_targets
)
{
for
(
i
=
0
;
i
<
device
->
adapter
->
gl_info
.
limits
.
buffers
;
++
i
)
{
wined3d_device_set_render_target
(
device
,
i
,
NULL
,
FALSE
);
}
if
(
swapchain
->
back_buffers
&&
swapchain
->
back_buffers
[
0
])
wined3d_device_set_render_target
(
device
,
0
,
swapchain
->
back_buffers
[
0
],
TRUE
);
}
state
->
scissor_rect
.
left
=
0
;
state
->
scissor_rect
.
top
=
0
;
state
->
scissor_rect
.
right
=
width
;
state
->
scissor_rect
.
bottom
=
height
;
wined3d_device_set_depth_stencil
(
device
,
ds_enable
?
device
->
auto_depth_stencil
:
NULL
);
wined3d_device_set_render_state
(
device
,
WINED3D_RS_ZENABLE
,
ds_enable
);
}
HRESULT
CDECL
wined3d_device_init_3d
(
struct
wined3d_device
*
device
,
...
...
@@ -895,25 +897,8 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
}
device
->
swapchains
[
0
]
=
swapchain
;
if
(
swapchain
->
back_buffers
&&
swapchain
->
back_buffers
[
0
])
{
TRACE
(
"Setting rendertarget to %p.
\n
"
,
swapchain
->
back_buffers
);
device
->
fb
.
render_targets
[
0
]
=
swapchain
->
back_buffers
[
0
];
wined3d_surface_incref
(
device
->
fb
.
render_targets
[
0
]);
clear_flags
|=
WINED3DCLEAR_TARGET
;
}
/* Depth Stencil support */
device
->
fb
.
depth_stencil
=
device
->
auto_depth_stencil
;
if
(
device
->
fb
.
depth_stencil
)
wined3d_surface_incref
(
device
->
fb
.
depth_stencil
);
/* Set up some starting GL setup */
/* Setup all the devices defaults */
state_init_default
(
&
device
->
state
,
device
);
device_reset_viewport_scissor
(
device
,
swapchain
->
desc
.
backbuffer_width
,
swapchain
->
desc
.
backbuffer_height
);
device_init_swapchain_state
(
device
,
swapchain
);
context
=
context_acquire
(
device
,
swapchain
->
front_buffer
);
...
...
@@ -947,6 +932,8 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
context_release
(
context
);
/* Clear the screen */
if
(
swapchain
->
back_buffers
&&
swapchain
->
back_buffers
[
0
])
clear_flags
|=
WINED3DCLEAR_TARGET
;
if
(
swapchain_desc
->
enable_auto_depth_stencil
)
clear_flags
|=
WINED3DCLEAR_ZBUFFER
|
WINED3DCLEAR_STENCIL
;
if
(
clear_flags
)
...
...
@@ -4726,9 +4713,9 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if
(
FAILED
(
hr
=
state_init
(
&
device
->
state
,
&
device
->
adapter
->
d3d_info
)))
ERR
(
"Failed to initialize device state, hr %#x.
\n
"
,
hr
);
state_init_default
(
&
device
->
state
,
device
);
device_reset_viewport_scissor
(
device
,
swapchain
->
desc
.
backbuffer_width
,
swapchain
->
desc
.
backbuffer_height
);
device
->
update_state
=
&
device
->
state
;
device_init_swapchain_state
(
device
,
swapchain
);
}
else
{
...
...
dlls/wined3d/stateblock.c
View file @
8866d733
...
...
@@ -1203,10 +1203,7 @@ void state_init_default(struct wined3d_state *state, struct wined3d_device *devi
TRACE
(
"Render states
\n
"
);
/* Render states: */
if
(
device
->
auto_depth_stencil
)
state
->
render_states
[
WINED3D_RS_ZENABLE
]
=
WINED3D_ZB_TRUE
;
else
state
->
render_states
[
WINED3D_RS_ZENABLE
]
=
WINED3D_ZB_FALSE
;
state
->
render_states
[
WINED3D_RS_ZENABLE
]
=
WINED3D_ZB_TRUE
;
state
->
render_states
[
WINED3D_RS_FILLMODE
]
=
WINED3D_FILL_SOLID
;
state
->
render_states
[
WINED3D_RS_SHADEMODE
]
=
WINED3D_SHADE_GOURAUD
;
lp
.
lp
.
repeat_factor
=
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