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
fb269f92
Commit
fb269f92
authored
Jun 08, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Depthfill blits are allowed between BeginScene and Endscene.
parent
208d3868
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
d3d.c
dlls/ddraw/tests/d3d.c
+38
-0
surface.c
dlls/wined3d/surface.c
+4
-2
No files found.
dlls/ddraw/tests/d3d.c
View file @
fb269f92
...
...
@@ -27,6 +27,7 @@
static
LPDIRECTDRAW7
lpDD
=
NULL
;
static
LPDIRECT3D7
lpD3D
=
NULL
;
static
LPDIRECTDRAWSURFACE7
lpDDS
=
NULL
;
static
LPDIRECTDRAWSURFACE7
lpDDSdepth
=
NULL
;
static
LPDIRECT3DDEVICE7
lpD3DDevice
=
NULL
;
static
LPDIRECT3DVERTEXBUFFER7
lpVBufSrc
=
NULL
;
static
LPDIRECT3DVERTEXBUFFER7
lpVBufDest1
=
NULL
;
...
...
@@ -88,6 +89,27 @@ static BOOL CreateDirect3D(void)
if
(
!
SUCCEEDED
(
rc
))
return
FALSE
;
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_PIXELFORMAT
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_ZBUFFER
;
ddsd
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
ddsd
.
ddpfPixelFormat
);
ddsd
.
ddpfPixelFormat
.
dwFlags
=
DDPF_ZBUFFER
;
ddsd
.
ddpfPixelFormat
.
dwZBufferBitDepth
=
16
;
ddsd
.
ddpfPixelFormat
.
dwZBitMask
=
0x0000FFFF
;
ddsd
.
dwWidth
=
256
;
ddsd
.
dwHeight
=
256
;
rc
=
IDirectDraw7_CreateSurface
(
lpDD
,
&
ddsd
,
&
lpDDSdepth
,
NULL
);
ok
(
rc
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
rc
);
if
(
!
SUCCEEDED
(
rc
))
{
lpDDSdepth
=
NULL
;
}
else
{
rc
=
IDirectDrawSurface_AddAttachedSurface
(
lpDDS
,
lpDDSdepth
);
ok
(
rc
==
DD_OK
,
"IDirectDrawSurface_AddAttachedSurface returned %x
\n
"
,
rc
);
if
(
!
SUCCEEDED
(
rc
))
return
FALSE
;
}
rc
=
IDirect3D7_CreateDevice
(
lpD3D
,
&
IID_IDirect3DTnLHalDevice
,
lpDDS
,
&
lpD3DDevice
);
ok
(
rc
==
D3D_OK
||
rc
==
DDERR_NOPALETTEATTACHED
||
rc
==
E_OUTOFMEMORY
,
"CreateDevice returned: %x
\n
"
,
rc
);
...
...
@@ -117,6 +139,12 @@ static void ReleaseDirect3D(void)
lpD3DDevice
=
NULL
;
}
if
(
lpDDSdepth
!=
NULL
)
{
IDirectDrawSurface_Release
(
lpDDSdepth
);
lpDDSdepth
=
NULL
;
}
if
(
lpDDS
!=
NULL
)
{
IDirectDrawSurface_Release
(
lpDDS
);
...
...
@@ -569,6 +597,16 @@ static void SceneTest(void)
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_BeginScene failed with %08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
DDBLTFX
fx
;
memset
(
&
fx
,
0
,
sizeof
(
fx
));
fx
.
dwSize
=
sizeof
(
fx
);
if
(
lpDDSdepth
)
{
hr
=
IDirectDrawSurface7_Blt
(
lpDDSdepth
,
NULL
,
NULL
,
NULL
,
DDBLT_DEPTHFILL
,
&
fx
);
ok
(
hr
==
D3D_OK
,
"Depthfill failed in a BeginScene / EndScene pair
\n
"
);
}
else
{
skip
(
"Depth stencil creation failed at startup, skipping
\n
"
);
}
hr
=
IDirect3DDevice7_EndScene
(
lpD3DDevice
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_EndScene failed with %08x
\n
"
,
hr
);
}
...
...
dlls/wined3d/surface.c
View file @
fb269f92
...
...
@@ -3175,9 +3175,11 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Blt(IWineD3DSurface *iface, RECT *Dest
TRACE
(
"(%p)->(%p,%p,%p,%x,%p)
\n
"
,
This
,
DestRect
,
SrcSurface
,
SrcRect
,
Flags
,
DDBltFx
);
TRACE
(
"(%p): Usage is %s
\n
"
,
This
,
debug_d3dusage
(
This
->
resource
.
usage
));
/* Accessing the depth stencil is supposed to fail between a BeginScene and EndScene pair */
/* Accessing the depth stencil is supposed to fail between a BeginScene and EndScene pair,
* except depth blits, which seem to work
*/
if
(
iface
==
myDevice
->
stencilBufferTarget
||
(
SrcSurface
&&
SrcSurface
==
myDevice
->
stencilBufferTarget
))
{
if
(
myDevice
->
inScene
)
{
if
(
myDevice
->
inScene
&&
!
(
Flags
&
WINEDDBLT_DEPTHFILL
)
)
{
TRACE
(
"Attempt to access the depth stencil surface in a BeginScene / EndScene pair, returning WINED3DERR_INVALIDCALL
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
else
if
(
IWineD3DSurfaceImpl_BltZ
(
This
,
DestRect
,
SrcSurface
,
SrcRect
,
Flags
,
DDBltFx
)
==
WINED3D_OK
)
{
...
...
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