wined3d: Move D24X4S4 to the formats table.
This commit is contained in:
parent
485040bb5c
commit
6a081ef95a
|
@ -2259,14 +2259,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WINED3DFMT_S4X4_UINT_D24_UNORM:
|
|
||||||
if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]
|
|
||||||
|| gl_info->supported[EXT_PACKED_DEPTH_STENCIL])
|
|
||||||
{
|
|
||||||
*convert = CONVERT_D24X4S4;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2595,24 +2587,6 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case CONVERT_D24X4S4:
|
|
||||||
{
|
|
||||||
unsigned int x, y;
|
|
||||||
|
|
||||||
for (y = 0; y < height; ++y)
|
|
||||||
{
|
|
||||||
const DWORD *source = (const DWORD *)(src + y * pitch);
|
|
||||||
DWORD *dest = (DWORD *)(dst + y * outpitch);
|
|
||||||
|
|
||||||
for (x = 0; x < width; ++x)
|
|
||||||
{
|
|
||||||
/* Just need to clear out the X4 part. */
|
|
||||||
dest[x] = source[x] & ~0xf0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ERR("Unsupported conversion type %#x.\n", convert);
|
ERR("Unsupported conversion type %#x.\n", convert);
|
||||||
}
|
}
|
||||||
|
|
|
@ -417,6 +417,23 @@ static void convert_r16g16_snorm(const BYTE *src, BYTE *dst, UINT pitch, UINT wi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void convert_s4x4_uint_d24_unorm(const BYTE *src, BYTE *dst, UINT pitch, UINT width, UINT height)
|
||||||
|
{
|
||||||
|
unsigned int x, y;
|
||||||
|
|
||||||
|
for (y = 0; y < height; ++y)
|
||||||
|
{
|
||||||
|
const DWORD *source = (const DWORD *)(src + y * pitch);
|
||||||
|
DWORD *dest = (DWORD *)(dst + y * pitch);
|
||||||
|
|
||||||
|
for (x = 0; x < width; ++x)
|
||||||
|
{
|
||||||
|
/* Just need to clear out the X4 part. */
|
||||||
|
dest[x] = source[x] & ~0xf0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void convert_s8_uint_d24_float(const BYTE *src, BYTE *dst, UINT pitch, UINT width, UINT height)
|
static void convert_s8_uint_d24_float(const BYTE *src, BYTE *dst, UINT pitch, UINT width, UINT height)
|
||||||
{
|
{
|
||||||
unsigned int x, y;
|
unsigned int x, y;
|
||||||
|
@ -701,13 +718,13 @@ static const struct wined3d_format_texture_info format_texture_info[] =
|
||||||
WINED3DFMT_FLAG_DEPTH,
|
WINED3DFMT_FLAG_DEPTH,
|
||||||
ARB_DEPTH_TEXTURE, NULL},
|
ARB_DEPTH_TEXTURE, NULL},
|
||||||
{WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
|
{WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH24_STENCIL8_EXT, 0,
|
||||||
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, 0,
|
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, 4,
|
||||||
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
||||||
EXT_PACKED_DEPTH_STENCIL, NULL},
|
EXT_PACKED_DEPTH_STENCIL, &convert_s4x4_uint_d24_unorm},
|
||||||
{WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0,
|
{WINED3DFMT_S4X4_UINT_D24_UNORM, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0,
|
||||||
GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0,
|
GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 4,
|
||||||
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL,
|
||||||
ARB_FRAMEBUFFER_OBJECT, NULL},
|
ARB_FRAMEBUFFER_OBJECT, &convert_s4x4_uint_d24_unorm},
|
||||||
{WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
{WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0,
|
||||||
GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0,
|
GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0,
|
||||||
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH,
|
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH,
|
||||||
|
|
Loading…
Reference in New Issue