[PATCH 4/5] wined3d: Surfaces always have a container in surface_bind().
Henri Verbeet
hverbeet at codeweavers.com
Mon Nov 18 03:46:19 CST 2013
---
dlls/wined3d/surface.c | 44 ++++----------------------------------------
1 file 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. */
--
1.7.10.4
More information about the wine-patches
mailing list