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
0b630e14
Commit
0b630e14
authored
Jul 23, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Add a test for clearing render targets in an MRT.
parent
d374d850
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
visual.c
dlls/d3d9/tests/visual.c
+36
-3
No files found.
dlls/d3d9/tests/visual.c
View file @
0b630e14
...
...
@@ -9043,7 +9043,7 @@ static void multiple_rendertargets_test(IDirect3DDevice9 *device)
IDirect3DVertexShader9
*
vs
;
IDirect3DPixelShader9
*
ps
;
IDirect3DTexture9
*
tex1
,
*
tex2
;
IDirect3DSurface9
*
surf1
,
*
surf2
,
*
backbuf
;
IDirect3DSurface9
*
surf1
,
*
surf2
,
*
backbuf
,
*
readback
;
D3DCAPS9
caps
;
DWORD
color
;
float
quad
[]
=
{
...
...
@@ -9075,9 +9075,15 @@ static void multiple_rendertargets_test(IDirect3DDevice9 *device)
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0xffff0000
,
0
.
0
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_Clear failed, hr=%08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
16
,
16
,
1
,
D3DUSAGE_RENDERTARGET
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
&
tex1
,
NULL
);
hr
=
IDirect3DDevice9_CreateOffscreenPlainSurface
(
device
,
16
,
16
,
D3DFMT_A8R8G8B8
,
D3DPOOL_SYSTEMMEM
,
&
readback
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"CreateOffscreenPlainSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
16
,
16
,
1
,
D3DUSAGE_RENDERTARGET
,
D3DFMT_A8R8G8B8
,
D3DPOOL_DEFAULT
,
&
tex1
,
NULL
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_CreateTexture failed, hr=%08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
16
,
16
,
1
,
D3DUSAGE_RENDERTARGET
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
&
tex2
,
NULL
);
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
16
,
16
,
1
,
D3DUSAGE_RENDERTARGET
,
D3DFMT_A8R8G8B8
,
D3DPOOL_DEFAULT
,
&
tex2
,
NULL
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_CreateTexture failed, hr=%08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateVertexShader
(
device
,
vshader_code
,
&
vs
);
ok
(
SUCCEEDED
(
hr
),
"CreateVertexShader failed, hr %#x.
\n
"
,
hr
);
...
...
@@ -9102,6 +9108,32 @@ static void multiple_rendertargets_test(IDirect3DDevice9 *device)
hr
=
IDirect3DDevice9_SetFVF
(
device
,
D3DFVF_XYZ
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetFVF failed, hr=%08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xff0000ff
,
0
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Clear failed, hr %#x,
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetRenderTargetData
(
device
,
surf1
,
readback
);
ok
(
SUCCEEDED
(
hr
),
"GetRenderTargetData failed, hr %#x.
\n
"
,
hr
);
color
=
getPixelColorFromSurface
(
readback
,
8
,
8
);
ok
(
color_match
(
color
,
D3DCOLOR_ARGB
(
0xff
,
0x00
,
0x00
,
0xff
),
0
),
"Expected color 0x000000ff, got 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_GetRenderTargetData
(
device
,
surf2
,
readback
);
ok
(
SUCCEEDED
(
hr
),
"GetRenderTargetData failed, hr %#x.
\n
"
,
hr
);
color
=
getPixelColorFromSurface
(
readback
,
8
,
8
);
ok
(
color_match
(
color
,
D3DCOLOR_ARGB
(
0xff
,
0x00
,
0x00
,
0xff
),
0
),
"Expected color 0x000000ff, got 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xff00ff00
,
0
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Clear failed, hr %#x,
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetRenderTargetData
(
device
,
surf1
,
readback
);
ok
(
SUCCEEDED
(
hr
),
"GetRenderTargetData failed, hr %#x.
\n
"
,
hr
);
color
=
getPixelColorFromSurface
(
readback
,
8
,
8
);
ok
(
color_match
(
color
,
D3DCOLOR_ARGB
(
0xff
,
0x00
,
0xff
,
0x00
),
0
),
"Expected color 0x0000ff00, got 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_GetRenderTargetData
(
device
,
surf2
,
readback
);
ok
(
SUCCEEDED
(
hr
),
"GetRenderTargetData failed, hr %#x.
\n
"
,
hr
);
color
=
getPixelColorFromSurface
(
readback
,
8
,
8
);
ok
(
color_match
(
color
,
D3DCOLOR_ARGB
(
0xff
,
0x00
,
0xff
,
0x00
),
0
),
"Expected color 0x0000ff00, got 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_BeginScene failed, hr=%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
...
...
@@ -9149,6 +9181,7 @@ static void multiple_rendertargets_test(IDirect3DDevice9 *device)
IDirect3DSurface9_Release
(
surf1
);
IDirect3DSurface9_Release
(
surf2
);
IDirect3DSurface9_Release
(
backbuf
);
IDirect3DSurface9_Release
(
readback
);
}
struct
formats
{
...
...
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