wined3d: Add a conversion function for WINED3DFMT_X8D24_UNORM.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
01092d645f
commit
2ed609f15d
|
@ -828,6 +828,26 @@ static void convert_s8_uint_d24_float(const BYTE *src, BYTE *dst, UINT src_row_p
|
|||
}
|
||||
}
|
||||
|
||||
static void convert_x8_d24_unorm(const BYTE *src, BYTE *dst, UINT src_row_pitch, UINT src_slice_pitch,
|
||||
UINT dst_row_pitch, UINT dst_slice_pitch, UINT width, UINT height, UINT depth)
|
||||
{
|
||||
unsigned int x, y, z;
|
||||
|
||||
for (z = 0; z < depth; ++z)
|
||||
{
|
||||
for (y = 0; y < height; ++y)
|
||||
{
|
||||
const DWORD *source = (const DWORD *)(src + z * src_slice_pitch + y * src_row_pitch);
|
||||
DWORD *dest = (DWORD *)(dst + z * dst_slice_pitch + y * dst_row_pitch);
|
||||
|
||||
for (x = 0; x < width; ++x)
|
||||
{
|
||||
dest[x] = source[x] << 8 | source[x] >> 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL color_in_range(const struct wined3d_color_key *color_key, DWORD color)
|
||||
{
|
||||
/* FIXME: Is this really how color keys are supposed to work? I think it
|
||||
|
@ -1571,14 +1591,14 @@ static const struct wined3d_format_texture_info format_texture_info[] =
|
|||
| WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL | WINED3DFMT_FLAG_SHADOW,
|
||||
ARB_FRAMEBUFFER_OBJECT, NULL},
|
||||
{WINED3DFMT_X8D24_UNORM, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4,
|
||||
WINED3DFMT_FLAG_DEPTH,
|
||||
WINED3D_GL_EXT_NONE, NULL},
|
||||
WINED3D_GL_EXT_NONE, convert_x8_d24_unorm},
|
||||
{WINED3DFMT_X8D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4,
|
||||
WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING
|
||||
| WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_SHADOW,
|
||||
ARB_DEPTH_TEXTURE, NULL},
|
||||
ARB_DEPTH_TEXTURE, convert_x8_d24_unorm},
|
||||
{WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0,
|
||||
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_SHADOW,
|
||||
|
|
Loading…
Reference in New Issue