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
ee8b2767
Commit
ee8b2767
authored
Jan 08, 2011
by
Travis Athougies
Committed by
Alexandre Julliard
Jan 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler_43/tests: Added error tests to HLSL test suite.
parent
3add5584
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
0 deletions
+93
-0
hlsl.c
dlls/d3dcompiler_43/tests/hlsl.c
+93
-0
No files found.
dlls/d3dcompiler_43/tests/hlsl.c
View file @
ee8b2767
...
...
@@ -556,6 +556,98 @@ static void test_trig(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geo
}
}
static
void
test_fail
(
IDirect3DDevice9
*
device
,
IDirect3DVertexBuffer9
*
qquad_geometry
,
IDirect3DVertexShader9
*
vshader_passthru
)
{
static
const
char
*
undefined_variable_shader
=
"float4 test(float2 pos: TEXCOORD0) : COLOR
\n
"
"{
\n
"
" return y;
\n
"
"}"
;
static
const
char
*
invalid_swizzle_shader
=
"float4 test(float2 pos: TEXCOORD0) : COLOR
\n
"
"{
\n
"
" float4 x = float4(0, 0, 0, 0);
\n
"
" x.xzzx = float4(1, 2, 3, 4);
\n
"
" return x;
\n
"
"}"
;
static
const
char
*
invalid_conversion_shader
=
"float4 test(float2 pos: TEXCOORD0) : COLOR
\n
"
"{
\n
"
" float4 x = pos;
\n
"
" return x;
\n
"
"}"
;
static
const
char
*
invalid_syntax_shader
=
"float4 test(float2 pos, TEXCOORD0) ; COLOR
\n
"
"{
\n
"
" pos = float4 x;
\n
"
" mul(float4(5, 4, 3, 2), mvp) = x;
\n
"
" return float4;
\n
"
"}"
;
static
const
char
*
invalid_identifiers_shader
=
"float4 563r(float2 45s: TEXCOORD0) : COLOR
\n
"
"{
\n
"
" float2 x = 45s;
\n
"
" return float4(x.x, x.y, 0, 0);
\n
"
"}"
;
ID3D10Blob
*
compiled
=
NULL
,
*
errors
=
NULL
;
HRESULT
hr
;
hr
=
D3DCompile
(
undefined_variable_shader
,
strlen
(
undefined_variable_shader
),
NULL
,
NULL
,
NULL
,
"test"
,
"ps_2_0"
,
0
,
0
,
&
compiled
,
&
errors
);
ok
(
hr
!=
D3D_OK
,
"Pixel shader compilation succeeded on shader with undefined variable
\n
"
);
ok
(
errors
!=
NULL
,
"No errors returned for a shader with undefined variables
\n
"
);
ok
(
compiled
==
NULL
,
"A shader blob was returned for a shader with undefined variables
\n
"
);
IUnknown_Release
(
errors
);
errors
=
NULL
;
hr
=
D3DCompile
(
invalid_swizzle_shader
,
strlen
(
invalid_swizzle_shader
),
NULL
,
NULL
,
NULL
,
"test"
,
"ps_2_0"
,
0
,
0
,
&
compiled
,
&
errors
);
ok
(
hr
!=
D3D_OK
,
"Pixel shader compilation succeeded on shader with an invalid swizzle mask
\n
"
);
ok
(
errors
!=
NULL
,
"No errors returned for a shader with an invalid swizzle mask
\n
"
);
ok
(
compiled
==
NULL
,
"A shader blob was returned for a shader with an invalid swizzle mask
\n
"
);
IUnknown_Release
(
errors
);
errors
=
NULL
;
hr
=
D3DCompile
(
invalid_conversion_shader
,
strlen
(
invalid_conversion_shader
),
NULL
,
NULL
,
NULL
,
"test"
,
"ps_2_0"
,
0
,
0
,
&
compiled
,
&
errors
);
ok
(
hr
!=
D3D_OK
,
"Pixel shader compilation succeeded on shader with an invalid type "
"conversion
\n
"
);
ok
(
errors
!=
NULL
,
"No errors returned for a shader with invalid type conversions
\n
"
);
ok
(
compiled
==
NULL
,
"A shader blob was returned for a shader with invalid type conversions
\n
"
);
IUnknown_Release
(
errors
);
errors
=
NULL
;
hr
=
D3DCompile
(
invalid_syntax_shader
,
strlen
(
invalid_syntax_shader
),
NULL
,
NULL
,
NULL
,
"test"
,
"ps_2_0"
,
0
,
0
,
&
compiled
,
&
errors
);
ok
(
hr
!=
D3D_OK
,
"Pixel shader compilation succeeded on shader with blatantly invalid "
"syntax
\n
"
);
ok
(
errors
!=
NULL
,
"No errors returned for a shader with invalid syntax
\n
"
);
ok
(
compiled
==
NULL
,
"A shader blob was returned for a shader with invalid syntax
\n
"
);
IUnknown_Release
(
errors
);
errors
=
NULL
;
hr
=
D3DCompile
(
invalid_identifiers_shader
,
strlen
(
invalid_identifiers_shader
),
NULL
,
NULL
,
NULL
,
"test"
,
"ps_2_0"
,
0
,
0
,
&
compiled
,
&
errors
);
ok
(
hr
!=
D3D_OK
,
"Pixel shader compilation successful on a shader with invalid variable and "
"function names
\n
"
);
ok
(
errors
!=
NULL
,
"No errors returned for a shader with invalid variable and function "
"names
\n
"
);
ok
(
compiled
==
NULL
,
"A shader blob was returend for a shader with invalid variable and "
"function names
\n
"
);
IUnknown_Release
(
errors
);
}
START_TEST
(
hlsl
)
{
D3DCAPS9
caps
;
...
...
@@ -580,6 +672,7 @@ START_TEST(hlsl)
test_conditionals
(
device
,
quad_geometry
,
vshader_passthru
);
test_float_vectors
(
device
,
quad_geometry
,
vshader_passthru
);
test_trig
(
device
,
quad_geometry
,
vshader_passthru
);
test_fail
(
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