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
79f715c3
Commit
79f715c3
authored
Oct 28, 2010
by
Travis Athougies
Committed by
Alexandre Julliard
Oct 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler_43/tests: Added tests for conditional expressions to HLSL test suite.
parent
9f7ceec9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
hlsl.c
dlls/d3dcompiler_43/tests/hlsl.c
+65
-0
No files found.
dlls/d3dcompiler_43/tests/hlsl.c
View file @
79f715c3
...
...
@@ -370,6 +370,70 @@ static void test_math(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geo
}
}
static
void
test_conditionals
(
IDirect3DDevice9
*
device
,
IDirect3DVertexBuffer9
*
quad_geometry
,
IDirect3DVertexShader9
*
vshader_passthru
)
{
static
struct
hlsl_probe_info
if_greater_probes
[]
=
{
{
0
,
0
,
{
0
.
9
f
,
0
.
8
f
,
0
.
7
f
,
0
.
6
f
},
0
.
0001
f
,
"if greater test failed"
},
{
5
,
0
,
{
0
.
9
f
,
0
.
8
f
,
0
.
7
f
,
0
.
6
f
},
0
.
0001
f
,
"if greater test failed"
},
{
10
,
0
,
{
0
.
9
f
,
0
.
8
f
,
0
.
7
f
,
0
.
6
f
},
0
.
0001
f
,
"if greater test failed"
},
{
15
,
0
,
{
0
.
9
f
,
0
.
8
f
,
0
.
7
f
,
0
.
6
f
},
0
.
0001
f
,
"if greater test failed"
},
{
25
,
0
,
{
0
.
1
f
,
0
.
2
f
,
0
.
3
f
,
0
.
4
f
},
0
.
0001
f
,
"if greater test failed"
},
{
30
,
0
,
{
0
.
1
f
,
0
.
2
f
,
0
.
3
f
,
0
.
4
f
},
0
.
0001
f
,
"if greater test failed"
}
};
static
const
char
*
if_greater_shader
=
"float4 test(float2 pos: TEXCOORD0): COLOR \
{ \
if((pos.x * 32.0) > 20.0) \
return float4(0.1, 0.2, 0.3, 0.4); \
else \
return float4(0.9, 0.8, 0.7, 0.6); \
}"
;
static
struct
hlsl_probe_info
ternary_operator_probes
[]
=
{
{
0
,
0
,
{
0
.
50
f
,
0
.
25
f
,
0
.
50
f
,
0
.
75
f
},
0
.
00001
f
,
"ternary operator test failed"
},
{
1
,
0
,
{
0
.
50
f
,
0
.
25
f
,
0
.
50
f
,
0
.
75
f
},
0
.
00001
f
,
"ternary operator test failed"
},
{
2
,
0
,
{
0
.
50
f
,
0
.
25
f
,
0
.
50
f
,
0
.
75
f
},
0
.
00001
f
,
"ternary operator test failed"
},
{
3
,
0
,
{
0
.
50
f
,
0
.
25
f
,
0
.
50
f
,
0
.
75
f
},
0
.
00001
f
,
"ternary operator test failed"
},
{
4
,
0
,
{
0
.
60
f
,
0
.
80
f
,
0
.
10
f
,
0
.
20
f
},
0
.
00001
f
,
"ternary operator test failed"
},
{
5
,
0
,
{
0
.
60
f
,
0
.
80
f
,
0
.
10
f
,
0
.
20
f
},
0
.
00001
f
,
"ternary operator test failed"
},
{
6
,
0
,
{
0
.
60
f
,
0
.
80
f
,
0
.
10
f
,
0
.
20
f
},
0
.
00001
f
,
"ternary operator test failed"
},
{
7
,
0
,
{
0
.
60
f
,
0
.
80
f
,
0
.
10
f
,
0
.
20
f
},
0
.
00001
f
,
"ternary operator test failed"
}
};
static
const
char
*
ternary_operator_shader
=
"float4 test(float2 pos: TEXCOORD0): COLOR \
{ \
return (pos.x < 0.5?float4(0.5, 0.25, 0.5, 0.75):float4(0.6, 0.8, 0.1, 0.2)); \
}"
;
ID3DXConstantTable
*
constants
;
IDirect3DPixelShader9
*
pshader
;
pshader
=
compile_pixel_shader9
(
device
,
if_greater_shader
,
"ps_2_0"
,
&
constants
);
if
(
pshader
!=
NULL
)
{
compute_shader_probe9
(
device
,
vshader_passthru
,
pshader
,
quad_geometry
,
if_greater_probes
,
6
,
32
,
1
,
__LINE__
);
IUnknown_Release
(
constants
);
IUnknown_Release
(
pshader
);
}
pshader
=
compile_pixel_shader9
(
device
,
ternary_operator_shader
,
"ps_2_0"
,
&
constants
);
if
(
pshader
!=
NULL
)
{
compute_shader_probe9
(
device
,
vshader_passthru
,
pshader
,
quad_geometry
,
ternary_operator_probes
,
7
,
8
,
1
,
__LINE__
);
IUnknown_Release
(
constants
);
IUnknown_Release
(
pshader
);
}
}
START_TEST
(
hlsl
)
{
D3DCAPS9
caps
;
...
...
@@ -391,6 +455,7 @@ START_TEST(hlsl)
{
test_swizzle
(
device
,
quad_geometry
,
vshader_passthru
);
test_math
(
device
,
quad_geometry
,
vshader_passthru
);
test_conditionals
(
device
,
quad_geometry
,
vshader_passthru
);
}
}
else
skip
(
"no pixel shader support
\n
"
);
...
...
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