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
520f74de
Commit
520f74de
authored
Apr 19, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the auto depth/stencil surface as an IWineD3DSurfaceImpl pointer in the device.
parent
c7a18486
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
18 deletions
+21
-18
device.c
dlls/wined3d/device.c
+15
-11
stateblock.c
dlls/wined3d/stateblock.c
+2
-3
swapchain.c
dlls/wined3d/swapchain.c
+3
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/device.c
View file @
520f74de
...
...
@@ -1621,7 +1621,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
IWineD3DSurface_AddRef
((
IWineD3DSurface
*
)
This
->
render_targets
[
0
]);
/* Depth Stencil support */
This
->
stencilBufferTarget
=
This
->
auto_depth_stencil_buffer
;
This
->
stencilBufferTarget
=
(
IWineD3DSurface
*
)
This
->
auto_depth_stencil
;
if
(
NULL
!=
This
->
stencilBufferTarget
)
{
IWineD3DSurface_AddRef
(
This
->
stencilBufferTarget
);
}
...
...
@@ -1855,8 +1855,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface,
/* Release the buffers (with sanity checks)*/
TRACE
(
"Releasing the depth stencil buffer at %p
\n
"
,
This
->
stencilBufferTarget
);
if
(
This
->
stencilBufferTarget
!=
NULL
&&
(
IWineD3DSurface_Release
(
This
->
stencilBufferTarget
)
>
0
)){
if
(
This
->
auto_depth_stencil_buffer
!=
This
->
stencilBufferTarget
)
if
(
This
->
stencilBufferTarget
!=
NULL
&&
IWineD3DSurface_Release
(
This
->
stencilBufferTarget
))
{
if
(
This
->
auto_depth_stencil
!=
(
IWineD3DSurfaceImpl
*
)
This
->
stencilBufferTarget
)
FIXME
(
"(%p) Something's still holding the stencilBufferTarget
\n
"
,
This
);
}
This
->
stencilBufferTarget
=
NULL
;
...
...
@@ -1867,12 +1868,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface,
TRACE
(
"Setting rendertarget to NULL
\n
"
);
This
->
render_targets
[
0
]
=
NULL
;
if
(
This
->
auto_depth_stencil_buffer
)
{
if
(
IWineD3DSurface_Release
(
This
->
auto_depth_stencil_buffer
)
>
0
)
if
(
This
->
auto_depth_stencil
)
{
if
(
IWineD3DSurface_Release
((
IWineD3DSurface
*
)
This
->
auto_depth_stencil
))
{
FIXME
(
"(%p) Something's still holding the auto depth stencil buffer
\n
"
,
This
);
}
This
->
auto_depth_stencil
_buffer
=
NULL
;
This
->
auto_depth_stencil
=
NULL
;
}
context_release
(
context
);
...
...
@@ -6436,7 +6438,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
pPresentationParameters
->
hDeviceWindow
!=
swapchain
->
presentParms
.
hDeviceWindow
)
{
ERR
(
"Cannot change the device window yet
\n
"
);
}
if
(
pPresentationParameters
->
EnableAutoDepthStencil
&&
!
This
->
auto_depth_stencil_buffer
)
{
if
(
pPresentationParameters
->
EnableAutoDepthStencil
&&
!
This
->
auto_depth_stencil
)
{
HRESULT
hrc
;
TRACE
(
"Creating the depth stencil buffer
\n
"
);
...
...
@@ -6449,7 +6452,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
pPresentationParameters
->
MultiSampleType
,
pPresentationParameters
->
MultiSampleQuality
,
FALSE
,
&
This
->
auto_depth_stencil_buffer
);
(
IWineD3DSurface
**
)
&
This
->
auto_depth_stencil
);
if
(
FAILED
(
hrc
))
{
ERR
(
"Failed to create the depth stencil buffer
\n
"
);
...
...
@@ -6460,7 +6463,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
/* Reset the depth stencil */
if
(
pPresentationParameters
->
EnableAutoDepthStencil
)
IWineD3DDevice_SetDepthStencilSurface
(
iface
,
This
->
auto_depth_stencil_buffer
);
IWineD3DDevice_SetDepthStencilSurface
(
iface
,
(
IWineD3DSurface
*
)
This
->
auto_depth_stencil
);
else
IWineD3DDevice_SetDepthStencilSurface
(
iface
,
NULL
);
...
...
@@ -6510,8 +6513,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
return
hr
;
}
}
if
(
This
->
auto_depth_stencil_buffer
)
{
hr
=
updateSurfaceDesc
((
IWineD3DSurfaceImpl
*
)
This
->
auto_depth_stencil_buffer
,
pPresentationParameters
);
if
(
This
->
auto_depth_stencil
)
{
hr
=
updateSurfaceDesc
(
This
->
auto_depth_stencil
,
pPresentationParameters
);
if
(
FAILED
(
hr
))
{
IWineD3DSwapChain_Release
((
IWineD3DSwapChain
*
)
swapchain
);
...
...
dlls/wined3d/stateblock.c
View file @
520f74de
...
...
@@ -1083,11 +1083,10 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
TRACE
(
"Render states
\n
"
);
/* Render states: */
if
(
ThisDevice
->
auto_depth_stencil
_buffer
!=
NULL
)
{
if
(
ThisDevice
->
auto_depth_stencil
)
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_ZENABLE
,
WINED3DZB_TRUE
);
}
else
{
else
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_ZENABLE
,
WINED3DZB_FALSE
);
}
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_FILLMODE
,
WINED3DFILL_SOLID
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_SHADEMODE
,
WINED3DSHADE_GOURAUD
);
lp
.
lp
.
wRepeatFactor
=
0
;
...
...
dlls/wined3d/swapchain.c
View file @
520f74de
...
...
@@ -856,20 +856,20 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
if
(
present_parameters
->
EnableAutoDepthStencil
&&
surface_type
==
SURFACE_OPENGL
)
{
TRACE
(
"Creating depth/stencil buffer.
\n
"
);
if
(
!
device
->
auto_depth_stencil
_buffer
)
if
(
!
device
->
auto_depth_stencil
)
{
hr
=
IWineD3DDeviceParent_CreateDepthStencilSurface
(
device
->
device_parent
,
parent
,
swapchain
->
presentParms
.
BackBufferWidth
,
swapchain
->
presentParms
.
BackBufferHeight
,
swapchain
->
presentParms
.
AutoDepthStencilFormat
,
swapchain
->
presentParms
.
MultiSampleType
,
swapchain
->
presentParms
.
MultiSampleQuality
,
FALSE
/* FIXME: Discard */
,
&
device
->
auto_depth_stencil_buffer
);
(
IWineD3DSurface
**
)
&
device
->
auto_depth_stencil
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create the auto depth stencil, hr %#x.
\n
"
,
hr
);
goto
err
;
}
IWineD3DSurface_SetContainer
(
device
->
auto_depth_stencil_buffer
,
NULL
);
IWineD3DSurface_SetContainer
(
(
IWineD3DSurface
*
)
device
->
auto_depth_stencil
,
NULL
);
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
520f74de
...
...
@@ -1667,7 +1667,7 @@ struct IWineD3DDeviceImpl
/* Render Target Support */
IWineD3DSurfaceImpl
**
render_targets
;
IWineD3DSurface
*
auto_depth_stencil_buffer
;
IWineD3DSurface
Impl
*
auto_depth_stencil
;
IWineD3DSurface
*
stencilBufferTarget
;
/* palettes texture management */
...
...
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