wined3d: Map D3DFMT_D24S8 to WINED3DFMT_D24_UNORM_S8_UINT.

The internal order of the depth and stencil bits is unspecified since the
format isn't lockable.
This commit is contained in:
Henri Verbeet 2009-10-29 18:56:21 +01:00 committed by Alexandre Julliard
parent fbae08672b
commit bf10dbe8a6
9 changed files with 17 additions and 19 deletions

View file

@ -74,7 +74,7 @@ D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format)
case WINED3DFMT_D16_LOCKABLE: return D3DFMT_D16_LOCKABLE;
case WINED3DFMT_D32_UNORM: return D3DFMT_D32;
case WINED3DFMT_S1_UINT_D15_UNORM: return D3DFMT_D15S1;
case WINED3DFMT_S8_UINT_D24_UNORM: return D3DFMT_D24S8;
case WINED3DFMT_D24_UNORM_S8_UINT: return D3DFMT_D24S8;
case WINED3DFMT_X8D24_UNORM: return D3DFMT_D24X8;
case WINED3DFMT_S4X4_UINT_D24_UNORM: return D3DFMT_D24X4S4;
case WINED3DFMT_D16_UNORM: return D3DFMT_D16;
@ -125,7 +125,7 @@ WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format)
case D3DFMT_D16_LOCKABLE: return WINED3DFMT_D16_LOCKABLE;
case D3DFMT_D32: return WINED3DFMT_D32_UNORM;
case D3DFMT_D15S1: return WINED3DFMT_S1_UINT_D15_UNORM;
case D3DFMT_D24S8: return WINED3DFMT_S8_UINT_D24_UNORM;
case D3DFMT_D24S8: return WINED3DFMT_D24_UNORM_S8_UINT;
case D3DFMT_D24X8: return WINED3DFMT_X8D24_UNORM;
case D3DFMT_D24X4S4: return WINED3DFMT_S4X4_UINT_D24_UNORM;
case D3DFMT_D16: return WINED3DFMT_D16_UNORM;

View file

@ -66,7 +66,7 @@ D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format)
case WINED3DFMT_D16_LOCKABLE: return D3DFMT_D16_LOCKABLE;
case WINED3DFMT_D32_UNORM: return D3DFMT_D32;
case WINED3DFMT_S1_UINT_D15_UNORM: return D3DFMT_D15S1;
case WINED3DFMT_S8_UINT_D24_UNORM: return D3DFMT_D24S8;
case WINED3DFMT_D24_UNORM_S8_UINT: return D3DFMT_D24S8;
case WINED3DFMT_X8D24_UNORM: return D3DFMT_D24X8;
case WINED3DFMT_S4X4_UINT_D24_UNORM: return D3DFMT_D24X4S4;
case WINED3DFMT_D16_UNORM: return D3DFMT_D16;
@ -131,7 +131,7 @@ WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format)
case D3DFMT_D16_LOCKABLE: return WINED3DFMT_D16_LOCKABLE;
case D3DFMT_D32: return WINED3DFMT_D32_UNORM;
case D3DFMT_D15S1: return WINED3DFMT_S1_UINT_D15_UNORM;
case D3DFMT_D24S8: return WINED3DFMT_S8_UINT_D24_UNORM;
case D3DFMT_D24S8: return WINED3DFMT_D24_UNORM_S8_UINT;
case D3DFMT_D24X8: return WINED3DFMT_X8D24_UNORM;
case D3DFMT_D24X4S4: return WINED3DFMT_S4X4_UINT_D24_UNORM;
case D3DFMT_D16: return WINED3DFMT_D16_UNORM;

View file

@ -1116,7 +1116,7 @@ IDirect3DImpl_7_EnumZBufferFormats(IDirect3D7 *iface,
WINED3DFMT_D16_UNORM,
WINED3DFMT_X8D24_UNORM,
WINED3DFMT_S4X4_UINT_D24_UNORM,
WINED3DFMT_S8_UINT_D24_UNORM,
WINED3DFMT_D24_UNORM_S8_UINT,
WINED3DFMT_D32_UNORM,
};

View file

@ -217,7 +217,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
DDPixelFormat->u5.dwRGBAlphaBitMask = 0x0;
break;
case WINED3DFMT_S8_UINT_D24_UNORM:
case WINED3DFMT_D24_UNORM_S8_UINT:
DDPixelFormat->dwFlags = DDPF_ZBUFFER | DDPF_STENCILBUFFER;
DDPixelFormat->dwFourCC = 0;
/* Should I set dwZBufferBitDepth to 32 here? */
@ -529,11 +529,11 @@ PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat)
case 24:
FIXME("Don't know how to handle a 24 bit depth buffer with stencil bits\n");
return WINED3DFMT_S8_UINT_D24_UNORM;
return WINED3DFMT_D24_UNORM_S8_UINT;
case 32:
if(DDPixelFormat->u2.dwStencilBitDepth == 8)
return WINED3DFMT_S8_UINT_D24_UNORM;
return WINED3DFMT_D24_UNORM_S8_UINT;
else
return WINED3DFMT_S4X4_UINT_D24_UNORM;

View file

