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
b5742fb9
Commit
b5742fb9
authored
Dec 11, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Add a test for instructions taking a scalar source.
parent
544e52bf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
102 additions
and
71 deletions
+102
-71
visual.c
dlls/d3d8/tests/visual.c
+102
-71
No files found.
dlls/d3d8/tests/visual.c
View file @
b5742fb9
...
...
@@ -1685,114 +1685,145 @@ out:
ok
(
SUCCEEDED
(
hr
),
"Failed to enable z writes, hr %#x.
\n
"
,
hr
);
}
static
void
test_
rcp_rsq
(
IDirect3DDevice8
*
device
)
static
void
test_
scalar_instructions
(
IDirect3DDevice8
*
device
)
{
HRESULT
hr
;
DWORD
shader
;
DWORD
color
;
float
constant
[
4
]
=
{
1
.
0
,
1
.
0
,
1
.
0
,
2
.
0
};
static
const
float
quad
[][
3
]
=
{
static
const
struct
vec3
quad
[]
=
{
{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
},
{
-
1
.
0
f
,
1
.
0
f
,
0
.
0
f
},
{
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
},
{
1
.
0
f
,
1
.
0
f
,
0
.
0
f
},
};
static
const
DWORD
decl
[]
=
{
D3DVSD_STREAM
(
0
),
D3DVSD_REG
(
D3DVSDE_POSITION
,
D3DVSDT_FLOAT3
),
/* dcl_position v0 */
D3DVSD_CONST
(
0
,
1
),
0x3e800000
,
0x3f000000
,
0x3f800000
,
0x40000000
,
/* def c0, 0.25, 0.5, 1.0, 2.0 */
D3DVSD_END
()
};
static
const
DWORD
rcp_test
[]
=
{
0xfffe0101
,
/* vs.1.1 */
0xfffe0101
,
/* vs_1_1 */
0x0009fffe
,
0x30303030
,
0x30303030
,
/* Shaders have to have a minimal size. */
0x30303030
,
0x30303030
,
0x30303030
,
/* Add a filler comment. Usually
D3DX8's
*/
0x30303030
,
0x30303030
,
0x30303030
,
/* Add a filler comment. Usually
d3dx8's
*/
0x30303030
,
0x30303030
,
0x30303030
,
/* version comment makes the shader big */
0x00303030
,
/* enough to make windows happy */
0x00303030
,
/* enough to make Windows happy. */
0x00000001
,
0xc00f0000
,
0x90e40000
,
/* mov oPos, v0 */
0x00000006
,
0xd00f0000
,
0xa0e40000
,
/* rcp oD0, c0 */
0x0000ffff
/* END */
};
static
const
DWORD
rsq_test
[]
=
{
0xfffe0101
,
/* vs.1.1 */
0xfffe0101
,
/* vs_1_1 */
0x0009fffe
,
0x30303030
,
0x30303030
,
/* Shaders have to have a minimal size. */
0x30303030
,
0x30303030
,
0x30303030
,
/* Add a filler comment. Usually
D3DX8's
*/
0x30303030
,
0x30303030
,
0x30303030
,
/* Add a filler comment. Usually
d3dx8's
*/
0x30303030
,
0x30303030
,
0x30303030
,
/* version comment makes the shader big */
0x00303030
,
/* enough to make windows happy */
0x00303030
,
/* enough to make Windows happy. */
0x00000001
,
0xc00f0000
,
0x90e40000
,
/* mov oPos, v0 */
0x00000007
,
0xd00f0000
,
0xa0e40000
,
/* rsq oD0, c0 */
0x0000ffff
/* END */
};
DWORD
decl
[]
=
static
const
DWORD
exp_test
[]
=
{
D3DVSD_STREAM
(
0
),
D3DVSD_REG
(
D3DVSDE_POSITION
,
D3DVSDT_FLOAT3
),
/* D3DVSDE_POSITION, Register v0 */
D3DVSD_END
()
0xfffe0101
,
/* vs_1_1 */
0x0009fffe
,
0x30303030
,
0x30303030
,
/* Shaders have to have a minimal size. */
0x30303030
,
0x30303030
,
0x30303030
,
/* Add a filler comment. Usually d3dx8's */
0x30303030
,
0x30303030
,
0x30303030
,
/* version comment makes the shader big */
0x00303030
,
/* enough to make Windows happy. */
0x00000001
,
0xc00f0000
,
0x90e40000
,
/* mov oPos, v0 */
0x0000000e
,
0x800f0000
,
0xa0e40000
,
/* exp r0, c0 */
0x00000006
,
0xd00f0000
,
0x80000000
,
/* rcp oD0, r0.x */
0x0000ffff
,
/* END */
};
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0xff336699
,
0
.
0
f
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_Clear failed with %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreateVertexShader
(
device
,
decl
,
rcp_test
,
&
shader
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_CreateVertexShader returned with %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetVertexShader
(
device
,
shader
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_SetVertexShader returned %#08x
\n
"
,
hr
);
IDirect3DDevice8_SetVertexShaderConstant
(
device
,
0
,
constant
,
1
);
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_BeginScene returned %#08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
static
const
DWORD
expp_test
[]
=
{
hr
=
IDirect3DDevice8_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
&
quad
[
0
],
3
*
sizeof
(
float
));
ok
(
SUCCEEDED
(
hr
),
"DrawPrimitiveUP failed (%#08x)
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_EndScene returned %#08x
\n
"
,
hr
);
0xfffe0101
,
/* vs_1_1 */
0x0009fffe
,
0x30303030
,
0x30303030
,
/* Shaders have to have a minimal size. */
0x30303030
,
0x30303030
,
0x30303030
,
/* Add a filler comment. Usually d3dx8's */
0x30303030
,
0x30303030
,
0x30303030
,
/* version comment makes the shader big */
0x00303030
,
/* enough to make Windows happy. */
0x00000001
,
0xc00f0000
,
0x90e40000
,
/* mov oPos, v0 */
0x0000004e
,
0x800f0000
,
0xa0e40000
,
/* expp r0, c0 */
0x00000006
,
0xd00f0000
,
0x80000000
,
/* rcp oD0, r0.x */
0x0000ffff
,
/* END */
};
static
const
DWORD
log_test
[]
=
{
0xfffe0101
,
/* vs_1_1 */
0x0009fffe
,
0x30303030
,
0x30303030
,
/* Shaders have to have a minimal size. */
0x30303030
,
0x30303030
,
0x30303030
,
/* Add a filler comment. Usually d3dx8's */
0x30303030
,
0x30303030
,
0x30303030
,
/* version comment makes the shader big */
0x00303030
,
/* enough to make Windows happy. */
0x00000001
,
0xc00f0000
,
0x90e40000
,
/* mov oPos, v0 */
0x0000000f
,
0xd00f0000
,
0xa0e40000
,
/* log oD0, c0 */
0x0000ffff
,
/* END */
};
static
const
DWORD
logp_test
[]
=
{
0xfffe0101
,
/* vs_1_1 */
0x0009fffe
,
0x30303030
,
0x30303030
,
/* Shaders have to have a minimal size. */
0x30303030
,
0x30303030
,
0x30303030
,
/* Add a filler comment. Usually d3dx8's */
0x30303030
,
0x30303030
,
0x30303030
,
/* version comment makes the shader big */
0x00303030
,
/* enough to make Windows happy. */
0x00000001
,
0xc00f0000
,
0x90e40000
,
/* mov oPos, v0 */
0x0000004f
,
0xd00f0000
,
0xa0e40000
,
/* logp oD0, c0 */
0x0000ffff
,
/* END */
};
static
const
struct
{
const
char
*
name
;
const
DWORD
*
byte_code
;
D3DCOLOR
color
;
BOOL
todo
;
}
test_data
[]
=
{
{
"rcp_test"
,
rcp_test
,
D3DCOLOR_ARGB
(
0x00
,
0x80
,
0x80
,
0x80
),
FALSE
},
{
"rsq_test"
,
rsq_test
,
D3DCOLOR_ARGB
(
0x00
,
0xb4
,
0xb4
,
0xb4
),
FALSE
},
{
"exp_test"
,
exp_test
,
D3DCOLOR_ARGB
(
0x00
,
0x40
,
0x40
,
0x40
),
TRUE
},
{
"expp_test"
,
expp_test
,
D3DCOLOR_ARGB
(
0x00
,
0x40
,
0x40
,
0x40
),
TRUE
},
{
"log_test"
,
log_test
,
D3DCOLOR_ARGB
(
0x00
,
0xff
,
0xff
,
0xff
),
TRUE
},
{
"logp_test"
,
logp_test
,
D3DCOLOR_ARGB
(
0x00
,
0xff
,
0xff
,
0xff
),
TRUE
},
};
unsigned
int
i
;
DWORD
shader
;
DWORD
color
;
HRESULT
hr
;
color
=
getPixelColor
(
device
,
320
,
240
);
ok
(
color_match
(
color
,
D3DCOLOR_ARGB
(
0x00
,
0x80
,
0x80
,
0x80
),
4
),
"RCP test returned color 0x%08x, expected 0x00808080.
\n
"
,
color
);
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed (%#08x)
\n
"
,
hr
);
IDirect3DDevice8_SetVertexShader
(
device
,
0
);
IDirect3DDevice8_DeleteVertexShader
(
device
,
shader
);
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0xff996633
,
0
.
0
f
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_Clear failed with %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreateVertexShader
(
device
,
decl
,
rsq_test
,
&
shader
,
0
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_CreateVertexShader returned with %#08x
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
test_data
)
/
sizeof
(
*
test_data
);
++
i
)
{
hr
=
IDirect3DDevice8_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0xff336699
,
0
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to clear, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirect3DDevice8_CreateVertexShader
(
device
,
decl
,
test_data
[
i
].
byte_code
,
&
shader
,
0
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to create vertex shader, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirect3DDevice8_SetVertexShader
(
device
,
shader
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_SetVertexShader returned %#08x
\n
"
,
hr
);
IDirect3DDevice8_SetVertexShaderConstant
(
device
,
0
,
constant
,
1
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to set vertex shader, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_BeginScene returned %#08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to begin scene, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirect3DDevice8_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
&
quad
[
0
],
3
*
sizeof
(
float
));
ok
(
SUCCEEDED
(
hr
),
"
DrawPrimitiveUP failed (%#08x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"
%s: Failed to draw primitive, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice8_EndScene returned %#08x
\n
"
,
hr
);
}
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to end scene, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
color
=
getPixelColor
(
device
,
320
,
240
);
ok
(
color_match
(
color
,
D3DCOLOR_ARGB
(
0x00
,
0xb4
,
0xb4
,
0xb4
),
4
),
"RSQ test returned color 0x%08x, expected 0x00b4b4b4.
\n
"
,
color
);
if
(
test_data
[
i
].
todo
)
todo_wine
ok
(
color_match
(
color
,
test_data
[
i
].
color
,
4
),
"%s: Got unexpected color 0x%08x, expected 0x%08x.
\n
"
,
test_data
[
i
].
name
,
color
,
test_data
[
i
].
color
);
else
ok
(
color_match
(
color
,
test_data
[
i
].
color
,
4
),
"%s: Got unexpected color 0x%08x, expected 0x%08x.
\n
"
,
test_data
[
i
].
name
,
color
,
test_data
[
i
].
color
);
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed (%#08x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to present, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
IDirect3DDevice8_SetVertexShader
(
device
,
0
);
IDirect3DDevice8_DeleteVertexShader
(
device
,
shader
);
hr
=
IDirect3DDevice8_SetVertexShader
(
device
,
0
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to set vertex shader, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
hr
=
IDirect3DDevice8_DeleteVertexShader
(
device
,
shader
);
ok
(
SUCCEEDED
(
hr
),
"%s: Failed to delete vertex shader, hr %#x.
\n
"
,
test_data
[
i
].
name
,
hr
);
}
}
static
void
offscreen_test
(
IDirect3DDevice8
*
device
)
...
...
@@ -4726,7 +4757,7 @@ START_TEST(visual)
if
(
caps
.
VertexShaderVersion
>=
D3DVS_VERSION
(
1
,
1
))
{
test_
rcp_rsq
(
device_ptr
);
test_
scalar_instructions
(
device_ptr
);
if
(
caps
.
PixelShaderVersion
>=
D3DPS_VERSION
(
1
,
1
))
{
fog_with_shader_test
(
device_ptr
);
...
...
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