wined3d: Add a depthstencil flag to the formats table and make use of it in CheckDepthStencilCapability.
This commit is contained in:
parent
e1bf1cd640
commit
ef73fe5d47
|
@ -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);
|
||||
|
||||
/* Fail if we weren't able to get a description of the format */
|
||||
if(!desc || !glDesc)
|
||||
return FALSE;
|
||||
|
||||
/* 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;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue