Commit 4817a650 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Preload resources before FBO setup.

parent f7760656
......@@ -2110,6 +2110,14 @@ void context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImp
const struct StateEntry *state_table = device->StateTable;
unsigned int i;
/* Preload resources before FBO setup. Texture preload in particular may
* result in changes to the current FBO, due to using e.g. FBO blits for
* updating a resource location. */
IWineD3DDeviceImpl_FindTexUnitMap(device);
device_preload_textures(device);
if (isStateDirty(context, STATE_VDECL))
device_update_stream_info(device, context->gl_info);
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
{
context_validate_onscreen_formats(device, context, device->depth_stencil);
......@@ -2139,11 +2147,6 @@ void context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImp
device->frag_pipe->enable_extension((IWineD3DDevice *)device, TRUE);
}
IWineD3DDeviceImpl_FindTexUnitMap(device);
device_preload_textures(device);
if (isStateDirty(context, STATE_VDECL))
device_update_stream_info(device, context->gl_info);
ENTER_GL();
for (i = 0; i < context->numDirtyEntries; ++i)
{
......
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