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
a63af560
Commit
a63af560
authored
Mar 19, 2024
by
David Heidelberg
Committed by
Alexandre Julliard
Mar 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Replace LPDWORD cast with float_to_int function.
Borrowed from dlls/wined3d/wined3d_private.h Signed-off-by:
David Heidelberg
<
david@ixit.cz
>
parent
d0e37372
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
16 deletions
+29
-16
visual.c
dlls/d3d9/tests/visual.c
+29
-16
No files found.
dlls/d3d9/tests/visual.c
View file @
a63af560
...
...
@@ -29,6 +29,7 @@
*/
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
#include <math.h>
...
...
@@ -107,6 +108,18 @@ static BOOL compare_vec4(const struct vec4 *vec, float x, float y, float z, floa
&&
compare_float
(
vec
->
w
,
w
,
ulps
);
}
static
uint32_t
float_to_int
(
float
f
)
{
union
{
uint32_t
u
;
float
f
;
}
u
;
u
.
f
=
f
;
return
u
.
u
;
}
static
BOOL
adapter_is_warp
(
const
D3DADAPTER_IDENTIFIER9
*
identifier
)
{
return
!
strcmp
(
identifier
->
Driver
,
"d3d10warp.dll"
);
...
...
@@ -3511,10 +3524,10 @@ static void texbem_test(void)
generate_bumpmap_textures
(
device
);
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT00
,
*
(
LPDWORD
)
&
bumpenvmat
[
0
]
);
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT01
,
*
(
LPDWORD
)
&
bumpenvmat
[
1
]
);
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT10
,
*
(
LPDWORD
)
&
bumpenvmat
[
2
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT11
,
*
(
LPDWORD
)
&
bumpenvmat
[
3
]
);
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT00
,
float_to_int
(
bumpenvmat
[
0
])
);
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT01
,
float_to_int
(
bumpenvmat
[
1
])
);
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT10
,
float_to_int
(
bumpenvmat
[
2
])
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT11
,
float_to_int
(
bumpenvmat
[
3
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetVertexShader
(
device
,
NULL
);
...
...
@@ -3665,24 +3678,24 @@ static void texbem_test(void)
bumpenvmat
[
0
]
=-
1
.
0
;
bumpenvmat
[
2
]
=
2
.
0
;
bumpenvmat
[
1
]
=
0
.
0
;
bumpenvmat
[
3
]
=
0
.
0
;
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT00
,
*
(
LPDWORD
)
&
bumpenvmat
[
0
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT00
,
float_to_int
(
bumpenvmat
[
0
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT01
,
*
(
LPDWORD
)
&
bumpenvmat
[
1
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT01
,
float_to_int
(
bumpenvmat
[
1
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT10
,
*
(
LPDWORD
)
&
bumpenvmat
[
2
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT10
,
float_to_int
(
bumpenvmat
[
2
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT11
,
*
(
LPDWORD
)
&
bumpenvmat
[
3
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_BUMPENVMAT11
,
float_to_int
(
bumpenvmat
[
3
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
bumpenvmat
[
0
]
=
1
.
5
;
bumpenvmat
[
2
]
=
0
.
0
;
bumpenvmat
[
1
]
=
0
.
0
;
bumpenvmat
[
3
]
=
0
.
5
;
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
3
,
D3DTSS_BUMPENVMAT00
,
*
(
LPDWORD
)
&
bumpenvmat
[
0
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
3
,
D3DTSS_BUMPENVMAT00
,
float_to_int
(
bumpenvmat
[
0
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
3
,
D3DTSS_BUMPENVMAT01
,
*
(
LPDWORD
)
&
bumpenvmat
[
1
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
3
,
D3DTSS_BUMPENVMAT01
,
float_to_int
(
bumpenvmat
[
1
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
3
,
D3DTSS_BUMPENVMAT10
,
*
(
LPDWORD
)
&
bumpenvmat
[
2
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
3
,
D3DTSS_BUMPENVMAT10
,
float_to_int
(
bumpenvmat
[
2
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
3
,
D3DTSS_BUMPENVMAT11
,
*
(
LPDWORD
)
&
bumpenvmat
[
3
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
3
,
D3DTSS_BUMPENVMAT11
,
float_to_int
(
bumpenvmat
[
3
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetSamplerState
(
device
,
0
,
D3DSAMP_ADDRESSU
,
D3DTADDRESS_CLAMP
);
...
...
@@ -11028,13 +11041,13 @@ static void fixed_function_bumpmap_test(void)
/* Generate the textures */
generate_bumpmap_textures
(
device
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVMAT00
,
*
(
LPDWORD
)
&
bumpenvmat
[
0
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVMAT00
,
float_to_int
(
bumpenvmat
[
0
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVMAT01
,
*
(
LPDWORD
)
&
bumpenvmat
[
1
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVMAT01
,
float_to_int
(
bumpenvmat
[
1
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVMAT10
,
*
(
LPDWORD
)
&
bumpenvmat
[
2
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVMAT10
,
float_to_int
(
bumpenvmat
[
2
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVMAT11
,
*
(
LPDWORD
)
&
bumpenvmat
[
3
]
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_BUMPENVMAT11
,
float_to_int
(
bumpenvmat
[
3
])
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_COLOROP
,
D3DTOP_BUMPENVMAP
);
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