[PATCH 2/4] wined3d: Clear WINED3DFMT_FLAG_DEPTH_STENCIL if the format is not supported as FBO attachment.
Henri Verbeet
hverbeet at codeweavers.com
Fri Jun 5 06:49:29 CDT 2020
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
dlls/wined3d/resource.c | 7 -------
dlls/wined3d/utils.c | 11 ++++++-----
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 8f9a11ea2ad..15e4a45ea59 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -135,13 +135,6 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id));
continue;
}
- if (wined3d_settings.offscreen_rendering_mode == ORM_FBO
- && bind_flags & (WINED3D_BIND_RENDER_TARGET | WINED3D_BIND_DEPTH_STENCIL)
- && !(format->flags[gl_type] & WINED3DFMT_FLAG_FBO_ATTACHABLE))
- {
- WARN("Render target or depth stencil is not FBO attachable.\n");
- continue;
- }
if ((bind_flags & WINED3D_BIND_SHADER_RESOURCE)
&& !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE))
{
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 55ee0ede339..d078c503df3 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -2515,11 +2515,11 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for
{
if (!rt_internal)
{
- if (format->f.flags[type] & WINED3DFMT_FLAG_RENDERTARGET)
+ if (format->f.flags[type] & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL))
{
WARN("Format %s with rendertarget flag is not supported as FBO color attachment (type %u),"
" and no fallback specified.\n", debug_d3dformat(format->f.id), type);
- format->f.flags[type] &= ~WINED3DFMT_FLAG_RENDERTARGET;
+ format->f.flags[type] &= ~(WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL);
}
else
{
@@ -2552,7 +2552,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for
{
WARN("Format %s rtInternal format is not supported as FBO %s attachment, type %u.\n",
debug_d3dformat(format->f.id), type_string, type);
- format->f.flags[type] &= ~WINED3DFMT_FLAG_RENDERTARGET;
+ format->f.flags[type] &= ~(WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL);
}
}
}
@@ -2725,8 +2725,9 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for
{
FIXME("Format %s needs different render target formats for different resource types.\n",
debug_d3dformat(format->f.id));
- format_clear_flag(&format->f, WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABLE
- | WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING);
+ format_clear_flag(&format->f, WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL
+ | WINED3DFMT_FLAG_FBO_ATTACHABLE | WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB
+ | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING);
}
}
--
2.20.1
More information about the wine-devel
mailing list