Henri Verbeet : wined3d: Surfaces always have a container in surface_bind() .
Alexandre Julliard
julliard at winehq.org
Mon Nov 18 14:51:39 CST 2013
Module: wine
Branch: master
Commit: 32fb4e45eb8e04db1ed3cb52c08e73636e6c3155
URL: http://source.winehq.org/git/wine.git/?a=commit;h=32fb4e45eb8e04db1ed3cb52c08e73636e6c3155
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Mon Nov 18 10:46:19 2013 +0100
wined3d: Surfaces always have a container in surface_bind().
---
dlls/wined3d/surface.c | 44 ++++----------------------------------------
1 files changed, 4 insertions(+), 40 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index bc97ac7..9780a31 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)
{
- TRACE("surface %p, context %p, srgb %#x.\n", surface, context, srgb);
-
- if (surface->container)
- {
- struct wined3d_texture *texture = 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);
+ TRACE("surface %p, context %p, srgb %#x.\n", surface, context, srgb);
- 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. */
More information about the wine-cvs
mailing list