[PATCH 02/10] wined3d: Get rid of the location fixup for ORM_FBO in surface_load_location().
Henri Verbeet
hverbeet at codeweavers.com
Thu Aug 25 14:04:56 CDT 2011
---
dlls/wined3d/surface.c | 29 ++++++-----------------------
1 files changed, 6 insertions(+), 23 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 75e39fc..c880e6e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -5908,6 +5908,12 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
UINT byte_count;
BYTE *mem;
+ if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && surface_is_offscreen(surface))
+ {
+ ERR("Trying to load offscreen surface into SFLAG_INDRAWABLE.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
if (wined3d_settings.rendertargetlock_mode == RTL_READTEX)
surface_load_location(surface, SFLAG_INTEXTURE, NULL);
@@ -6140,7 +6146,6 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location, c
{
struct wined3d_device *device = surface->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
- BOOL in_fbo = FALSE;
HRESULT hr;
TRACE("surface %p, location %s, rect %s.\n", surface, debug_surflocation(location), wine_dbgstr_rect(rect));
@@ -6161,22 +6166,6 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location, c
}
}
- if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
- {
- if (surface_is_offscreen(surface))
- {
- /* With ORM_FBO, SFLAG_INTEXTURE and SFLAG_INDRAWABLE are the same
- * for offscreen targets. Prefer SFLAG_INTEXTURE. */
- if (location == SFLAG_INDRAWABLE)
- location = SFLAG_INTEXTURE;
- in_fbo = TRUE;
- }
- else
- {
- TRACE("Surface %p is an onscreen surface.\n", surface);
- }
- }
-
if (location == SFLAG_INSRGBTEX && gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
location = SFLAG_INTEXTURE;
@@ -6231,12 +6220,6 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location, c
surface_evict_sysmem(surface);
}
- if (in_fbo && (surface->flags & (SFLAG_INTEXTURE | SFLAG_INDRAWABLE)))
- {
- /* With ORM_FBO, SFLAG_INTEXTURE and SFLAG_INDRAWABLE are the same for offscreen targets. */
- surface->flags |= (SFLAG_INTEXTURE | SFLAG_INDRAWABLE);
- }
-
if (surface->flags & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX)
&& gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
{
--
1.7.3.4
More information about the wine-patches
mailing list