d3d8: Don't report Shader Model 2.0 or higher.

oldstable
Chris Robinson 2006-12-23 05:41:53 -08:00 committed by Alexandre Julliard
parent b58715e8ab
commit b66a52856c
3 changed files with 39 additions and 0 deletions

View File

@ -169,6 +169,15 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetDeviceCaps(LPDIRECT3DDEVICE8 iface
D3D8CAPSTOWINECAPS(pCaps, pWineCaps)
hrc = IWineD3DDevice_GetDeviceCaps(This->WineD3DDevice, pWineCaps);
HeapFree(GetProcessHeap(), 0, pWineCaps);
/* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */
if(pCaps->PixelShaderVersion > D3DPS_VERSION(1,4)){
pCaps->PixelShaderVersion = D3DPS_VERSION(1,4);
}
if(pCaps->VertexShaderVersion > D3DVS_VERSION(1,1)){
pCaps->VertexShaderVersion = D3DVS_VERSION(1,1);
}
TRACE("Returning %p %p\n", This, pCaps);
return hrc;
}

View File

@ -176,6 +176,15 @@ static HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface, UINT Ada
D3D8CAPSTOWINECAPS(pCaps, pWineCaps)
hrc = IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, pWineCaps);
HeapFree(GetProcessHeap(), 0, pWineCaps);
/* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */
if(pCaps->PixelShaderVersion > D3DPS_VERSION(1,4)){
pCaps->PixelShaderVersion = D3DPS_VERSION(1,4);
}
if(pCaps->VertexShaderVersion > D3DVS_VERSION(1,1)){
pCaps->VertexShaderVersion = D3DVS_VERSION(1,1);
}
TRACE("(%p) returning %p\n", This, pCaps);
return hrc;
}

View File

@ -696,6 +696,26 @@ cleanup:
if(pDevice) IDirect3D8_Release(pDevice);
}
static void test_shader_versions(void)
{
HRESULT hr;
IDirect3D8 *pD3d = NULL;
D3DCAPS8 d3dcaps;
pD3d = pDirect3DCreate8( D3D_SDK_VERSION );
ok(pD3d != NULL, "Failed to create IDirect3D8 object\n");
if (pD3d != NULL) {
hr = IDirect3D8_GetDeviceCaps(pD3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &d3dcaps);
ok(SUCCEEDED(hr), "Failed to get D3D8 caps (%s)\n", DXGetErrorString8(hr));
if (SUCCEEDED(hr)) {
ok(d3dcaps.VertexShaderVersion <= D3DVS_VERSION(1,1), "Unexpected VertexShaderVersion (%#x > %#x)\n", d3dcaps.VertexShaderVersion, D3DVS_VERSION(1,1));
ok(d3dcaps.PixelShaderVersion <= D3DPS_VERSION(1,4), "Unexpected PixelShaderVersion (%#x > %#x)\n", d3dcaps.PixelShaderVersion, D3DPS_VERSION(1,4));
}
IDirect3D8_Release(pD3d);
}
}
/* Test adapter display modes */
static void test_display_modes(void)
{
@ -733,6 +753,7 @@ START_TEST(device)
if (pDirect3DCreate8)
{
test_display_modes();
test_shader_versions();
test_swapchain();
test_refcount();
test_mipmap_levels();