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
63cd3de5
Commit
63cd3de5
authored
Oct 18, 2018
by
Daniel Ansorregui
Committed by
Alexandre Julliard
Oct 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core/tests: Add a blend factor test.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dfeb5149
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
d3d10core.c
dlls/d3d10core/tests/d3d10core.c
+26
-6
No files found.
dlls/d3d10core/tests/d3d10core.c
View file @
63cd3de5
...
...
@@ -5688,8 +5688,8 @@ float4 main(float4 color : COLOR) : SV_TARGET
static
void
test_blend
(
void
)
{
ID3D10BlendState
*
src_blend
,
*
dst_blend
,
*
dst_blend_factor
;
struct
d3d10core_test_context
test_context
;
ID3D10BlendState
*
src_blend
,
*
dst_blend
;
ID3D10RenderTargetView
*
offscreen_rtv
;
D3D10_TEXTURE2D_DESC
texture_desc
;
ID3D10InputLayout
*
input_layout
;
...
...
@@ -5779,7 +5779,7 @@ static void test_blend(void)
{
"POSITION"
,
0
,
DXGI_FORMAT_R32G32B32_FLOAT
,
0
,
0
,
D3D10_INPUT_PER_VERTEX_DATA
,
0
},
{
"COLOR"
,
0
,
DXGI_FORMAT_R8G8B8A8_UNORM
,
0
,
12
,
D3D10_INPUT_PER_VERTEX_DATA
,
0
},
};
static
const
float
blend_factor
[]
=
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
};
static
const
float
blend_factor
[]
=
{
0
.
3
f
,
0
.
4
f
,
0
.
8
f
,
0
.
9
f
};
static
const
float
red
[]
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
5
f
};
if
(
!
init_test_context
(
&
test_context
))
...
...
@@ -5818,6 +5818,14 @@ static void test_blend(void)
hr
=
ID3D10Device_CreateBlendState
(
device
,
&
blend_desc
,
&
dst_blend
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create blend state, hr %#x.
\n
"
,
hr
);
blend_desc
.
SrcBlend
=
D3D10_BLEND_BLEND_FACTOR
;
blend_desc
.
DestBlend
=
D3D10_BLEND_INV_BLEND_FACTOR
;
blend_desc
.
SrcBlendAlpha
=
D3D10_BLEND_DEST_ALPHA
;
blend_desc
.
DestBlendAlpha
=
D3D10_BLEND_INV_DEST_ALPHA
;
hr
=
ID3D10Device_CreateBlendState
(
device
,
&
blend_desc
,
&
dst_blend_factor
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create blend state, hr %#x.
\n
"
,
hr
);
ID3D10Device_IASetInputLayout
(
device
,
input_layout
);
ID3D10Device_IASetPrimitiveTopology
(
device
,
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP
);
stride
=
sizeof
(
*
quads
);
...
...
@@ -5828,9 +5836,9 @@ static void test_blend(void)
ID3D10Device_ClearRenderTargetView
(
device
,
test_context
.
backbuffer_rtv
,
red
);
ID3D10Device_OMSetBlendState
(
device
,
src_blend
,
blend_factor
,
D3D10_DEFAULT_SAMPLE_MASK
);
ID3D10Device_OMSetBlendState
(
device
,
src_blend
,
NULL
,
D3D10_DEFAULT_SAMPLE_MASK
);
ID3D10Device_Draw
(
device
,
4
,
0
);
ID3D10Device_OMSetBlendState
(
device
,
dst_blend
,
blend_factor
,
D3D10_DEFAULT_SAMPLE_MASK
);
ID3D10Device_OMSetBlendState
(
device
,
dst_blend
,
NULL
,
D3D10_DEFAULT_SAMPLE_MASK
);
ID3D10Device_Draw
(
device
,
4
,
4
);
color
=
get_texture_color
(
test_context
.
backbuffer
,
320
,
360
);
...
...
@@ -5838,6 +5846,17 @@ static void test_blend(void)
color
=
get_texture_color
(
test_context
.
backbuffer
,
320
,
120
);
ok
(
compare_color
(
color
,
0xa080007f
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
ID3D10Device_ClearRenderTargetView
(
device
,
test_context
.
backbuffer_rtv
,
red
);
ID3D10Device_OMSetBlendState
(
device
,
dst_blend_factor
,
blend_factor
,
D3D10_DEFAULT_SAMPLE_MASK
);
ID3D10Device_Draw
(
device
,
4
,
0
);
ID3D10Device_Draw
(
device
,
4
,
4
);
color
=
get_texture_color
(
test_context
.
backbuffer
,
320
,
360
);
ok
(
compare_color
(
color
,
0x600066b3
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
color
=
get_texture_color
(
test_context
.
backbuffer
,
320
,
120
);
ok
(
compare_color
(
color
,
0xa0cc00b3
,
1
),
"Got unexpected color 0x%08x.
\n
"
,
color
);
texture_desc
.
Width
=
128
;
texture_desc
.
Height
=
128
;
texture_desc
.
MipLevels
=
1
;
...
...
@@ -5866,9 +5885,9 @@ static void test_blend(void)
ID3D10Device_ClearRenderTargetView
(
device
,
offscreen_rtv
,
red
);
ID3D10Device_OMSetBlendState
(
device
,
src_blend
,
blend_factor
,
D3D10_DEFAULT_SAMPLE_MASK
);
ID3D10Device_OMSetBlendState
(
device
,
src_blend
,
NULL
,
D3D10_DEFAULT_SAMPLE_MASK
);
ID3D10Device_Draw
(
device
,
4
,
0
);
ID3D10Device_OMSetBlendState
(
device
,
dst_blend
,
blend_factor
,
D3D10_DEFAULT_SAMPLE_MASK
);
ID3D10Device_OMSetBlendState
(
device
,
dst_blend
,
NULL
,
D3D10_DEFAULT_SAMPLE_MASK
);
ID3D10Device_Draw
(
device
,
4
,
4
);
color
=
get_texture_color
(
offscreen
,
64
,
96
)
&
0x00ffffff
;
...
...
@@ -5879,6 +5898,7 @@ static void test_blend(void)
ID3D10RenderTargetView_Release
(
offscreen_rtv
);
ID3D10Texture2D_Release
(
offscreen
);
done:
ID3D10BlendState_Release
(
dst_blend_factor
);
ID3D10BlendState_Release
(
dst_blend
);
ID3D10BlendState_Release
(
src_blend
);
ID3D10PixelShader_Release
(
ps
);
...
...
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