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

wined3d: Add a depthstencil flag to the formats table and make use of it in…

wined3d: Add a depthstencil flag to the formats table and make use of it in CheckDepthStencilCapability.
parent e1bf1cd6
......@@ -1887,28 +1887,20 @@ static BOOL CheckBumpMapCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
}
/* Check if the given DisplayFormat + DepthStencilFormat combination is valid for the Adapter */
static BOOL CheckDepthStencilCapability(UINT Adapter, WINED3DFORMAT DisplayFormat,
WINED3DFORMAT DepthStencilFormat)
static BOOL CheckDepthStencilCapability(UINT Adapter, WINED3DFORMAT DisplayFormat, WINED3DFORMAT DepthStencilFormat)
{
int it=0;
WineD3D_PixelFormat *cfgs = Adapters[Adapter].cfgs;
const GlPixelFormatDesc *glDesc;
const StaticPixelFormatDesc *desc = getFormatDescEntry(DepthStencilFormat, &GLINFO_LOCATION, &glDesc);
/* Only allow depth/stencil formats */
switch (DepthStencilFormat) {
case WINED3DFMT_D16_LOCKABLE:
case WINED3DFMT_D16:
case WINED3DFMT_D15S1:
case WINED3DFMT_D24X8:
case WINED3DFMT_D24X4S4:
case WINED3DFMT_D24S8:
case WINED3DFMT_D24FS8:
case WINED3DFMT_D32:
case WINED3DFMT_D32F_LOCKABLE:
break;
/* Fail if we weren't able to get a description of the format */
if(!desc || !glDesc)
return FALSE;
default:
return FALSE;
}
/* Only allow depth/stencil formats */
if(!(glDesc->Flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)))
return FALSE;
/* Walk through all WGL pixel formats to find a match */
cfgs = Adapters[Adapter].cfgs;
......
......@@ -232,25 +232,25 @@ static const GlPixelFormatDescTemplate gl_formats_template[] = {
,0 },
/* Depth stencil formats */
{WINED3DFMT_D16_LOCKABLE ,GL_DEPTH_COMPONENT24_ARB ,GL_DEPTH_COMPONENT24_ARB , 0, GL_DEPTH_COMPONENT ,GL_UNSIGNED_SHORT
,0 },
,WINED3DFMT_FLAG_DEPTH },
{WINED3DFMT_D32 ,GL_DEPTH_COMPONENT32_ARB ,GL_DEPTH_COMPONENT32_ARB , 0, GL_DEPTH_COMPONENT ,GL_UNSIGNED_INT
,0 },
,WINED3DFMT_FLAG_DEPTH },
{WINED3DFMT_D15S1 ,GL_DEPTH_COMPONENT24_ARB ,GL_DEPTH_COMPONENT24_ARB , 0, GL_DEPTH_COMPONENT ,GL_UNSIGNED_SHORT
,0 },
,WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL },
{WINED3DFMT_D24S8 ,GL_DEPTH_COMPONENT24_ARB ,GL_DEPTH_COMPONENT24_ARB , 0, GL_DEPTH_COMPONENT ,GL_UNSIGNED_INT
,WINED3DFMT_FLAG_FILTERING },
,WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL },
{WINED3DFMT_D24X8 ,GL_DEPTH_COMPONENT24_ARB ,GL_DEPTH_COMPONENT24_ARB , 0, GL_DEPTH_COMPONENT ,GL_UNSIGNED_INT
,0 },
,WINED3DFMT_FLAG_DEPTH },
{WINED3DFMT_D24X4S4 ,GL_DEPTH_COMPONENT24_ARB ,GL_DEPTH_COMPONENT24_ARB , 0, GL_DEPTH_COMPONENT ,GL_UNSIGNED_INT
,0 },
,WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL },
{WINED3DFMT_D16 ,GL_DEPTH_COMPONENT24_ARB ,GL_DEPTH_COMPONENT24_ARB , 0, GL_DEPTH_COMPONENT ,GL_UNSIGNED_SHORT
,WINED3DFMT_FLAG_FILTERING },
,WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH },
{WINED3DFMT_L16 ,GL_LUMINANCE16_EXT ,GL_LUMINANCE16_EXT , 0, GL_LUMINANCE ,GL_UNSIGNED_SHORT
,WINED3DFMT_FLAG_FILTERING },
{WINED3DFMT_D32F_LOCKABLE ,GL_DEPTH_COMPONENT32_ARB ,GL_DEPTH_COMPONENT32_ARB , 0, GL_DEPTH_COMPONENT ,GL_FLOAT
,0 },
,WINED3DFMT_FLAG_DEPTH },
{WINED3DFMT_D24FS8 ,GL_DEPTH_COMPONENT24_ARB ,GL_DEPTH_COMPONENT24_ARB , 0, GL_DEPTH_COMPONENT ,GL_FLOAT
,0 },
,WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL},
/* Is this a vertex buffer? */
{WINED3DFMT_VERTEXDATA ,0 ,0 , 0, 0 ,0
,0 },
......
......@@ -33,6 +33,8 @@ typedef enum {
/* WineD3D pixel format flags */
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x1
#define WINED3DFMT_FLAG_FILTERING 0x2
#define WINED3DFMT_FLAG_DEPTH 0x4
#define WINED3DFMT_FLAG_STENCIL 0x8
/** DCL usage masks **/
#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