diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index bc97ac70f5b..9780a317d09 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -604,48 +604,12 @@ static void surface_evict_sysmem(struct wined3d_surface *surface) /* Context activation is done by the caller. */ static void surface_bind(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) { + struct wined3d_texture *texture = surface->container; + TRACE("surface %p, context %p, srgb %#x.\n", surface, context, srgb); - if (surface->container) - { - struct wined3d_texture *texture = surface->container; - - TRACE("Passing to container (%p).\n", texture); - texture->texture_ops->texture_bind(texture, context, srgb); - } - else - { - const struct wined3d_gl_info *gl_info = context->gl_info; - - if (surface->texture_level) - { - ERR("Standalone surface %p is non-zero texture level %u.\n", - surface, surface->texture_level); - } - - if (srgb) - ERR("Trying to bind standalone surface %p as sRGB.\n", surface); - - if (!surface->texture_name) - { - gl_info->gl_ops.gl.p_glGenTextures(1, &surface->texture_name); - checkGLcall("glGenTextures"); - - TRACE("Surface %p given name %u.\n", surface, surface->texture_name); - - context_bind_texture(context, surface->texture_target, surface->texture_name); - gl_info->gl_ops.gl.p_glTexParameteri(surface->texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - gl_info->gl_ops.gl.p_glTexParameteri(surface->texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - gl_info->gl_ops.gl.p_glTexParameteri(surface->texture_target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - gl_info->gl_ops.gl.p_glTexParameteri(surface->texture_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - gl_info->gl_ops.gl.p_glTexParameteri(surface->texture_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - checkGLcall("glTexParameteri"); - } - else - { - context_bind_texture(context, surface->texture_target, surface->texture_name); - } - } + TRACE("Passing to container (%p).\n", texture); + texture->texture_ops->texture_bind(texture, context, srgb); } /* Context activation is done by the caller. */