Commit 5fcffb10 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass a wined3d_context_gl structure to wined3d_texture_gl_bind().

parent 6811cc64
...@@ -3617,7 +3617,7 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state ...@@ -3617,7 +3617,7 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
wined3d_sampler_desc_from_sampler_states(&desc, context, sampler_states, texture_gl); wined3d_sampler_desc_from_sampler_states(&desc, context, sampler_states, texture_gl);
wined3d_texture_gl_bind(texture_gl, context, srgb); wined3d_texture_gl_bind(texture_gl, context_gl, srgb);
if ((entry = wine_rb_get(&device->samplers, &desc))) if ((entry = wine_rb_get(&device->samplers, &desc)))
{ {
......
...@@ -934,18 +934,17 @@ void wined3d_gl_texture_swizzle_from_color_fixup(GLint swizzle[4], struct color_ ...@@ -934,18 +934,17 @@ void wined3d_gl_texture_swizzle_from_color_fixup(GLint swizzle[4], struct color_
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
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) struct wined3d_context_gl *context_gl, BOOL srgb)
{ {
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
const struct wined3d_format *format = texture_gl->t.resource.format; const struct wined3d_format *format = texture_gl->t.resource.format;
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
const struct color_fixup_desc fixup = format->color_fixup; const struct color_fixup_desc fixup = format->color_fixup;
const struct wined3d_gl_info *gl_info = context->gl_info;
struct gl_texture *gl_tex; struct gl_texture *gl_tex;
GLenum target; GLenum target;
TRACE("texture_gl %p, context %p, srgb %#x.\n", texture_gl, context, srgb); TRACE("texture_gl %p, context_gl %p, srgb %#x.\n", texture_gl, context_gl, srgb);
if (!needs_separate_srgb_gl_texture(context, &texture_gl->t)) if (!needs_separate_srgb_gl_texture(&context_gl->c, &texture_gl->t))
srgb = FALSE; srgb = FALSE;
/* sRGB mode cache for preload() calls outside drawprim. */ /* sRGB mode cache for preload() calls outside drawprim. */
...@@ -988,7 +987,7 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl, ...@@ -988,7 +987,7 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl,
gl_tex->sampler_desc.max_anisotropy = 1; gl_tex->sampler_desc.max_anisotropy = 1;
gl_tex->sampler_desc.compare = FALSE; gl_tex->sampler_desc.compare = FALSE;
gl_tex->sampler_desc.comparison_func = WINED3D_CMP_LESSEQUAL; gl_tex->sampler_desc.comparison_func = WINED3D_CMP_LESSEQUAL;
if (context->gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
gl_tex->sampler_desc.srgb_decode = TRUE; gl_tex->sampler_desc.srgb_decode = TRUE;
else else
gl_tex->sampler_desc.srgb_decode = srgb; gl_tex->sampler_desc.srgb_decode = srgb;
...@@ -1046,7 +1045,7 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl, ...@@ -1046,7 +1045,7 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl,
checkGLcall("glTexParameteri(GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY)"); checkGLcall("glTexParameteri(GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY)");
} }
if (!is_identity_fixup(fixup) && can_use_texture_swizzle(context->d3d_info, format)) if (!is_identity_fixup(fixup) && can_use_texture_swizzle(context_gl->c.d3d_info, format))
{ {
GLint swizzle[4]; GLint swizzle[4];
...@@ -1080,7 +1079,7 @@ void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl, ...@@ -1080,7 +1079,7 @@ void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl,
context_invalidate_compute_state(&context_gl->c, STATE_COMPUTE_SHADER_RESOURCE_BINDING); context_invalidate_compute_state(&context_gl->c, STATE_COMPUTE_SHADER_RESOURCE_BINDING);
context_invalidate_state(&context_gl->c, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); context_invalidate_state(&context_gl->c, STATE_GRAPHICS_SHADER_RESOURCE_BINDING);
wined3d_texture_gl_bind(texture_gl, &context_gl->c, srgb); wined3d_texture_gl_bind(texture_gl, context_gl, srgb);
} }
/* Context activation is done by the caller (state handler). */ /* Context activation is done by the caller (state handler). */
......
...@@ -850,7 +850,7 @@ void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl ...@@ -850,7 +850,7 @@ void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl
} }
texture_gl = wined3d_texture_gl(wined3d_texture_from_resource(view_gl->v.resource)); texture_gl = wined3d_texture_gl(wined3d_texture_from_resource(view_gl->v.resource));
wined3d_texture_gl_bind(texture_gl, context, FALSE); wined3d_texture_gl_bind(texture_gl, context_gl, FALSE);
wined3d_sampler_bind(sampler, unit, texture_gl, context); wined3d_sampler_bind(sampler, unit, texture_gl, context);
} }
......
...@@ -3620,7 +3620,7 @@ static inline GLenum wined3d_texture_gl_get_sub_resource_target(const struct win ...@@ -3620,7 +3620,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_gl *context_gl) 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_gl *context_gl, 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,
struct wined3d_context_gl *context_gl, BOOL srgb) DECLSPEC_HIDDEN; struct wined3d_context_gl *context_gl, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_gl_prepare_texture(struct wined3d_texture_gl *texture_gl, void wined3d_texture_gl_prepare_texture(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