wined3d: Add a function which checks the filtering capabilities for a format.

This commit is contained in:
Roderick Colenbrander 2008-03-17 19:27:24 +01:00 committed by Alexandre Julliard
parent 2f1e01bbe3
commit aa46edd60c
1 changed files with 45 additions and 12 deletions

View File

@ -1873,6 +1873,21 @@ WINED3DFORMAT DepthStencilFormat)
return FALSE;
}
static BOOL CheckFilterCapability(WINED3DFORMAT CheckFormat)
{
switch (CheckFormat) {
/* Filtering not supported */
case WINED3DFMT_R32F:
case WINED3DFMT_A32B32G32R32F:
TRACE_(d3d_caps)("[FAILED]\n");
return FALSE;
default:
break;
}
return TRUE;
}
/* Check the render target capabilities of a format */
static BOOL CheckRenderTargetCapability(WINED3DFORMAT AdapterFormat, WINED3DFORMAT CheckFormat)
{
@ -2208,18 +2223,6 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
return WINED3DERR_INVALIDCALL;
}
if (Usage & WINED3DUSAGE_QUERY_FILTER) {
switch (CheckFormat) {
/* Filtering not supported */
case WINED3DFMT_R32F:
case WINED3DFMT_A32B32G32R32F:
TRACE_(d3d_caps)("[FAILED]\n");
return WINED3DERR_NOTAVAILABLE;
default:
break;
}
}
if (Usage & WINED3DUSAGE_AUTOGENMIPMAP) {
if(!GL_SUPPORT(SGIS_GENERATE_MIPMAP)) {
TRACE_(d3d_caps)("[FAILED] - No mipmap generation support\n");
@ -2252,6 +2255,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
}
}
/* Check QUERY_FILTER support */
if(Usage & WINED3DUSAGE_QUERY_FILTER) {
if(CheckFilterCapability(CheckFormat)) {
UsageCaps |= WINED3DUSAGE_QUERY_FILTER;
} else {
TRACE_(d3d_caps)("[FAILED] - No query filter support\n");
return WINED3DERR_NOTAVAILABLE;
}
}
/* Check QUERY_SRGBREAD support */
if(Usage & WINED3DUSAGE_QUERY_SRGBREAD) {
if(CheckSrgbReadCapability(Adapter, CheckFormat)) {
@ -2324,6 +2337,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
}
}
/* Check QUERY_FILTER support */
if(Usage & WINED3DUSAGE_QUERY_FILTER) {
if(CheckFilterCapability(CheckFormat)) {
UsageCaps |= WINED3DUSAGE_QUERY_FILTER;
} else {
TRACE_(d3d_caps)("[FAILED] - No query filter support\n");
return WINED3DERR_NOTAVAILABLE;
}
}
/* Check QUERY_LEGACYBUMPMAP support */
if(Usage & WINED3DUSAGE_QUERY_LEGACYBUMPMAP) {
if(CheckBumpMapCapability(Adapter, CheckFormat)) {
@ -2365,6 +2388,16 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
return WINED3DERR_NOTAVAILABLE;
}
/* Check QUERY_FILTER support */
if(Usage & WINED3DUSAGE_QUERY_FILTER) {
if(CheckFilterCapability(CheckFormat)) {
UsageCaps |= WINED3DUSAGE_QUERY_FILTER;
} else {
TRACE_(d3d_caps)("[FAILED] - No query filter support\n");
return WINED3DERR_NOTAVAILABLE;
}
}
/* Check QUERY_SRGBREAD support */
if(Usage & WINED3DUSAGE_QUERY_SRGBREAD) {
if(CheckSrgbReadCapability(Adapter, CheckFormat)) {