d3d9/tests: Use create_device for test_swvp_buffer.
This commit is contained in:
parent
d5b2e8af39
commit
8633f7f123
|
@ -34,6 +34,7 @@ struct vec3
|
|||
#define CREATE_DEVICE_FULLSCREEN 0x01
|
||||
#define CREATE_DEVICE_NOWINDOWCHANGES 0x02
|
||||
#define CREATE_DEVICE_FPU_PRESERVE 0x04
|
||||
#define CREATE_DEVICE_SWVP_ONLY 0x08
|
||||
|
||||
struct device_desc
|
||||
{
|
||||
|
@ -150,6 +151,8 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window, cons
|
|||
present_parameters.BackBufferHeight = desc->height;
|
||||
present_parameters.hDeviceWindow = desc->device_window;
|
||||
present_parameters.Windowed = !(desc->flags & CREATE_DEVICE_FULLSCREEN);
|
||||
if (desc->flags & CREATE_DEVICE_SWVP_ONLY)
|
||||
behavior_flags = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
|
||||
if (desc->flags & CREATE_DEVICE_NOWINDOWCHANGES)
|
||||
behavior_flags |= D3DCREATE_NOWINDOWCHANGES;
|
||||
if (desc->flags & CREATE_DEVICE_FPU_PRESERVE)
|
||||
|
@ -165,6 +168,8 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window, cons
|
|||
behavior_flags, &present_parameters, &device)))
|
||||
return device;
|
||||
|
||||
if (desc && desc->flags & CREATE_DEVICE_SWVP_ONLY)
|
||||
return NULL;
|
||||
behavior_flags ^= (D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_SOFTWARE_VERTEXPROCESSING);
|
||||
|
||||
if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window,
|
||||
|
@ -7239,7 +7244,7 @@ static void test_swvp_buffer(void)
|
|||
IDirect3DVertexBuffer9 *buffer;
|
||||
static const unsigned int bufsize = 1024;
|
||||
D3DVERTEXBUFFER_DESC desc;
|
||||
D3DPRESENT_PARAMETERS present_parameters = {0};
|
||||
struct device_desc device_desc;
|
||||
struct
|
||||
{
|
||||
float x, y, z;
|
||||
|
@ -7250,15 +7255,11 @@ static void test_swvp_buffer(void)
|
|||
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
|
||||
ok(!!d3d9, "Failed to create a D3D object.\n");
|
||||
|
||||
present_parameters.Windowed = TRUE;
|
||||
present_parameters.hDeviceWindow = window;
|
||||
present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
|
||||
present_parameters.BackBufferWidth = screen_width;
|
||||
present_parameters.BackBufferHeight = screen_height;
|
||||
present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8;
|
||||
present_parameters.EnableAutoDepthStencil = FALSE;
|
||||
if (FAILED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
|
||||
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device)))
|
||||
device_desc.device_window = window;
|
||||
device_desc.width = 640;
|
||||
device_desc.height = 480;
|
||||
device_desc.flags = CREATE_DEVICE_SWVP_ONLY;
|
||||
if (!(device = create_device(d3d9, window, &device_desc)))
|
||||
{
|
||||
skip("Failed to create a D3D device, skipping tests.\n");
|
||||
DestroyWindow(window);
|
||||
|
|
Loading…
Reference in New Issue