wined3d: Surfaces always have a container in surface_bind().
This commit is contained in:
parent
96fbf9fed3
commit
32fb4e45eb
|
@ -604,48 +604,12 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void surface_bind(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb)
|
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);
|
TRACE("surface %p, context %p, srgb %#x.\n", surface, context, srgb);
|
||||||
|
|
||||||
if (surface->container)
|
TRACE("Passing to container (%p).\n", texture);
|
||||||
{
|
texture->texture_ops->texture_bind(texture, context, srgb);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
|
|
Loading…
Reference in New Issue