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
91d3dcff
Commit
91d3dcff
authored
Mar 19, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Use a separate device for texop_range_test().
parent
33b32c9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
21 deletions
+46
-21
visual.c
dlls/d3d9/tests/visual.c
+46
-21
No files found.
dlls/d3d9/tests/visual.c
View file @
91d3dcff
...
...
@@ -10700,37 +10700,61 @@ static void yuv_layout_test(IDirect3DDevice9 *device)
IDirect3D9_Release
(
d3d
);
}
static
void
texop_range_test
(
IDirect3DDevice9
*
device
)
static
void
texop_range_test
(
void
)
{
static
const
struct
{
IDirect3DTexture9
*
texture
;
D3DLOCKED_RECT
locked_rect
;
IDirect3DDevice9
*
device
;
IDirect3D9
*
d3d
;
ULONG
refcount
;
D3DCAPS9
caps
;
DWORD
color
;
HWND
window
;
HRESULT
hr
;
static
const
struct
{
float
x
,
y
,
z
;
D3DCOLOR
diffuse
;
}
quad
[]
=
{
}
quad
[]
=
{
{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
,
D3DCOLOR_ARGB
(
0xff
,
0xff
,
0xff
,
0xff
)},
{
-
1
.
0
f
,
1
.
0
f
,
0
.
1
f
,
D3DCOLOR_ARGB
(
0xff
,
0xff
,
0xff
,
0xff
)},
{
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
,
D3DCOLOR_ARGB
(
0xff
,
0xff
,
0xff
,
0xff
)},
{
1
.
0
f
,
1
.
0
f
,
0
.
1
f
,
D3DCOLOR_ARGB
(
0xff
,
0xff
,
0xff
,
0xff
)}
};
HRESULT
hr
;
IDirect3DTexture9
*
texture
;
D3DLOCKED_RECT
locked_rect
;
D3DCAPS9
caps
;
DWORD
color
;
window
=
CreateWindowA
(
"static"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
);
d3d
=
Direct3DCreate9
(
D3D_SDK_VERSION
);
ok
(
!!
d3d
,
"Failed to create a D3D object.
\n
"
);
if
(
!
(
device
=
create_device
(
d3d
,
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
/* We need ADD and SUBTRACT operations */
hr
=
IDirect3DDevice9_GetDeviceCaps
(
device
,
&
caps
);
ok
(
SUCCEEDED
(
hr
),
"GetDeviceCaps failed with 0x%08x
\n
"
,
hr
);
if
(
!
(
caps
.
TextureOpCaps
&
D3DTEXOPCAPS_ADD
))
{
skip
(
"D3DTOP_ADD is not supported, skipping value range test
\n
"
);
return
;
if
(
!
(
caps
.
TextureOpCaps
&
D3DTEXOPCAPS_ADD
))
{
skip
(
"D3DTOP_ADD is not supported, skipping value range test.
\n
"
);
IDirect3DDevice9_Release
(
device
);
goto
done
;
}
if
(
!
(
caps
.
TextureOpCaps
&
D3DTEXOPCAPS_SUBTRACT
))
{
skip
(
"D3DTEXOPCAPS_SUBTRACT is not supported, skipping value range test
\n
"
);
return
;
if
(
!
(
caps
.
TextureOpCaps
&
D3DTEXOPCAPS_SUBTRACT
))
{
skip
(
"D3DTEXOPCAPS_SUBTRACT is not supported, skipping value range test.
\n
"
);
IDirect3DDevice9_Release
(
device
);
goto
done
;
}
hr
=
IDirect3DDevice9_SetFVF
(
device
,
D3DFVF_XYZ
|
D3DFVF_DIFFUSE
);
ok
(
SUCCEEDED
(
hr
),
"SetFVF failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetRenderState
(
device
,
D3DRS_LIGHTING
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set render state, hr %#x.
\n
"
,
hr
);
/* Stage 1: result = diffuse(=1.0) + diffuse
* stage 2: result = result - tfactor(= 0.5)
*/
...
...
@@ -10749,6 +10773,8 @@ static void texop_range_test(IDirect3DDevice9 *device)
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_COLOROP
,
D3DTOP_SUBTRACT
);
ok
(
SUCCEEDED
(
hr
),
"SetTextureStageState failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0x00000000
,
1
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear device, hr %#x.
\n\n
"
,
hr
);
hr
=
IDirect3DDevice9_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"BeginScene failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_DrawPrimitiveUP
(
device
,
D3DPT_TRIANGLESTRIP
,
2
,
quad
,
sizeof
(
*
quad
));
...
...
@@ -10803,13 +10829,12 @@ static void texop_range_test(IDirect3DDevice9 *device)
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
0
,
D3DTSS_COLOROP
,
D3DTOP_DISABLE
);
ok
(
SUCCEEDED
(
hr
),
"SetTextureStageState failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTextureStageState
(
device
,
1
,
D3DTSS_COLOROP
,
D3DTOP_DISABLE
);
ok
(
SUCCEEDED
(
hr
),
"SetTextureStageState failed with 0x%08x
\n
"
,
hr
);
hr
=
IDirect3DDevice9_SetTexture
(
device
,
0
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"SetTexture failed with 0x%08x
\n
"
,
hr
);
IDirect3DTexture9_Release
(
texture
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
done:
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
window
);
}
static
void
alphareplicate_test
(
void
)
...
...
@@ -15724,11 +15749,11 @@ START_TEST(visual)
else
skip
(
"No ps_1_1 support
\n
"
);
texop_test
(
device_ptr
);
texop_range_test
(
device_ptr
);
cleanup_device
(
device_ptr
);
device_ptr
=
NULL
;
texop_range_test
();
alphareplicate_test
();
dp3_alpha_test
();
depth_buffer_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