@ -1016,10 +1016,10 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
* Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the
* time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this
* issue needs to be fixed. */
if (ds_format_desc->format != WINED3DFMT_S8_UINT_D24_UNORM)
if (ds_format_desc->format != WINED3DFMT_D24_UNORM_S8_UINT)
{
FIXME("Add OpenGL context recreation support to SetDepthStencilSurface\n");
ds_format_desc = getFormatDescEntry(WINED3DFMT_S8_UINT_D24_UNORM, &This->adapter->gl_info);
ds_format_desc = getFormatDescEntry(WINED3DFMT_D24_UNORM_S8_UINT, &This->adapter->gl_info);
}
getDepthStencilBits(ds_format_desc, &depthBits, &stencilBits);

View file

@ -2978,7 +2978,7 @@ static BOOL CheckTextureCapability(struct wined3d_adapter *adapter,
case WINED3DFMT_S1_UINT_D15_UNORM:
case WINED3DFMT_X8D24_UNORM:
case WINED3DFMT_S4X4_UINT_D24_UNORM:
case WINED3DFMT_S8_UINT_D24_UNORM:
case WINED3DFMT_D24_UNORM_S8_UINT:
case WINED3DFMT_S8_UINT_D24_FLOAT:
case WINED3DFMT_D32_UNORM:
case WINED3DFMT_D32_FLOAT:

View file

@ -3980,7 +3980,7 @@ static HRESULT IWineD3DSurfaceImpl_BltZ(IWineD3DSurfaceImpl *This, const RECT *D
case WINED3DFMT_S1_UINT_D15_UNORM:
depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x0000fffe;
break;
case WINED3DFMT_S8_UINT_D24_UNORM:
case WINED3DFMT_D24_UNORM_S8_UINT:
case WINED3DFMT_X8D24_UNORM:
depth = (float) DDBltFx->u5.dwFillDepth / (float) 0x00ffffff;
break;

View file

@ -118,7 +118,7 @@ static const struct StaticPixelFormatDesc formats[] =
{WINED3DFMT_D16_LOCKABLE, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE},
{WINED3DFMT_D32_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 32, 0, FALSE},
{WINED3DFMT_S1_UINT_D15_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 15, 1, FALSE},
{WINED3DFMT_S8_UINT_D24_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 24, 8, FALSE},
{WINED3DFMT_D24_UNORM_S8_UINT, 0x0, 0x0, 0x0, 0x0, 4, 24, 8, FALSE},
{WINED3DFMT_X8D24_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 24, 0, FALSE},
{WINED3DFMT_S4X4_UINT_D24_UNORM, 0x0, 0x0, 0x0, 0x0, 4, 24, 4, FALSE},
{WINED3DFMT_D16_UNORM, 0x0, 0x0, 0x0, 0x0, 2, 16, 0, FALSE},
@ -447,15 +447,15 @@ static const GlPixelFormatDescTemplate gl_formats_template[] = {
GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8,
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
ARB_FRAMEBUFFER_OBJECT},
{WINED3DFMT_S8_UINT_D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
{WINED3DFMT_D24_UNORM_S8_UINT, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH,
ARB_DEPTH_TEXTURE},
{WINED3DFMT_S8_UINT_D24_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
{WINED3DFMT_D24_UNORM_S8_UINT, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
EXT_PACKED_DEPTH_STENCIL},
{WINED3DFMT_S8_UINT_D24_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0,
{WINED3DFMT_D24_UNORM_S8_UINT, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0,
GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
ARB_FRAMEBUFFER_OBJECT},
@ -1189,7 +1189,6 @@ const char* debug_d3dformat(WINED3DFORMAT fmt) {
FMT_TO_STR(WINED3DFMT_D16_LOCKABLE);
FMT_TO_STR(WINED3DFMT_D32_UNORM);
FMT_TO_STR(WINED3DFMT_S1_UINT_D15_UNORM);
FMT_TO_STR(WINED3DFMT_S8_UINT_D24_UNORM);
FMT_TO_STR(WINED3DFMT_X8D24_UNORM);
FMT_TO_STR(WINED3DFMT_S4X4_UINT_D24_UNORM);
FMT_TO_STR(WINED3DFMT_L16_UNORM);
@ -2083,7 +2082,7 @@ BOOL getDepthStencilBits(const struct GlPixelFormatDesc *format_desc, short *dep
case WINED3DFMT_S1_UINT_D15_UNORM:
case WINED3DFMT_X8D24_UNORM:
case WINED3DFMT_S4X4_UINT_D24_UNORM:
case WINED3DFMT_S8_UINT_D24_UNORM:
case WINED3DFMT_D24_UNORM_S8_UINT:
case WINED3DFMT_S8_UINT_D24_FLOAT:
case WINED3DFMT_D32_UNORM:
case WINED3DFMT_D32_FLOAT:

View file

@ -152,7 +152,6 @@ typedef enum _WINED3DFORMAT
WINED3DFMT_D16_LOCKABLE,
WINED3DFMT_D32_UNORM,
WINED3DFMT_S1_UINT_D15_UNORM,
WINED3DFMT_S8_UINT_D24_UNORM,
WINED3DFMT_X8D24_UNORM,
WINED3DFMT_S4X4_UINT_D24_UNORM,
WINED3DFMT_L16_UNORM,