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
5e9884a4
Commit
5e9884a4
authored
Mar 10, 2011
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Test depth stencil size mismatches.
parent
82f6410b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
0 deletions
+106
-0
visual.c
dlls/d3d9/tests/visual.c
+106
-0
No files found.
dlls/d3d9/tests/visual.c
View file @
5e9884a4
...
...
@@ -11661,6 +11661,111 @@ static void srgbwrite_format_test(IDirect3DDevice9 *device)
IDirect3DSurface9_Release
(
backbuffer
);
}
static
void
ds_size_test
(
IDirect3DDevice9
*
device
)
{
IDirect3DSurface9
*
ds
,
*
rt
,
*
old_rt
,
*
old_ds
,
*
readback
;
HRESULT
hr
;
DWORD
color
;
DWORD
num_passes
;
struct
{
float
x
,
y
,
z
;
}
quad
[]
=
{
{
-
1
.
0
,
-
1
.
0
,
0
.
0
},
{
-
1
.
0
,
1
.
0
,
0
.
0
},
{
1
.
0
,
-
1
.
0
,
0
.
0
},
{
1
.
0
,
1
.
0
,
0
.
0
}
};
hr
=
IDirect3DDevice9_CreateRenderTarget
(
device
,
64
,
64
,
D3DFMT_A8R8G8B8
,
D3DMULTISAMPLE_NONE
,
0
,
FALSE
,
&
rt
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_CreateRenderTarget failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateDepthStencilSurface
(
device
,
32
,
32
,
D3DFMT_D24X8
,
D3DMULTISAMPLE_NONE
,
0
,
TRUE
,
&
ds
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_CreateDepthStencilSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateOffscreenPlainSurface
(
device
,
64
,
64
,
D3DFMT_A8R8G8B8
,
D3DPOOL_SYSTEMMEM
,
&
readback
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_CreateOffscreenPlainSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_ZENABLE
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetRenderState failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_STENCILENABLE
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetRenderState failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_ZWRITEENABLE
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetRenderState failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_ValidateDevice
(
device
,
&
num_passes
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_ValidateDevice failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetRenderTarget
(
device
,
0
,
&
old_rt
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_GetRenderTarget failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetDepthStencilSurface
(
device
,
&
old_ds
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_GetDepthStencilSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderTarget
(
device
,
0
,
rt
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetRenderTarget failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetDepthStencilSurface
(
device
,
ds
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetDepthStencilSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_ValidateDevice
(
device
,
&
num_passes
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_ValidateDevice failed, hr %#x.
\n
"
,
hr
);
/* The D3DCLEAR_TARGET clear works. D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER returns OK,
* but does not change the surface's contents. */
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0x000000FF
,
0
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Target clear failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_ZBUFFER
,
0x00000000
,
0
.
2
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Z Buffer clear failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0x00ff0000
,
0
.
5
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Target and Z Buffer clear failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetRenderTargetData
(
device
,
rt
,
readback
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_GetRenderTargetData failed, hr %#x.
\n
"
,
hr
);
color
=
getPixelColorFromSurface
(
readback
,
2
,
2
);
ok
(
color
==
0x000000FF
,
"DS size test: Pixel (2, 2) after clear is %#x, expected 0x000000FF
\n
"
,
color
);
color
=
getPixelColorFromSurface
(
readback
,
31
,
31
);
ok
(
color
==
0x000000FF
,
"DS size test: Pixel (31, 31) after clear is %#x, expected 0x000000FF
\n
"
,
color
);
color
=
getPixelColorFromSurface
(
readback
,
32
,
32
);
ok
(
color
==
0x000000FF
,
"DS size test: Pixel (32, 32) after clear is %#x, expected 0x000000FF
\n
"
,
color
);
color
=
getPixelColorFromSurface
(
readback
,
63
,
63
);
ok
(
color
==
0x000000FF
,
"DS size test: Pixel (63, 63) after clear is %#x, expected 0x000000FF
\n
"
,
color
);
/* Turning on any depth-related state results in a ValidateDevice failure */
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_ZENABLE
,
D3DZB_TRUE
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetRenderState failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_ValidateDevice
(
device
,
&
num_passes
);
ok
(
hr
==
D3DERR_CONFLICTINGRENDERSTATE
,
"IDirect3DDevice9_ValidateDevice returned %#x, expected "
"D3DERR_CONFLICTINGRENDERSTATE.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_ZENABLE
,
D3DZB_FALSE
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetRenderState failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_ZWRITEENABLE
,
TRUE
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetRenderState failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_ValidateDevice
(
device
,
&
num_passes
);
ok
(
hr
==
D3DERR_CONFLICTINGRENDERSTATE
,
"IDirect3DDevice9_ValidateDevice returned %#x, expected "
"D3DERR_CONFLICTINGRENDERSTATE.
\n
"
,
hr
);
/* Try to draw with the device in an invalid state */
hr
=
IDirect3DDevice9_SetFVF
(
device
,
D3DFVF_XYZ
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetFVF failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_BeginScene failed, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DDevice9_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
quad
,
sizeof
(
*
quad
));
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_DrawPrimitiveUP failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_EndScene failed, hr %#x.
\n
"
,
hr
);
}
hr
=
IDirect3DDevice9_SetRenderTarget
(
device
,
0
,
old_rt
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetRenderTarget failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetDepthStencilSurface
(
device
,
old_ds
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_SetDepthStencilSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_ValidateDevice
(
device
,
&
num_passes
);
ok
(
SUCCEEDED
(
hr
),
"IDirect3DDevice9_ValidateDevice failed, hr %#x.
\n
"
,
hr
);
IDirect3DSurface9_Release
(
readback
);
IDirect3DSurface9_Release
(
ds
);
IDirect3DSurface9_Release
(
rt
);
IDirect3DSurface9_Release
(
old_rt
);
IDirect3DSurface9_Release
(
old_ds
);
}
START_TEST
(
visual
)
{
IDirect3DDevice9
*
device_ptr
;
...
...
@@ -11738,6 +11843,7 @@ START_TEST(visual)
skip
(
"No mipmap support
\n
"
);
}
offscreen_test
(
device_ptr
);
ds_size_test
(
device_ptr
);
alpha_test
(
device_ptr
);
shademode_test
(
device_ptr
);
srgbtexture_test
(
device_ptr
);
...
...
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