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
14b13d06
Commit
14b13d06
authored
May 24, 2008
by
H. Verbeet
Committed by
Alexandre Julliard
May 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d: Use an alpha capable backbuffer format in the visual tests.
parent
43fb6f77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
34 deletions
+16
-34
visual.c
dlls/d3d8/tests/visual.c
+8
-17
visual.c
dlls/d3d9/tests/visual.c
+8
-17
No files found.
dlls/d3d8/tests/visual.c
View file @
14b13d06
...
...
@@ -115,7 +115,7 @@ static IDirect3DDevice8 *init_d3d8(void)
present_parameters
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
present_parameters
.
BackBufferWidth
=
640
;
present_parameters
.
BackBufferHeight
=
480
;
present_parameters
.
BackBufferFormat
=
D3DFMT_
X
8R8G8B8
;
present_parameters
.
BackBufferFormat
=
D3DFMT_
A
8R8G8B8
;
present_parameters
.
EnableAutoDepthStencil
=
TRUE
;
present_parameters
.
AutoDepthStencilFormat
=
D3DFMT_D16
;
...
...
@@ -761,7 +761,7 @@ static void alpha_test(IDirect3DDevice8 *device)
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0x80ff0000
,
0
.
0
,
0
);
ok
(
hr
==
D3D_OK
,
"Clear failed, hr = %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
128
,
128
,
1
,
D3DUSAGE_RENDERTARGET
,
D3DFMT_
A
8R8G8B8
,
D3DPOOL_DEFAULT
,
&
offscreenTexture
);
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
128
,
128
,
1
,
D3DUSAGE_RENDERTARGET
,
D3DFMT_
X
8R8G8B8
,
D3DPOOL_DEFAULT
,
&
offscreenTexture
);
ok
(
hr
==
D3D_OK
||
D3DERR_INVALIDCALL
,
"Creating the offscreen render target failed, hr = %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice8_GetDepthStencilSurface
(
device
,
&
depthstencil
);
...
...
@@ -796,13 +796,7 @@ static void alpha_test(IDirect3DDevice8 *device)
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_SetRenderState failed, hr = %08x
\n
"
,
hr
);
if
(
IDirect3DDevice8_BeginScene
(
device
)
==
D3D_OK
)
{
/* Draw two quads, one with src alpha blending, one with dest alpha blending. The
* SRCALPHA / INVSRCALPHA blend doesn't give any surprises. Colors are blended based on
* the input alpha
*
* The DESTALPHA / INVDESTALPHA do not "work" on the regular buffer because there is no alpha.
* They give essentially ZERO and ONE blend factors
*/
/* Draw two quads, one with src alpha blending, one with dest alpha blending. */
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_SRCBLEND
,
D3DBLEND_SRCALPHA
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_SetRenderState failed, hr = %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderState
(
device
,
D3DRS_DESTBLEND
,
D3DBLEND_INVSRCALPHA
);
...
...
@@ -817,12 +811,9 @@ static void alpha_test(IDirect3DDevice8 *device)
hr
=
IDirect3DDevice8_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
quad2
,
sizeof
(
quad2
[
0
]));
ok
(
hr
==
D3D_OK
,
"DrawPrimitiveUP failed, hr = %#08x
\n
"
,
hr
);
/* Switch to the offscreen buffer, and redo the testing. SRCALPHA and DESTALPHA. The offscreen buffer
* has a alpha channel on its own. Clear the offscreen buffer with alpha = 0.5 again, then draw the
* quads again. The SRCALPHA/INVSRCALPHA doesn't give any surprises, but the DESTALPHA/INVDESTALPHA
* blending works as supposed now - blend factor is 0.5 in both cases, not 0.75 as from the input
* vertices
*/
/* Switch to the offscreen buffer, and redo the testing. The offscreen render target
* doesn't have an alpha channel. DESTALPHA and INVDESTALPHA "don't work" on render
* targets without alpha channel, they give essentially ZERO and ONE blend factors. */
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
offscreen
,
0
);
ok
(
hr
==
D3D_OK
,
"Can't get back buffer, hr = %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0x80ff0000
,
0
.
0
,
0
);
...
...
@@ -877,7 +868,7 @@ static void alpha_test(IDirect3DDevice8 *device)
red
=
(
color
&
0x00ff0000
)
>>
16
;
green
=
(
color
&
0x0000ff00
)
>>
8
;
blue
=
(
color
&
0x000000ff
);
ok
(
red
==
0x00
&&
green
==
0x00
&&
blue
>=
0xfe
&&
blue
<=
0xff
,
ok
(
red
>=
0x7e
&&
red
<=
0x81
&&
green
==
0x00
&&
blue
>=
0x7e
&&
blue
<=
0x81
,
"DSTALPHA on frame buffer returned color %08x, expected 0x00ff0000
\n
"
,
color
);
color
=
getPixelColor
(
device
,
480
,
360
);
...
...
@@ -891,7 +882,7 @@ static void alpha_test(IDirect3DDevice8 *device)
red
=
(
color
&
0x00ff0000
)
>>
16
;
green
=
(
color
&
0x0000ff00
)
>>
8
;
blue
=
(
color
&
0x000000ff
);
ok
(
red
>=
0x7e
&&
red
<=
0x81
&&
green
==
0x00
&&
blue
>=
0x7e
&&
blue
<=
0x81
,
ok
(
red
==
0x00
&&
green
==
0x00
&&
blue
>=
0xfe
&&
blue
<=
0xff
,
"DSTALPHA on texture returned color %08x, expected foo
\n
"
,
color
);
out:
...
...
dlls/d3d9/tests/visual.c
View file @
14b13d06
...
...
@@ -159,7 +159,7 @@ static IDirect3DDevice9 *init_d3d9(void)
present_parameters
.
SwapEffect
=
D3DSWAPEFFECT_DISCARD
;
present_parameters
.
BackBufferWidth
=
640
;
present_parameters
.
BackBufferHeight
=
480
;
present_parameters
.
BackBufferFormat
=
D3DFMT_
X
8R8G8B8
;
present_parameters
.
BackBufferFormat
=
D3DFMT_
A
8R8G8B8
;
present_parameters
.
EnableAutoDepthStencil
=
TRUE
;
present_parameters
.
AutoDepthStencilFormat
=
D3DFMT_D24S8
;
...
...
@@ -6671,7 +6671,7 @@ static void alpha_test(IDirect3DDevice9 *device)
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0x80ff0000
,
0
.
0
,
0
);
ok
(
hr
==
D3D_OK
,
"Clear failed, hr = %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
128
,
128
,
1
,
D3DUSAGE_RENDERTARGET
,
D3DFMT_
A
8R8G8B8
,
D3DPOOL_DEFAULT
,
&
offscreenTexture
,
NULL
);
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
128
,
128
,
1
,
D3DUSAGE_RENDERTARGET
,
D3DFMT_
X
8R8G8B8
,
D3DPOOL_DEFAULT
,
&
offscreenTexture
,
NULL
);
ok
(
hr
==
D3D_OK
||
hr
==
D3DERR_INVALIDCALL
,
"Creating the offscreen render target failed, hr = %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetBackBuffer
(
device
,
0
,
0
,
D3DBACKBUFFER_TYPE_MONO
,
&
backbuffer
);
...
...
@@ -6704,13 +6704,7 @@ static void alpha_test(IDirect3DDevice9 *device)
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetRenderState failed, hr = %08x
\n
"
,
hr
);
if
(
IDirect3DDevice9_BeginScene
(
device
)
==
D3D_OK
)
{
/* Draw two quads, one with src alpha blending, one with dest alpha blending. The
* SRCALPHA / INVSRCALPHA blend doesn't give any surprises. Colors are blended based on
* the input alpha
*
* The DESTALPHA / INVDESTALPHA do not "work" on the regular buffer because there is no alpha.
* They give essentially ZERO and ONE blend factors
*/
/* Draw two quads, one with src alpha blending, one with dest alpha blending. */
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_SRCBLEND
,
D3DBLEND_SRCALPHA
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_SetRenderState failed, hr = %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_DESTBLEND
,
D3DBLEND_INVSRCALPHA
);
...
...
@@ -6725,12 +6719,9 @@ static void alpha_test(IDirect3DDevice9 *device)
hr
=
IDirect3DDevice9_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
quad2
,
sizeof
(
quad2
[
0
]));
ok
(
hr
==
D3D_OK
,
"DrawPrimitiveUP failed, hr = %#08x
\n
"
,
hr
);
/* Switch to the offscreen buffer, and redo the testing. SRCALPHA and DESTALPHA. The offscreen buffer
* has a alpha channel on its own. Clear the offscreen buffer with alpha = 0.5 again, then draw the
* quads again. The SRCALPHA/INVSRCALPHA doesn't give any surprises, but the DESTALPHA/INVDESTALPHA
* blending works as supposed now - blend factor is 0.5 in both cases, not 0.75 as from the input
* vertices
*/
/* Switch to the offscreen buffer, and redo the testing. The offscreen render target
* doesn't have an alpha channel. DESTALPHA and INVDESTALPHA "don't work" on render
* targets without alpha channel, they give essentially ZERO and ONE blend factors. */
hr
=
IDirect3DDevice9_SetRenderTarget
(
device
,
0
,
offscreen
);
ok
(
hr
==
D3D_OK
,
"Can't get back buffer, hr = %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0x80ff0000
,
0
.
0
,
0
);
...
...
@@ -6785,7 +6776,7 @@ static void alpha_test(IDirect3DDevice9 *device)
red
=
(
color
&
0x00ff0000
)
>>
16
;
green
=
(
color
&
0x0000ff00
)
>>
8
;
blue
=
(
color
&
0x000000ff
);
ok
(
red
==
0x00
&&
green
==
0x00
&&
blue
>=
0xfe
&&
blue
<=
0xff
,
ok
(
red
>=
0x7e
&&
red
<=
0x81
&&
green
==
0x00
&&
blue
>=
0x7e
&&
blue
<=
0x81
,
"DSTALPHA on frame buffer returned color %08x, expected 0x00ff0000
\n
"
,
color
);
color
=
getPixelColor
(
device
,
480
,
360
);
...
...
@@ -6799,7 +6790,7 @@ static void alpha_test(IDirect3DDevice9 *device)
red
=
(
color
&
0x00ff0000
)
>>
16
;
green
=
(
color
&
0x0000ff00
)
>>
8
;
blue
=
(
color
&
0x000000ff
);
ok
(
red
>=
0x7e
&&
red
<=
0x81
&&
green
==
0x00
&&
blue
>=
0x7e
&&
blue
<=
0x81
,
ok
(
red
==
0x00
&&
green
==
0x00
&&
blue
>=
0xfe
&&
blue
<=
0xff
,
"DSTALPHA on texture returned color %08x, expected 0x00800080
\n
"
,
color
);
out:
...
...
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