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
8f91327b
Commit
8f91327b
authored
Oct 12, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Only run the vertex/pixel shader constant apply tests when the implementation supports them.
parent
61d6a6bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
112 additions
and
79 deletions
+112
-79
stateblock.c
dlls/d3d9/tests/stateblock.c
+112
-79
No files found.
dlls/d3d9/tests/stateblock.c
View file @
8f91327b
...
@@ -1797,100 +1797,133 @@ static void test_shader_constant_apply(IDirect3DDevice9 *device)
...
@@ -1797,100 +1797,133 @@ static void test_shader_constant_apply(IDirect3DDevice9 *device)
static
const
float
vs_const
[]
=
{
1
.
0
f
,
2
.
0
f
,
3
.
0
f
,
4
.
0
f
};
static
const
float
vs_const
[]
=
{
1
.
0
f
,
2
.
0
f
,
3
.
0
f
,
4
.
0
f
};
static
const
float
ps_const
[]
=
{
5
.
0
f
,
6
.
0
f
,
7
.
0
f
,
8
.
0
f
};
static
const
float
ps_const
[]
=
{
5
.
0
f
,
6
.
0
f
,
7
.
0
f
,
8
.
0
f
};
IDirect3DStateBlock9
*
stateblock
;
IDirect3DStateBlock9
*
stateblock
;
DWORD
vs_version
,
ps_version
;
D3DCAPS9
caps
;
float
ret
[
4
];
float
ret
[
4
];
HRESULT
hr
;
HRESULT
hr
;
hr
=
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
0
,
initial
,
1
);
hr
=
IDirect3DDevice9_GetDeviceCaps
(
device
,
&
caps
);
ok
(
SUCCEEDED
(
hr
),
"SetVertexShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"GetDeviceCaps returned %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
1
,
initial
,
1
);
vs_version
=
caps
.
VertexShaderVersion
&
0xffff
;
ok
(
SUCCEEDED
(
hr
),
"SetVertexShaderConstantF returned %#x
\n
"
,
hr
);
ps_version
=
caps
.
PixelShaderVersion
&
0xffff
;
hr
=
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
0
,
initial
,
1
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShaderConstantF returned %#x
\n
"
,
hr
);
if
(
vs_version
)
hr
=
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
1
,
initial
,
1
);
{
ok
(
SUCCEEDED
(
hr
),
"SetPixelShaderConstantF returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
0
,
initial
,
1
);
ok
(
SUCCEEDED
(
hr
),
"SetVertexShaderConstantF returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
0
,
ret
,
1
);
hr
=
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
1
,
initial
,
1
);
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"SetVertexShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
0
,
ret
,
1
);
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
1
,
ret
,
1
);
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
1
,
ret
,
1
);
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
0
,
ret
,
1
);
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
"GetpixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
hr
=
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
0
,
vs_const
,
1
);
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
1
,
ret
,
1
);
ok
(
SUCCEEDED
(
hr
),
"SetVertexShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
}
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
if
(
ps_version
)
"GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
{
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
hr
=
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
0
,
initial
,
1
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShaderConstantF returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
0
,
vs_const
,
1
);
hr
=
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
1
,
initial
,
1
);
ok
(
SUCCEEDED
(
hr
),
"SetVertexShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShaderConstantF returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
0
,
ps_const
,
1
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShaderConstantF returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
0
,
ret
,
1
);
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
"GetpixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
1
,
ret
,
1
);
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
"GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
hr
=
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
0
,
ps_const
,
1
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShaderConstantF returned %#x
\n
"
,
hr
);
}
hr
=
IDirect3DDevice9_BeginStateBlock
(
device
);
hr
=
IDirect3DDevice9_BeginStateBlock
(
device
);
ok
(
SUCCEEDED
(
hr
),
"BeginStateBlock returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"BeginStateBlock returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
1
,
vs_const
,
1
);
if
(
vs_version
)
ok
(
SUCCEEDED
(
hr
),
"SetVertexShaderConstantF returned %#x
\n
"
,
hr
);
{
hr
=
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
1
,
ps_const
,
1
);
hr
=
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
1
,
vs_const
,
1
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"SetVertexShaderConstantF returned %#x
\n
"
,
hr
);
}
if
(
ps_version
)
{
hr
=
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
1
,
ps_const
,
1
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShaderConstantF returned %#x
\n
"
,
hr
);
}
hr
=
IDirect3DDevice9_EndStateBlock
(
device
,
&
stateblock
);
hr
=
IDirect3DDevice9_EndStateBlock
(
device
,
&
stateblock
);
ok
(
SUCCEEDED
(
hr
),
"EndStateBlock returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"EndStateBlock returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
0
,
ret
,
1
);
if
(
vs_version
)
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
{
ok
(
!
memcmp
(
ret
,
vs_const
,
sizeof
(
vs_const
)),
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
0
,
ret
,
1
);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
vs_const
[
0
],
vs_const
[
1
],
vs_const
[
2
],
vs_const
[
3
]);
ok
(
!
memcmp
(
ret
,
vs_const
,
sizeof
(
vs_const
)),
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
1
,
ret
,
1
);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
vs_const
[
0
],
vs_const
[
1
],
vs_const
[
2
],
vs_const
[
3
]);
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
1
,
ret
,
1
);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
0
,
ret
,
1
);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
ok
(
!
memcmp
(
ret
,
ps_const
,
sizeof
(
ps_const
)),
}
"GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
if
(
ps_version
)
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
ps_const
[
0
],
ps_const
[
1
],
ps_const
[
2
],
ps_const
[
3
]);
{
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
1
,
ret
,
1
);
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
0
,
ret
,
1
);
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
ok
(
!
memcmp
(
ret
,
ps_const
,
sizeof
(
ps_const
)),
"GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
"GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
ps_const
[
0
],
ps_const
[
1
],
ps_const
[
2
],
ps_const
[
3
]);
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
1
,
ret
,
1
);
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
!
memcmp
(
ret
,
initial
,
sizeof
(
initial
)),
"GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
initial
[
0
],
initial
[
1
],
initial
[
2
],
initial
[
3
]);
}
/* Apply doesn't overwrite constants that aren't explicitly set on the source stateblock. */
hr
=
IDirect3DStateBlock9_Apply
(
stateblock
);
hr
=
IDirect3DStateBlock9_Apply
(
stateblock
);
ok
(
SUCCEEDED
(
hr
),
"Apply returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Apply returned %#x
\n
"
,
hr
);
/* Apply doesn't overwrite constants that aren't explicitly set on the source stateblock. */
if
(
vs_version
)
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
0
,
ret
,
1
);
{
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
0
,
ret
,
1
);
ok
(
!
memcmp
(
ret
,
vs_const
,
sizeof
(
vs_const
)),
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ok
(
!
memcmp
(
ret
,
vs_const
,
sizeof
(
vs_const
)),
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
vs_const
[
0
],
vs_const
[
1
],
vs_const
[
2
],
vs_const
[
3
]);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
1
,
ret
,
1
);
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
vs_const
[
0
],
vs_const
[
1
],
vs_const
[
2
],
vs_const
[
3
]);
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
1
,
ret
,
1
);
ok
(
!
memcmp
(
ret
,
vs_const
,
sizeof
(
vs_const
)),
ok
(
SUCCEEDED
(
hr
),
"GetVertexShaderConstantF returned %#x
\n
"
,
hr
);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ok
(
!
memcmp
(
ret
,
vs_const
,
sizeof
(
vs_const
)),
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
vs_const
[
0
],
vs_const
[
1
],
vs_const
[
2
],
vs_const
[
3
]);
"GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
0
,
ret
,
1
);
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
vs_const
[
0
],
vs_const
[
1
],
vs_const
[
2
],
vs_const
[
3
]);
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
}
ok
(
!
memcmp
(
ret
,
ps_const
,
sizeof
(
ps_const
)),
if
(
ps_version
)
"GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
{
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
ps_const
[
0
],
ps_const
[
1
],
ps_const
[
2
],
ps_const
[
3
]);
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
0
,
ret
,
1
);
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
1
,
ret
,
1
);
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
!
memcmp
(
ret
,
ps_const
,
sizeof
(
ps_const
)),
ok
(
!
memcmp
(
ret
,
ps_const
,
sizeof
(
ps_const
)),
"GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
"GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
ps_const
[
0
],
ps_const
[
1
],
ps_const
[
2
],
ps_const
[
3
]);
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
ps_const
[
0
],
ps_const
[
1
],
ps_const
[
2
],
ps_const
[
3
]);
hr
=
IDirect3DDevice9_GetPixelShaderConstantF
(
device
,
1
,
ret
,
1
);
ok
(
SUCCEEDED
(
hr
),
"GetPixelShaderConstantF returned %#x
\n
"
,
hr
);
ok
(
!
memcmp
(
ret
,
ps_const
,
sizeof
(
ps_const
)),
"GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}
\n
"
,
ret
[
0
],
ret
[
1
],
ret
[
2
],
ret
[
3
],
ps_const
[
0
],
ps_const
[
1
],
ps_const
[
2
],
ps_const
[
3
]);
}
IDirect3DStateBlock9_Release
(
stateblock
);
IDirect3DStateBlock9_Release
(
stateblock
);
}
}
...
...
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