Commit 6811cc64 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass a wined3d_context_gl structure to wined3d_texture_gl_apply_sampler_desc().

parent ed9a6a2d
...@@ -184,6 +184,7 @@ static void texture_gl_apply_base_level(struct wined3d_texture_gl *texture_gl, ...@@ -184,6 +184,7 @@ static void texture_gl_apply_base_level(struct wined3d_texture_gl *texture_gl,
void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit, void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit,
struct wined3d_texture_gl *texture_gl, const struct wined3d_context *context) struct wined3d_texture_gl *texture_gl, const struct wined3d_context *context)
{ {
const struct wined3d_context_gl *context_gl = wined3d_context_gl_const(context);
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
if (gl_info->supported[ARB_SAMPLER_OBJECTS]) if (gl_info->supported[ARB_SAMPLER_OBJECTS])
...@@ -193,7 +194,7 @@ void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit, ...@@ -193,7 +194,7 @@ void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit,
} }
else if (texture_gl) else if (texture_gl)
{ {
wined3d_texture_gl_apply_sampler_desc(texture_gl, &sampler->desc, context); wined3d_texture_gl_apply_sampler_desc(texture_gl, &sampler->desc, context_gl);
} }
else else
{ {
......
...@@ -1086,14 +1086,14 @@ void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl, ...@@ -1086,14 +1086,14 @@ void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl,
/* Context activation is done by the caller (state handler). */ /* Context activation is done by the caller (state handler). */
/* This function relies on the correct texture being bound and loaded. */ /* This function relies on the correct texture being bound and loaded. */
void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl, void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl,
const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context *context) const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context_gl *context_gl)
{ {
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
GLenum target = texture_gl->target; GLenum target = texture_gl->target;
struct gl_texture *gl_tex; struct gl_texture *gl_tex;
DWORD state; DWORD state;
TRACE("texture_gl %p, sampler_desc %p, context %p.\n", texture_gl, sampler_desc, context); TRACE("texture_gl %p, sampler_desc %p, context_gl %p.\n", texture_gl, sampler_desc, context_gl);
gl_tex = wined3d_texture_gl_get_gl_texture(texture_gl, texture_gl->t.flags & WINED3D_TEXTURE_IS_SRGB); gl_tex = wined3d_texture_gl_get_gl_texture(texture_gl, texture_gl->t.flags & WINED3D_TEXTURE_IS_SRGB);
...@@ -1156,7 +1156,7 @@ void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl ...@@ -1156,7 +1156,7 @@ void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl
} }
if (!sampler_desc->srgb_decode != !gl_tex->sampler_desc.srgb_decode if (!sampler_desc->srgb_decode != !gl_tex->sampler_desc.srgb_decode
&& (context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL) && (context_gl->c.d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)
&& gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) && gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
{ {
gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
......
...@@ -3618,7 +3618,7 @@ static inline GLenum wined3d_texture_gl_get_sub_resource_target(const struct win ...@@ -3618,7 +3618,7 @@ static inline GLenum wined3d_texture_gl_get_sub_resource_target(const struct win
} }
void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl, void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl,
const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context *context) DECLSPEC_HIDDEN; const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl, void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl, void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl,
......
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