Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
b1758911
Commit
b1758911
authored
10 years ago
by
Henri Verbeet
Committed by
Alexandre Julliard
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d9/tests: Use a separate device for texkill_test().
parent
3cc2d639
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/d3d9/tests/visual.c
+45
-18
45 additions, 18 deletions
dlls/d3d9/tests/visual.c
with
45 additions
and
18 deletions
dlls/d3d9/tests/visual.c
+
45
−
18
View file @
b1758911
...
...
@@ -4908,20 +4908,25 @@ static void texdepth_test(IDirect3DDevice9 *device)
ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);
}
static void texkill_test(
IDirect3DDevice9 *device
)
static void texkill_test(
void
)
{
IDirect3DPixelShader9 *shader;
HRESULT hr;
IDirect3DDevice9 *device;
IDirect3D9 *d3d;
ULONG refcount;
D3DCAPS9 caps;
DWORD color;
HWND window;
HRESULT hr;
const float vertex[] = {
/* bottom top right left */
-1.0, -1.0, 1.0, -0.1, 0.9, 0.9, -0.1,
1.0, -1.0, 0.0, 0.9, -0.1, 0.9, -0.1,
-1.0, 1.0, 1.0, -0.1, 0.9, -0.1, 0.9,
1.0, 1.0, 0.0, 0.9, -0.1, -0.1, 0.9,
static const float vertex[] =
{
/* bottom top right left */
-1.0f, -1.0f, 1.0f, -0.1f, 0.9f, 0.9f, -0.1f,
-1.0f, 1.0f, 1.0f, -0.1f, 0.9f, -0.1f, 0.9f,
1.0f, -1.0f, 0.0f, 0.9f, -0.1f, 0.9f, -0.1f,
1.0f, 1.0f, 0.0f, 0.9f, -0.1f, -0.1f, 0.9f,
};
static const DWORD shader_code_11[] =
{
0xffff0101, /* ps_1_1 */
...
...
@@ -4940,7 +4945,26 @@ static void texkill_test(IDirect3DDevice9 *device)
0x0000ffff /* end */
};
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0, 0);
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;
}
hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
if (caps.PixelShaderVersion < D3DPS_VERSION(1, 1))
{
skip("No ps_1_1 support, skipping tests.\n");
IDirect3DDevice9_Release(device);
goto done;
}
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ff00, 1.0f, 0);
ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_CreatePixelShader(device, shader_code_11, &shader);
ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr);
...
...
@@ -5003,10 +5027,11 @@ static void texkill_test(IDirect3DDevice9 *device)
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffff00, 0.0, 0);
ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr);
hr = IDirect3DDevice9_CreatePixelShader(device, shader_code_20, &shader);
if(FAILED(hr)) {
skip("Failed to create 2.0 test shader, most likely not supported\n");
return;
if (FAILED(IDirect3DDevice9_CreatePixelShader(device, shader_code_20, &shader)))
{
skip("Failed to create 2.0 test shader, most likely not supported.\n");
IDirect3DDevice9_Release(device);
goto done;
}
hr = IDirect3DDevice9_SetPixelShader(device, shader);
...
...
@@ -5060,10 +5085,12 @@ static void texkill_test(IDirect3DDevice9 *device)
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr);
/* Cleanup */
hr = IDirect3DDevice9_SetPixelShader(device, NULL);
ok(SUCCEEDED(hr), "SetPixelShader failed (%08x)\n", hr);
IDirect3DPixelShader9_Release(shader);
refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
done:
IDirect3D9_Release(d3d);
DestroyWindow(window);
}
static void x8l8v8u8_test(void)
...
...
@@ -16017,13 +16044,13 @@ START_TEST(visual)
{
texbem_test(device_ptr);
texdepth_test(device_ptr);
texkill_test(device_ptr);
}
else skip("No ps_1_1 support\n");
cleanup_device(device_ptr);
device_ptr = NULL;
texkill_test();
x8l8v8u8_test();
volume_v16u16_test();
constant_clamp_ps_test();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment