Commit e1bf1cd6 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

wined3d: Make the filtering capability of a format a flag in the formats table.

parent 5423c35d
...@@ -1923,19 +1923,20 @@ WINED3DFORMAT DepthStencilFormat) ...@@ -1923,19 +1923,20 @@ WINED3DFORMAT DepthStencilFormat)
return FALSE; return FALSE;
} }
static BOOL CheckFilterCapability(WINED3DFORMAT CheckFormat) static BOOL CheckFilterCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
{ {
switch (CheckFormat) { const GlPixelFormatDesc *glDesc;
/* Filtering not supported */ const StaticPixelFormatDesc *desc = getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &glDesc);
case WINED3DFMT_R32F:
case WINED3DFMT_A32B32G32R32F:
TRACE_(d3d_caps)("[FAILED]\n");
return FALSE;
default:
break;
}
return TRUE; /* Fail if we weren't able to get a description of the format */
if(!desc || !glDesc)
return FALSE;
/* The flags entry of a format contains the filtering capability */
if(glDesc->Flags & WINED3DFMT_FLAG_FILTERING)
return TRUE;
return FALSE;
} }
/* Check the render target capabilities of a format */ /* Check the render target capabilities of a format */
...@@ -2351,7 +2352,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt ...@@ -2351,7 +2352,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
/* Check QUERY_FILTER support */ /* Check QUERY_FILTER support */
if(Usage & WINED3DUSAGE_QUERY_FILTER) { if(Usage & WINED3DUSAGE_QUERY_FILTER) {
if(CheckFilterCapability(CheckFormat)) { if(CheckFilterCapability(Adapter, CheckFormat)) {
UsageCaps |= WINED3DUSAGE_QUERY_FILTER; UsageCaps |= WINED3DUSAGE_QUERY_FILTER;
} else { } else {
TRACE_(d3d_caps)("[FAILED] - No query filter support\n"); TRACE_(d3d_caps)("[FAILED] - No query filter support\n");
...@@ -2473,7 +2474,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt ...@@ -2473,7 +2474,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
/* Check QUERY_FILTER support */ /* Check QUERY_FILTER support */
if(Usage & WINED3DUSAGE_QUERY_FILTER) { if(Usage & WINED3DUSAGE_QUERY_FILTER) {
if(CheckFilterCapability(CheckFormat)) { if(CheckFilterCapability(Adapter, CheckFormat)) {
UsageCaps |= WINED3DUSAGE_QUERY_FILTER; UsageCaps |= WINED3DUSAGE_QUERY_FILTER;
} else { } else {
TRACE_(d3d_caps)("[FAILED] - No query filter support\n"); TRACE_(d3d_caps)("[FAILED] - No query filter support\n");
...@@ -2564,7 +2565,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt ...@@ -2564,7 +2565,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
/* Check QUERY_FILTER support */ /* Check QUERY_FILTER support */
if(Usage & WINED3DUSAGE_QUERY_FILTER) { if(Usage & WINED3DUSAGE_QUERY_FILTER) {
if(CheckFilterCapability(CheckFormat)) { if(CheckFilterCapability(Adapter, CheckFormat)) {
UsageCaps |= WINED3DUSAGE_QUERY_FILTER; UsageCaps |= WINED3DUSAGE_QUERY_FILTER;
} else { } else {
TRACE_(d3d_caps)("[FAILED] - No query filter support\n"); TRACE_(d3d_caps)("[FAILED] - No query filter support\n");
......
...@@ -32,6 +32,7 @@ typedef enum { ...@@ -32,6 +32,7 @@ typedef enum {
/* WineD3D pixel format flags */ /* WineD3D pixel format flags */
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x1 #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x1
#define WINED3DFMT_FLAG_FILTERING 0x2
/** DCL usage masks **/ /** DCL usage masks **/
#define WINED3DSP_DCL_USAGE_SHIFT 0 #define WINED3DSP_DCL_USAGE_SHIFT 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment