wined3d: Simplify context_apply_attachment_filter_states() flow a bit.

This commit is contained in:
Henri Verbeet 2010-03-16 19:02:17 +01:00 committed by Alexandre Julliard
parent ec10c1ed8d
commit 2b86950c3b
1 changed files with 31 additions and 26 deletions

View File

@ -116,15 +116,16 @@ static void context_destroy_fbo(struct wined3d_context *context, GLuint *fbo)
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void context_apply_attachment_filter_states(IWineD3DSurface *surface) static void context_apply_attachment_filter_states(IWineD3DSurface *surface)
{ {
const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface;
IWineD3DDeviceImpl *device = surface_impl->resource.device;
IWineD3DBaseTextureImpl *texture_impl; IWineD3DBaseTextureImpl *texture_impl;
BOOL update_minfilter = FALSE;
BOOL update_magfilter = FALSE;
/* Update base texture states array */ /* Update base texture states array */
if (SUCCEEDED(IWineD3DSurface_GetContainer(surface, &IID_IWineD3DBaseTexture, (void **)&texture_impl))) if (SUCCEEDED(IWineD3DSurface_GetContainer(surface, &IID_IWineD3DBaseTexture, (void **)&texture_impl)))
{ {
IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface;
IWineD3DDeviceImpl *device = surface_impl->resource.device;
BOOL update_minfilter = FALSE;
BOOL update_magfilter = FALSE;
if (texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MINFILTER] != WINED3DTEXF_POINT if (texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MINFILTER] != WINED3DTEXF_POINT
|| texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MIPFILTER] != WINED3DTEXF_NONE) || texture_impl->baseTexture.texture_rgb.states[WINED3DTEXSTA_MIPFILTER] != WINED3DTEXF_NONE)
{ {
@ -146,7 +147,6 @@ static void context_apply_attachment_filter_states(IWineD3DSurface *surface)
} }
IWineD3DBaseTexture_Release((IWineD3DBaseTexture *)texture_impl); IWineD3DBaseTexture_Release((IWineD3DBaseTexture *)texture_impl);
}
if (update_minfilter || update_magfilter) if (update_minfilter || update_magfilter)
{ {
@ -158,10 +158,14 @@ static void context_apply_attachment_filter_states(IWineD3DSurface *surface)
{ {
bind_target = GL_TEXTURE_2D; bind_target = GL_TEXTURE_2D;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding); glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding);
} else if (target == GL_TEXTURE_RECTANGLE_ARB) { }
else if (target == GL_TEXTURE_RECTANGLE_ARB)
{
bind_target = GL_TEXTURE_RECTANGLE_ARB; bind_target = GL_TEXTURE_RECTANGLE_ARB;
glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding); glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding);
} else { }
else
{
bind_target = GL_TEXTURE_CUBE_MAP_ARB; bind_target = GL_TEXTURE_CUBE_MAP_ARB;
glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARB, &old_binding); glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARB, &old_binding);
} }
@ -174,6 +178,7 @@ static void context_apply_attachment_filter_states(IWineD3DSurface *surface)
checkGLcall("apply_attachment_filter_states()"); checkGLcall("apply_attachment_filter_states()");
} }
}
/* GL locking is done by the caller */ /* GL locking is done by the caller */
void context_attach_depth_stencil_fbo(struct wined3d_context *context, void context_attach_depth_stencil_fbo(struct wined3d_context *context,