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
527882d4
Commit
527882d4
authored
Apr 17, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8/tests: Use a separate device for shadow_test().
parent
3068d827
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
28 deletions
+34
-28
visual.c
dlls/d3d8/tests/visual.c
+34
-28
No files found.
dlls/d3d8/tests/visual.c
View file @
527882d4
...
@@ -3137,8 +3137,18 @@ static void intz_test(IDirect3DDevice8 *device)
...
@@ -3137,8 +3137,18 @@ static void intz_test(IDirect3DDevice8 *device)
IDirect3DSurface8_Release
(
rt
);
IDirect3DSurface8_Release
(
rt
);
}
}
static
void
shadow_test
(
IDirect3DDevice8
*
device
)
static
void
shadow_test
(
void
)
{
{
IDirect3DSurface8
*
original_rt
,
*
rt
;
IDirect3DDevice8
*
device
;
IDirect3D8
*
d3d
;
ULONG
refcount
;
D3DCAPS8
caps
;
HWND
window
;
HRESULT
hr
;
DWORD
ps
;
UINT
i
;
static
const
DWORD
ps_code
[]
=
static
const
DWORD
ps_code
[]
=
{
{
0xffff0101
,
/* ps_1_1 */
0xffff0101
,
/* ps_1_1 */
...
@@ -3153,7 +3163,7 @@ static void shadow_test(IDirect3DDevice8 *device)
...
@@ -3153,7 +3163,7 @@ static void shadow_test(IDirect3DDevice8 *device)
0x40000001
,
0x80080000
,
0xa0aa0002
,
/* +mov r0.w, c2.z */
0x40000001
,
0x80080000
,
0xa0aa0002
,
/* +mov r0.w, c2.z */
0x0000ffff
,
/* end */
0x0000ffff
,
/* end */
};
};
struct
st
atic
const
st
ruct
{
{
D3DFORMAT
format
;
D3DFORMAT
format
;
const
char
*
name
;
const
char
*
name
;
...
@@ -3168,7 +3178,7 @@ static void shadow_test(IDirect3DDevice8 *device)
...
@@ -3168,7 +3178,7 @@ static void shadow_test(IDirect3DDevice8 *device)
{
D3DFMT_D24X4S4
,
"D3DFMT_D24X4S4"
},
{
D3DFMT_D24X4S4
,
"D3DFMT_D24X4S4"
},
{
D3DFMT_D16
,
"D3DFMT_D16"
},
{
D3DFMT_D16
,
"D3DFMT_D16"
},
};
};
struct
st
atic
const
st
ruct
{
{
float
x
,
y
,
z
;
float
x
,
y
,
z
;
float
s0
,
t0
,
p0
;
float
s0
,
t0
,
p0
;
...
@@ -3181,7 +3191,7 @@ static void shadow_test(IDirect3DDevice8 *device)
...
@@ -3181,7 +3191,7 @@ static void shadow_test(IDirect3DDevice8 *device)
{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
},
{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
},
};
};
struct
st
atic
const
st
ruct
{
{
UINT
x
,
y
;
UINT
x
,
y
;
D3DCOLOR
color
;
D3DCOLOR
color
;
...
@@ -3198,27 +3208,27 @@ static void shadow_test(IDirect3DDevice8 *device)
...
@@ -3198,27 +3208,27 @@ static void shadow_test(IDirect3DDevice8 *device)
{
240
,
60
,
D3DCOLOR_ARGB
(
0x00
,
0x00
,
0x00
,
0x00
)},
{
240
,
60
,
D3DCOLOR_ARGB
(
0x00
,
0x00
,
0x00
,
0x00
)},
};
};
IDirect3DSurface8
*
original_ds
,
*
original_rt
,
*
rt
;
window
=
CreateWindowA
(
"static"
,
"d3d8_test"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
IDirect3D8
*
d3d8
;
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
D3DCAPS8
caps
;
d3d
=
Direct3DCreate8
(
D3D_SDK_VERSION
);
HRESULT
hr
;
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
DWORD
ps
;
if
(
!
(
device
=
create_device
(
d3d
,
window
,
window
,
TRUE
)))
UINT
i
;
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
hr
=
IDirect3DDevice8_GetDeviceCaps
(
device
,
&
caps
);
hr
=
IDirect3DDevice8_GetDeviceCaps
(
device
,
&
caps
);
ok
(
SUCCEEDED
(
hr
),
"GetDeviceCaps failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"GetDeviceCaps failed, hr %#x.
\n
"
,
hr
);
if
(
caps
.
PixelShaderVersion
<
D3DPS_VERSION
(
1
,
1
))
if
(
caps
.
PixelShaderVersion
<
D3DPS_VERSION
(
1
,
1
))
{
{
skip
(
"No pixel shader 1.1 support, skipping shadow test.
\n
"
);
skip
(
"No pixel shader 1.1 support, skipping shadow test.
\n
"
);
return
;
IDirect3DDevice8_Release
(
device
);
goto
done
;
}
}
hr
=
IDirect3DDevice8_GetDirect3D
(
device
,
&
d3d8
);
ok
(
SUCCEEDED
(
hr
),
"GetDirect3D failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_GetRenderTarget
(
device
,
&
original_rt
);
hr
=
IDirect3DDevice8_GetRenderTarget
(
device
,
&
original_rt
);
ok
(
SUCCEEDED
(
hr
),
"GetRenderTarget failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"GetRenderTarget failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_GetDepthStencilSurface
(
device
,
&
original_ds
);
ok
(
SUCCEEDED
(
hr
),
"GetDepthStencilSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_CreateRenderTarget
(
device
,
1024
,
1024
,
D3DFMT_A8R8G8B8
,
hr
=
IDirect3DDevice8_CreateRenderTarget
(
device
,
1024
,
1024
,
D3DFMT_A8R8G8B8
,
D3DMULTISAMPLE_NONE
,
FALSE
,
&
rt
);
D3DMULTISAMPLE_NONE
,
FALSE
,
&
rt
);
...
@@ -3268,9 +3278,9 @@ static void shadow_test(IDirect3DDevice8 *device)
...
@@ -3268,9 +3278,9 @@ static void shadow_test(IDirect3DDevice8 *device)
IDirect3DSurface8
*
ds
;
IDirect3DSurface8
*
ds
;
unsigned
int
j
;
unsigned
int
j
;
hr
=
IDirect3D8_CheckDeviceFormat
(
d3d8
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
D3DFMT_X8R8G8B8
,
if
(
FAILED
(
IDirect3D8_CheckDeviceFormat
(
d3d
,
D3DADAPTER_DEFAULT
,
D3DDEVTYPE_HAL
,
D3D
USAGE_DEPTHSTENCIL
,
D3DRTYPE_TEXTURE
,
format
);
D3D
FMT_X8R8G8B8
,
D3DUSAGE_DEPTHSTENCIL
,
D3DRTYPE_TEXTURE
,
format
)))
if
(
FAILED
(
hr
))
continue
;
continue
;
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
1024
,
1024
,
1
,
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
1024
,
1024
,
1
,
D3DUSAGE_DEPTHSTENCIL
,
format
,
D3DPOOL_DEFAULT
,
&
texture
);
D3DUSAGE_DEPTHSTENCIL
,
format
,
D3DPOOL_DEFAULT
,
&
texture
);
...
@@ -3335,19 +3345,15 @@ static void shadow_test(IDirect3DDevice8 *device)
...
@@ -3335,19 +3345,15 @@ static void shadow_test(IDirect3DDevice8 *device)
ok
(
SUCCEEDED
(
hr
),
"Present failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Present failed, hr %#x.
\n
"
,
hr
);
}
}
hr
=
IDirect3DDevice8_SetPixelShader
(
device
,
0
);
ok
(
SUCCEEDED
(
hr
),
"SetPixelShader failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_DeletePixelShader
(
device
,
ps
);
hr
=
IDirect3DDevice8_DeletePixelShader
(
device
,
ps
);
ok
(
SUCCEEDED
(
hr
),
"DeletePixelShader failed, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"DeletePixelShader failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_SetRenderTarget
(
device
,
original_rt
,
original_ds
);
ok
(
SUCCEEDED
(
hr
),
"SetRenderTarget failed, hr %#x.
\n
"
,
hr
);
IDirect3DSurface8_Release
(
original_ds
);
IDirect3DSurface8_Release
(
original_rt
);
IDirect3DSurface8_Release
(
original_rt
);
IDirect3DSurface8_Release
(
rt
);
IDirect3DSurface8_Release
(
rt
);
refcount
=
IDirect3DDevice8_Release
(
device
);
IDirect3D8_Release
(
d3d8
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
done:
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
}
}
static
void
multisample_copy_rects_test
(
void
)
static
void
multisample_copy_rects_test
(
void
)
...
@@ -4816,7 +4822,6 @@ START_TEST(visual)
...
@@ -4816,7 +4822,6 @@ START_TEST(visual)
depth_buffer_test
(
device_ptr
);
depth_buffer_test
(
device_ptr
);
depth_buffer2_test
(
device_ptr
);
depth_buffer2_test
(
device_ptr
);
intz_test
(
device_ptr
);
intz_test
(
device_ptr
);
shadow_test
(
device_ptr
);
refcount
=
IDirect3DDevice8_Release
(
device_ptr
);
refcount
=
IDirect3DDevice8_Release
(
device_ptr
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
...
@@ -4824,6 +4829,7 @@ cleanup:
...
@@ -4824,6 +4829,7 @@ cleanup:
IDirect3D8_Release
(
d3d
);
IDirect3D8_Release
(
d3d
);
DestroyWindow
(
window
);
DestroyWindow
(
window
);
shadow_test
();
multisample_copy_rects_test
();
multisample_copy_rects_test
();
zenable_test
();
zenable_test
();
resz_test
();
resz_test
();
...
...
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