Commit 9b8847ed authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Introduce WINED3DFMT_FLAG_DEPTH_STENCIL.

To indicate whether WINED3D_BIND_DEPTH_STENCIL is valid for the format. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent acc96fad
......@@ -1437,7 +1437,7 @@ HRESULT CDECL wined3d_check_depth_stencil_match(const struct wined3d_adapter *ad
WARN("Format %s is not render target format.\n", debug_d3dformat(rt_format->id));
return WINED3DERR_NOTAVAILABLE;
}
if (!(ds_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)))
if (!(ds_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL))
{
WARN("Format %s is not depth/stencil format.\n", debug_d3dformat(ds_format->id));
return WINED3DERR_NOTAVAILABLE;
......@@ -1505,8 +1505,6 @@ static BOOL wined3d_check_depth_stencil_format(const struct wined3d_adapter *ada
{
if (!ds_format->depth_size && !ds_format->stencil_size)
return FALSE;
if (!(ds_format->flags[gl_type] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)))
return FALSE;
/* Blacklist formats not supported on Windows */
if (ds_format->id == WINED3DFMT_S1_UINT_D15_UNORM /* Breaks the shadowvol2 dx7 sdk sample */
......@@ -1658,6 +1656,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d,
format_flags |= WINED3DFMT_FLAG_TEXTURE;
if (bind_flags & WINED3D_BIND_RENDER_TARGET)
format_flags |= WINED3DFMT_FLAG_RENDERTARGET;
if (bind_flags & WINED3D_BIND_DEPTH_STENCIL)
format_flags |= WINED3DFMT_FLAG_DEPTH_STENCIL;
if (usage & WINED3DUSAGE_QUERY_FILTER)
format_flags |= WINED3DFMT_FLAG_FILTERING;
if (usage & WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING)
......
......@@ -130,7 +130,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
continue;
}
if ((bind_flags & WINED3D_BIND_DEPTH_STENCIL)
&& !(format->flags[gl_type] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)))
&& !(format->flags[gl_type] & WINED3DFMT_FLAG_DEPTH_STENCIL))
{
WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id));
continue;
......
......@@ -297,9 +297,9 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win
break;
case WINED3D_BLIT_OP_DEPTH_BLIT:
if (!(src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)))
if (!(src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL))
return false;
if (!(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)))
if (!(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL))
return false;
/* Accept pure swizzle fixups for depth formats. In general we
* ignore the stencil component (if present) at the moment and the
......
......@@ -5506,8 +5506,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN
/* WineD3D pixel format flags */
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001
#define WINED3DFMT_FLAG_FILTERING 0x00000002
#define WINED3DFMT_FLAG_DEPTH 0x00000004
#define WINED3DFMT_FLAG_STENCIL 0x00000008
#define WINED3DFMT_FLAG_DEPTH_STENCIL 0x00000008
#define WINED3DFMT_FLAG_RENDERTARGET 0x00000010
#define WINED3DFMT_FLAG_EXTENSION 0x00000020
#define WINED3DFMT_FLAG_FBO_ATTACHABLE 0x00000040
......
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