Commit c5b09fd2 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Move the "texture_type" field from struct wined3d_context to struct wined3d_context_gl.

parent ad5a448d
...@@ -1478,12 +1478,12 @@ void wined3d_context_cleanup(struct wined3d_context *context) ...@@ -1478,12 +1478,12 @@ void wined3d_context_cleanup(struct wined3d_context *context)
DWORD err = GetLastError(); DWORD err = GetLastError();
ERR("wglDeleteContext(%p) failed, last error %#x.\n", context->glCtx, err); ERR("wglDeleteContext(%p) failed, last error %#x.\n", context->glCtx, err);
} }
heap_free(context->texture_type);
} }
void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl)
{ {
heap_free(context_gl->texture_type);
wined3d_context_cleanup(&context_gl->c); wined3d_context_cleanup(&context_gl->c);
} }
...@@ -2009,8 +2009,8 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi ...@@ -2009,8 +2009,8 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
} }
} }
if (!(context->texture_type = heap_calloc(gl_info->limits.combined_samplers, if (!(context_gl->texture_type = heap_calloc(gl_info->limits.combined_samplers,
sizeof(*context->texture_type)))) sizeof(*context_gl->texture_type))))
return E_FAIL; return E_FAIL;
target = &context->current_rt.texture->resource; target = &context->current_rt.texture->resource;
...@@ -2093,7 +2093,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi ...@@ -2093,7 +2093,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
{ {
ERR("Failed to set pixel format %d on device context %p.\n", context->pixel_format, context->hdc); ERR("Failed to set pixel format %d on device context %p.\n", context->pixel_format, context->hdc);
context_release(context); context_release(context);
heap_free(context->texture_type); heap_free(context_gl->texture_type);
return E_FAIL; return E_FAIL;
} }
...@@ -2103,7 +2103,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi ...@@ -2103,7 +2103,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
if (!(ctx = context_create_wgl_attribs(gl_info, context->hdc, share_ctx))) if (!(ctx = context_create_wgl_attribs(gl_info, context->hdc, share_ctx)))
{ {
context_release(context); context_release(context);
heap_free(context->texture_type); heap_free(context_gl->texture_type);
return E_FAIL; return E_FAIL;
} }
} }
...@@ -2113,7 +2113,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi ...@@ -2113,7 +2113,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
{ {
ERR("Failed to create a WGL context.\n"); ERR("Failed to create a WGL context.\n");
context_release(context); context_release(context);
heap_free(context->texture_type); heap_free(context_gl->texture_type);
return E_FAIL; return E_FAIL;
} }
...@@ -2123,7 +2123,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi ...@@ -2123,7 +2123,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
context_release(context); context_release(context);
if (!wglDeleteContext(ctx)) if (!wglDeleteContext(ctx))
ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, GetLastError()); ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, GetLastError());
heap_free(context->texture_type); heap_free(context_gl->texture_type);
return E_FAIL; return E_FAIL;
} }
} }
...@@ -2143,7 +2143,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi ...@@ -2143,7 +2143,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
context_release(context); context_release(context);
if (!wglDeleteContext(ctx)) if (!wglDeleteContext(ctx))
ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, GetLastError()); ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, GetLastError());
heap_free(context->texture_type); heap_free(context_gl->texture_type);
return E_FAIL; return E_FAIL;
} }
...@@ -2541,7 +2541,7 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLen ...@@ -2541,7 +2541,7 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLen
target = GL_NONE; target = GL_NONE;
unit = context_gl->c.active_texture; unit = context_gl->c.active_texture;
old_texture_type = context_gl->c.texture_type[unit]; old_texture_type = context_gl->texture_type[unit];
if (old_texture_type != target) if (old_texture_type != target)
{ {
switch (old_texture_type) switch (old_texture_type)
...@@ -2586,7 +2586,7 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLen ...@@ -2586,7 +2586,7 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLen
ERR("Unexpected texture target %#x.\n", old_texture_type); ERR("Unexpected texture target %#x.\n", old_texture_type);
} }
context_gl->c.texture_type[unit] = target; context_gl->texture_type[unit] = target;
} }
checkGLcall("bind texture"); checkGLcall("bind texture");
......
...@@ -1954,7 +1954,6 @@ struct wined3d_context ...@@ -1954,7 +1954,6 @@ struct wined3d_context
UINT blit_w, blit_h; UINT blit_w, blit_h;
enum fogsource fog_source; enum fogsource fog_source;
DWORD active_texture; DWORD active_texture;
DWORD *texture_type;
UINT instance_count; UINT instance_count;
...@@ -2038,6 +2037,8 @@ HRESULT wined3d_context_no3d_init(struct wined3d_context *context_no3d, ...@@ -2038,6 +2037,8 @@ HRESULT wined3d_context_no3d_init(struct wined3d_context *context_no3d,
struct wined3d_context_gl struct wined3d_context_gl
{ {
struct wined3d_context c; struct wined3d_context c;
GLenum *texture_type;
}; };
static inline struct wined3d_context_gl *wined3d_context_gl(struct wined3d_context *context) static inline struct wined3d_context_gl *wined3d_context_gl(struct wined3d_context *context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment