Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/d3d9/tests/device.c | 299 +++++++++++++++++++++++---------------- 1 file changed, 174 insertions(+), 125 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index d00a26b942c..64802bb15db 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -150,7 +150,8 @@ static BOOL adapter_is_warp(const D3DADAPTER_IDENTIFIER9 *identifier) return !strcmp(identifier->Driver, "d3d10warp.dll"); }
-static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window, const struct device_desc *desc) +static IDirect3DDevice9 *create_device_on_adapter(IDirect3D9 *d3d9, unsigned int adapter_idx, + HWND focus_window, const struct device_desc *desc) { D3DPRESENT_PARAMETERS present_parameters = {0}; IDirect3DDevice9 *device; @@ -185,12 +186,12 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window, cons behavior_flags |= D3DCREATE_FPU_PRESERVE; }
- if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, + if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, adapter_idx, D3DDEVTYPE_HAL, focus_window, behavior_flags, &present_parameters, &device))) return device;
present_parameters.AutoDepthStencilFormat = D3DFMT_D16; - if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, + if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, adapter_idx, D3DDEVTYPE_HAL, focus_window, behavior_flags, &present_parameters, &device))) return device;
@@ -200,13 +201,18 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window, cons & ~(D3DCREATE_MIXED_VERTEXPROCESSING | D3DCREATE_SOFTWARE_VERTEXPROCESSING)) | D3DCREATE_HARDWARE_VERTEXPROCESSING;
- if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, + if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, adapter_idx, D3DDEVTYPE_HAL, focus_window, behavior_flags, &present_parameters, &device))) return device;
return NULL; }
+static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window, const struct device_desc *desc) +{ + return create_device_on_adapter(d3d9, D3DADAPTER_DEFAULT, focus_window, desc); +} + static HRESULT reset_device(IDirect3DDevice9 *device, const struct device_desc *desc) { D3DPRESENT_PARAMETERS present_parameters = {0}; @@ -12555,8 +12561,41 @@ static void test_stretch_rect(void) DestroyWindow(window); }
+#define test_device_caps_adapter_group(a, b, c) _test_device_caps_adapter_group(a, b, c, __LINE__) +static void _test_device_caps_adapter_group(const D3DCAPS9 *caps, unsigned int adapter_idx, + unsigned int adapter_count, int line) +{ + ok_(__FILE__, line)(caps->AdapterOrdinal == adapter_idx, "Expect AdapterOrdinal %u, got %u.\n", + adapter_idx, caps->AdapterOrdinal); + /* Single GPU */ + if (caps->NumberOfAdaptersInGroup == adapter_count) + { + ok_(__FILE__, line)(caps->MasterAdapterOrdinal == 0, + "Expect MasterAdapterOrdinal %u, got %u.\n", 0, caps->MasterAdapterOrdinal); + ok_(__FILE__, line)(caps->AdapterOrdinalInGroup == caps->AdapterOrdinal, + "Expect AdapterOrdinalInGroup %u, got %u.\n", caps->AdapterOrdinal, + caps->AdapterOrdinalInGroup); + ok_(__FILE__, line)(caps->NumberOfAdaptersInGroup == + (caps->AdapterOrdinalInGroup ? 0 : adapter_count), + "Expect NumberOfAdaptersInGroup %u, got %u.\n", + (caps->AdapterOrdinalInGroup ? 0 : adapter_count), + caps->NumberOfAdaptersInGroup); + } + /* Multiple GPUs and each GPU has only one output */ + else if (caps->NumberOfAdaptersInGroup == 1) + { + ok_(__FILE__, line)(caps->MasterAdapterOrdinal == caps->AdapterOrdinal, + "Expect MasterAdapterOrdinal %u, got %u.\n", caps->AdapterOrdinal, + caps->MasterAdapterOrdinal); + ok_(__FILE__, line)(caps->AdapterOrdinalInGroup == 0, + "Expect AdapterOrdinalInGroup %u, got %u.\n", 0, caps->AdapterOrdinalInGroup); + } + /* TODO: Test other multi-GPU setup */ +} + static void test_device_caps(void) { + unsigned int adapter_idx, adapter_count; IDirect3DDevice9 *device; IDirect3D9 *d3d; ULONG refcount; @@ -12568,129 +12607,139 @@ static void test_device_caps(void) d3d = Direct3DCreate9(D3D_SDK_VERSION); ok(!!d3d, "Failed to create a D3D object.\n");
- if (!(device = create_device(d3d, window, NULL))) + adapter_count = IDirect3D9_GetAdapterCount(d3d); + for (adapter_idx = 0; adapter_idx < adapter_count; ++adapter_idx) { - skip("Failed to create a D3D device.\n"); - IDirect3D9_Release(d3d); - DestroyWindow(window); - return; + /* Test IDirect3D9_GetDeviceCaps */ + hr = IDirect3D9_GetDeviceCaps(d3d, adapter_idx, D3DDEVTYPE_HAL, &caps); + ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "GetDeviceCaps failed, hr %#x.\n", hr); + if (hr == D3DERR_NOTAVAILABLE) + { + skip("No Direct3D support, skipping test.\n"); + break; + } + test_device_caps_adapter_group(&caps, adapter_idx, adapter_count); + + /* Test IDirect3DDevice9_GetDeviceCaps */ + device = create_device_on_adapter(d3d, adapter_idx, window, NULL); + ok(!!device, "Failed to create a D3D device on adapter %u.\n", adapter_idx); + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + + test_device_caps_adapter_group(&caps, adapter_idx, adapter_count); + ok(!(caps.Caps & ~D3DCAPS_READ_SCANLINE), "Caps field has unexpected flags %#x.\n", caps.Caps); + ok(!(caps.Caps2 & ~(D3DCAPS2_NO2DDURING3DSCENE | D3DCAPS2_FULLSCREENGAMMA + | D3DCAPS2_CANRENDERWINDOWED | D3DCAPS2_CANCALIBRATEGAMMA | D3DCAPS2_RESERVED + | D3DCAPS2_CANMANAGERESOURCE | D3DCAPS2_DYNAMICTEXTURES | D3DCAPS2_CANAUTOGENMIPMAP + | D3DCAPS2_CANSHARERESOURCE)), + "Caps2 field has unexpected flags %#x.\n", caps.Caps2); + /* AMD doesn't filter all the ddraw / d3d9 caps. Consider that behavior + * broken. */ + ok(!(caps.Caps3 & ~(D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD + | D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION | D3DCAPS3_COPY_TO_VIDMEM + | D3DCAPS3_COPY_TO_SYSTEMMEM | D3DCAPS3_DXVAHD | D3DCAPS3_DXVAHD_LIMITED + | D3DCAPS3_RESERVED)), + "Caps3 field has unexpected flags %#x.\n", caps.Caps3); + ok(!(caps.PrimitiveMiscCaps & ~(D3DPMISCCAPS_MASKZ | D3DPMISCCAPS_LINEPATTERNREP + | D3DPMISCCAPS_CULLNONE | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_CULLCCW + | D3DPMISCCAPS_COLORWRITEENABLE | D3DPMISCCAPS_CLIPPLANESCALEDPOINTS + | D3DPMISCCAPS_CLIPTLVERTS | D3DPMISCCAPS_TSSARGTEMP | D3DPMISCCAPS_BLENDOP + | D3DPMISCCAPS_NULLREFERENCE | D3DPMISCCAPS_INDEPENDENTWRITEMASKS + | D3DPMISCCAPS_PERSTAGECONSTANT | D3DPMISCCAPS_FOGANDSPECULARALPHA + | D3DPMISCCAPS_SEPARATEALPHABLEND | D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS + | D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING | D3DPMISCCAPS_FOGVERTEXCLAMPED + | D3DPMISCCAPS_POSTBLENDSRGBCONVERT)), + "PrimitiveMiscCaps field has unexpected flags %#x.\n", caps.PrimitiveMiscCaps); + ok(!(caps.RasterCaps & ~(D3DPRASTERCAPS_DITHER | D3DPRASTERCAPS_ZTEST + | D3DPRASTERCAPS_FOGVERTEX | D3DPRASTERCAPS_FOGTABLE + | D3DPRASTERCAPS_MIPMAPLODBIAS | D3DPRASTERCAPS_ZBUFFERLESSHSR + | D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_ANISOTROPY | D3DPRASTERCAPS_WBUFFER + | D3DPRASTERCAPS_WFOG | D3DPRASTERCAPS_ZFOG | D3DPRASTERCAPS_COLORPERSPECTIVE + | D3DPRASTERCAPS_SCISSORTEST | D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS + | D3DPRASTERCAPS_DEPTHBIAS | D3DPRASTERCAPS_MULTISAMPLE_TOGGLE)) + || broken(!(caps.RasterCaps & ~0x0f736191)), + "RasterCaps field has unexpected flags %#x.\n", caps.RasterCaps); + /* D3DPBLENDCAPS_SRCCOLOR2 and D3DPBLENDCAPS_INVSRCCOLOR2 are only + * advertised on the reference rasterizer and WARP. */ + ok(!(caps.SrcBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR + | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA + | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR + | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA + | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR)) + || broken(!(caps.SrcBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR + | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA + | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR + | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA + | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR + | D3DPBLENDCAPS_SRCCOLOR2 | D3DPBLENDCAPS_INVSRCCOLOR2))), + "SrcBlendCaps field has unexpected flags %#x.\n", caps.SrcBlendCaps); + ok(!(caps.DestBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR + | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA + | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR + | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA + | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR)) + || broken(!(caps.SrcBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR + | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA + | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR + | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA + | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR + | D3DPBLENDCAPS_SRCCOLOR2 | D3DPBLENDCAPS_INVSRCCOLOR2))), + "DestBlendCaps field has unexpected flags %#x.\n", caps.DestBlendCaps); + ok(!(caps.TextureCaps & ~(D3DPTEXTURECAPS_PERSPECTIVE | D3DPTEXTURECAPS_POW2 + | D3DPTEXTURECAPS_ALPHA | D3DPTEXTURECAPS_SQUAREONLY + | D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE | D3DPTEXTURECAPS_ALPHAPALETTE + | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PROJECTED + | D3DPTEXTURECAPS_CUBEMAP | D3DPTEXTURECAPS_VOLUMEMAP | D3DPTEXTURECAPS_MIPMAP + | D3DPTEXTURECAPS_MIPVOLUMEMAP | D3DPTEXTURECAPS_MIPCUBEMAP + | D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2 + | D3DPTEXTURECAPS_NOPROJECTEDBUMPENV)), + "TextureCaps field has unexpected flags %#x.\n", caps.TextureCaps); + ok(!(caps.TextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR + | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MINFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MINFGAUSSIANQUAD | D3DPTFILTERCAPS_MIPFPOINT + | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_CONVOLUTIONMONO + | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR + | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)), + "TextureFilterCaps field has unexpected flags %#x.\n", caps.TextureFilterCaps); + ok(!(caps.CubeTextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR + | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MINFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MINFGAUSSIANQUAD | D3DPTFILTERCAPS_MIPFPOINT + | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR + | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)), + "CubeTextureFilterCaps field has unexpected flags %#x.\n", caps.CubeTextureFilterCaps); + ok(!(caps.VolumeTextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR + | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MINFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MINFGAUSSIANQUAD | D3DPTFILTERCAPS_MIPFPOINT + | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR + | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)), + "VolumeTextureFilterCaps field has unexpected flags %#x.\n", caps.VolumeTextureFilterCaps); + ok(!(caps.LineCaps & ~(D3DLINECAPS_TEXTURE | D3DLINECAPS_ZTEST | D3DLINECAPS_BLEND + | D3DLINECAPS_ALPHACMP | D3DLINECAPS_FOG | D3DLINECAPS_ANTIALIAS)), + "LineCaps field has unexpected flags %#x.\n", caps.LineCaps); + ok(!(caps.StencilCaps & ~(D3DSTENCILCAPS_KEEP | D3DSTENCILCAPS_ZERO | D3DSTENCILCAPS_REPLACE + | D3DSTENCILCAPS_INCRSAT | D3DSTENCILCAPS_DECRSAT | D3DSTENCILCAPS_INVERT + | D3DSTENCILCAPS_INCR | D3DSTENCILCAPS_DECR | D3DSTENCILCAPS_TWOSIDED)), + "StencilCaps field has unexpected flags %#x.\n", caps.StencilCaps); + ok(!(caps.VertexProcessingCaps & ~(D3DVTXPCAPS_TEXGEN | D3DVTXPCAPS_MATERIALSOURCE7 + | D3DVTXPCAPS_DIRECTIONALLIGHTS | D3DVTXPCAPS_POSITIONALLIGHTS | D3DVTXPCAPS_LOCALVIEWER + | D3DVTXPCAPS_TWEENING | D3DVTXPCAPS_TEXGEN_SPHEREMAP + | D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER)), + "VertexProcessingCaps field has unexpected flags %#x.\n", caps.VertexProcessingCaps); + /* Both Nvidia and AMD give 10 here. */ + ok(caps.MaxActiveLights <= 10, + "MaxActiveLights field has unexpected value %u.\n", caps.MaxActiveLights); + /* AMD gives 6, Nvidia returns 8. */ + ok(caps.MaxUserClipPlanes <= 8, + "MaxUserClipPlanes field has unexpected value %u.\n", caps.MaxUserClipPlanes); + ok(caps.MaxVertexW == 0.0f || caps.MaxVertexW >= 1e10f, + "MaxVertexW field has unexpected value %.8e.\n", caps.MaxVertexW); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); } - - hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); - ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); - - ok(!(caps.Caps & ~D3DCAPS_READ_SCANLINE), "Caps field has unexpected flags %#x.\n", caps.Caps); - ok(!(caps.Caps2 & ~(D3DCAPS2_NO2DDURING3DSCENE | D3DCAPS2_FULLSCREENGAMMA - | D3DCAPS2_CANRENDERWINDOWED | D3DCAPS2_CANCALIBRATEGAMMA | D3DCAPS2_RESERVED - | D3DCAPS2_CANMANAGERESOURCE | D3DCAPS2_DYNAMICTEXTURES | D3DCAPS2_CANAUTOGENMIPMAP - | D3DCAPS2_CANSHARERESOURCE)), - "Caps2 field has unexpected flags %#x.\n", caps.Caps2); - /* AMD doesn't filter all the ddraw / d3d9 caps. Consider that behavior - * broken. */ - ok(!(caps.Caps3 & ~(D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD - | D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION | D3DCAPS3_COPY_TO_VIDMEM - | D3DCAPS3_COPY_TO_SYSTEMMEM | D3DCAPS3_DXVAHD | D3DCAPS3_DXVAHD_LIMITED - | D3DCAPS3_RESERVED)), - "Caps3 field has unexpected flags %#x.\n", caps.Caps3); - ok(!(caps.PrimitiveMiscCaps & ~(D3DPMISCCAPS_MASKZ | D3DPMISCCAPS_LINEPATTERNREP - | D3DPMISCCAPS_CULLNONE | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_CULLCCW - | D3DPMISCCAPS_COLORWRITEENABLE | D3DPMISCCAPS_CLIPPLANESCALEDPOINTS - | D3DPMISCCAPS_CLIPTLVERTS | D3DPMISCCAPS_TSSARGTEMP | D3DPMISCCAPS_BLENDOP - | D3DPMISCCAPS_NULLREFERENCE | D3DPMISCCAPS_INDEPENDENTWRITEMASKS - | D3DPMISCCAPS_PERSTAGECONSTANT | D3DPMISCCAPS_FOGANDSPECULARALPHA - | D3DPMISCCAPS_SEPARATEALPHABLEND | D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS - | D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING | D3DPMISCCAPS_FOGVERTEXCLAMPED - | D3DPMISCCAPS_POSTBLENDSRGBCONVERT)), - "PrimitiveMiscCaps field has unexpected flags %#x.\n", caps.PrimitiveMiscCaps); - ok(!(caps.RasterCaps & ~(D3DPRASTERCAPS_DITHER | D3DPRASTERCAPS_ZTEST - | D3DPRASTERCAPS_FOGVERTEX | D3DPRASTERCAPS_FOGTABLE - | D3DPRASTERCAPS_MIPMAPLODBIAS | D3DPRASTERCAPS_ZBUFFERLESSHSR - | D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_ANISOTROPY | D3DPRASTERCAPS_WBUFFER - | D3DPRASTERCAPS_WFOG | D3DPRASTERCAPS_ZFOG | D3DPRASTERCAPS_COLORPERSPECTIVE - | D3DPRASTERCAPS_SCISSORTEST | D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS - | D3DPRASTERCAPS_DEPTHBIAS | D3DPRASTERCAPS_MULTISAMPLE_TOGGLE)) - || broken(!(caps.RasterCaps & ~0x0f736191)), - "RasterCaps field has unexpected flags %#x.\n", caps.RasterCaps); - /* D3DPBLENDCAPS_SRCCOLOR2 and D3DPBLENDCAPS_INVSRCCOLOR2 are only - * advertised on the reference rasterizer and WARP. */ - ok(!(caps.SrcBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR - | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA - | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR - | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA - | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR)) - || broken(!(caps.SrcBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR - | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA - | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR - | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA - | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR - | D3DPBLENDCAPS_SRCCOLOR2 | D3DPBLENDCAPS_INVSRCCOLOR2))), - "SrcBlendCaps field has unexpected flags %#x.\n", caps.SrcBlendCaps); - ok(!(caps.DestBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR - | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA - | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR - | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA - | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR)) - || broken(!(caps.SrcBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR - | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA - | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR - | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA - | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR - | D3DPBLENDCAPS_SRCCOLOR2 | D3DPBLENDCAPS_INVSRCCOLOR2))), - "DestBlendCaps field has unexpected flags %#x.\n", caps.DestBlendCaps); - ok(!(caps.TextureCaps & ~(D3DPTEXTURECAPS_PERSPECTIVE | D3DPTEXTURECAPS_POW2 - | D3DPTEXTURECAPS_ALPHA | D3DPTEXTURECAPS_SQUAREONLY - | D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE | D3DPTEXTURECAPS_ALPHAPALETTE - | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PROJECTED - | D3DPTEXTURECAPS_CUBEMAP | D3DPTEXTURECAPS_VOLUMEMAP | D3DPTEXTURECAPS_MIPMAP - | D3DPTEXTURECAPS_MIPVOLUMEMAP | D3DPTEXTURECAPS_MIPCUBEMAP - | D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2 - | D3DPTEXTURECAPS_NOPROJECTEDBUMPENV)), - "TextureCaps field has unexpected flags %#x.\n", caps.TextureCaps); - ok(!(caps.TextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR - | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MINFPYRAMIDALQUAD - | D3DPTFILTERCAPS_MINFGAUSSIANQUAD | D3DPTFILTERCAPS_MIPFPOINT - | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_CONVOLUTIONMONO - | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR - | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD - | D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)), - "TextureFilterCaps field has unexpected flags %#x.\n", caps.TextureFilterCaps); - ok(!(caps.CubeTextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR - | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MINFPYRAMIDALQUAD - | D3DPTFILTERCAPS_MINFGAUSSIANQUAD | D3DPTFILTERCAPS_MIPFPOINT - | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR - | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD - | D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)), - "CubeTextureFilterCaps field has unexpected flags %#x.\n", caps.CubeTextureFilterCaps); - ok(!(caps.VolumeTextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR - | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MINFPYRAMIDALQUAD - | D3DPTFILTERCAPS_MINFGAUSSIANQUAD | D3DPTFILTERCAPS_MIPFPOINT - | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR - | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD - | D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)), - "VolumeTextureFilterCaps field has unexpected flags %#x.\n", caps.VolumeTextureFilterCaps); - ok(!(caps.LineCaps & ~(D3DLINECAPS_TEXTURE | D3DLINECAPS_ZTEST | D3DLINECAPS_BLEND - | D3DLINECAPS_ALPHACMP | D3DLINECAPS_FOG | D3DLINECAPS_ANTIALIAS)), - "LineCaps field has unexpected flags %#x.\n", caps.LineCaps); - ok(!(caps.StencilCaps & ~(D3DSTENCILCAPS_KEEP | D3DSTENCILCAPS_ZERO | D3DSTENCILCAPS_REPLACE - | D3DSTENCILCAPS_INCRSAT | D3DSTENCILCAPS_DECRSAT | D3DSTENCILCAPS_INVERT - | D3DSTENCILCAPS_INCR | D3DSTENCILCAPS_DECR | D3DSTENCILCAPS_TWOSIDED)), - "StencilCaps field has unexpected flags %#x.\n", caps.StencilCaps); - ok(!(caps.VertexProcessingCaps & ~(D3DVTXPCAPS_TEXGEN | D3DVTXPCAPS_MATERIALSOURCE7 - | D3DVTXPCAPS_DIRECTIONALLIGHTS | D3DVTXPCAPS_POSITIONALLIGHTS | D3DVTXPCAPS_LOCALVIEWER - | D3DVTXPCAPS_TWEENING | D3DVTXPCAPS_TEXGEN_SPHEREMAP - | D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER)), - "VertexProcessingCaps field has unexpected flags %#x.\n", caps.VertexProcessingCaps); - /* Both Nvidia and AMD give 10 here. */ - ok(caps.MaxActiveLights <= 10, - "MaxActiveLights field has unexpected value %u.\n", caps.MaxActiveLights); - /* AMD gives 6, Nvidia returns 8. */ - ok(caps.MaxUserClipPlanes <= 8, - "MaxUserClipPlanes field has unexpected value %u.\n", caps.MaxUserClipPlanes); - ok(caps.MaxVertexW == 0.0f || caps.MaxVertexW >= 1e10f, - "MaxVertexW field has unexpected value %.8e.\n", caps.MaxVertexW); - - refcount = IDirect3DDevice9_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); IDirect3D9_Release(d3d); DestroyWindow(window); }