Henri Verbeet : wined3d: Check FBO compatibility after the fixups are applied.
Alexandre Julliard
julliard at winehq.org
Thu Jun 4 07:59:34 CDT 2009
Module: wine
Branch: master
Commit: 0a059aafbe7155e0d058689fe948acc5f3cbdcc4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0a059aafbe7155e0d058689fe948acc5f3cbdcc4
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Jun 4 10:16:21 2009 +0200
wined3d: Check FBO compatibility after the fixups are applied.
---
dlls/wined3d/utils.c | 59 ++++++++++++++++++++++++++++++-------------------
1 files changed, 36 insertions(+), 23 deletions(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index e152337..e4c09c8 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -420,6 +420,40 @@ static BOOL check_fbo_compat(const WineD3D_GL_Info *gl_info, GLint internal_form
return status == GL_FRAMEBUFFER_COMPLETE_EXT;
}
+static void init_format_fbo_compat_info(WineD3D_GL_Info *gl_info)
+{
+ unsigned int i;
+
+ for (i = 0; i < sizeof(formats) / sizeof(*formats); ++i)
+ {
+ struct GlPixelFormatDesc *desc = &gl_info->gl_formats[i];
+
+ if (!desc->glInternal) continue;
+
+ if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && desc->rtInternal)
+ {
+ /* Check if the default internal format is supported as a frame buffer target, otherwise
+ * fall back to the render target internal.
+ *
+ * Try to stick to the standard format if possible, this limits precision differences. */
+ if (check_fbo_compat(gl_info, desc->glInternal))
+ {
+ TRACE("Format %s is supported as fbo target\n", debug_d3dformat(desc->format));
+ desc->rtInternal = desc->glInternal;
+ }
+ else
+ {
+ TRACE("Internal format of %s not supported as FBO target, using render target internal instead\n",
+ debug_d3dformat(desc->format));
+ }
+ }
+ else
+ {
+ desc->rtInternal = desc->glInternal;
+ }
+ }
+}
+
static BOOL init_format_texture_info(WineD3D_GL_Info *gl_info)
{
unsigned int i;
@@ -439,34 +473,12 @@ static BOOL init_format_texture_info(WineD3D_GL_Info *gl_info)
desc = &gl_info->gl_formats[fmt_idx];
desc->glInternal = gl_formats_template[i].glInternal;
desc->glGammaInternal = gl_formats_template[i].glGammaInternal;
+ desc->rtInternal = gl_formats_template[i].rtInternal;
desc->glFormat = gl_formats_template[i].glFormat;
desc->glType = gl_formats_template[i].glType;
desc->color_fixup = COLOR_FIXUP_IDENTITY;
desc->Flags |= gl_formats_template[i].Flags;
desc->heightscale = 1.0;
-
- if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && gl_formats_template[i].rtInternal)
- {
- /* Check if the default internal format is supported as a frame buffer target, otherwise
- * fall back to the render target internal.
- *
- * Try to stick to the standard format if possible, this limits precision differences */
- if (!check_fbo_compat(gl_info, gl_formats_template[i].glInternal))
- {
- TRACE("Internal format of %s not supported as FBO target, using render target internal instead\n",
- debug_d3dformat(gl_formats_template[i].fmt));
- desc->rtInternal = gl_formats_template[i].rtInternal;
- }
- else
- {
- TRACE("Format %s is supported as fbo target\n", debug_d3dformat(gl_formats_template[i].fmt));
- desc->rtInternal = gl_formats_template[i].glInternal;
- }
- }
- else
- {
- desc->rtInternal = gl_formats_template[i].glInternal;
- }
}
return TRUE;
@@ -670,6 +682,7 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info)
}
apply_format_fixups(gl_info);
+ init_format_fbo_compat_info(gl_info);
return TRUE;
}
More information about the wine-cvs
mailing list