wined3d: Get rid of the location fixup for ORM_FBO in surface_load_location().
This commit is contained in:
parent
98277e1fc6
commit
68a5305dfd
@ -5908,6 +5908,12 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface,
|
|||||||
UINT byte_count;
|
UINT byte_count;
|
||||||
BYTE *mem;
|
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)
|
if (wined3d_settings.rendertargetlock_mode == RTL_READTEX)
|
||||||
surface_load_location(surface, SFLAG_INTEXTURE, NULL);
|
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;
|
struct wined3d_device *device = surface->resource.device;
|
||||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||||
BOOL in_fbo = FALSE;
|
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("surface %p, location %s, rect %s.\n", surface, debug_surflocation(location), wine_dbgstr_rect(rect));
|
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])
|
if (location == SFLAG_INSRGBTEX && gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
|
||||||
location = SFLAG_INTEXTURE;
|
location = SFLAG_INTEXTURE;
|
||||||
|
|
||||||
@ -6231,12 +6220,6 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location, c
|
|||||||
surface_evict_sysmem(surface);
|
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)
|
if (surface->flags & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX)
|
||||||
&& gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
|
&& gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user