[PATCH 3/5] wined3d: Pass a wined3d_context_gl structure to wined3d_texture_gl_apply_sampler_desc().
Henri Verbeet
hverbeet at codeweavers.com
Wed Jun 12 06:29:33 CDT 2019
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
dlls/wined3d/sampler.c | 3 ++-
dlls/wined3d/texture.c | 8 ++++----
dlls/wined3d/wined3d_private.h | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c
index 6e45f0e4b4e..8c3a94766a5 100644
--- a/dlls/wined3d/sampler.c
+++ b/dlls/wined3d/sampler.c
@@ -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,
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;
if (gl_info->supported[ARB_SAMPLER_OBJECTS])
@@ -193,7 +194,7 @@ void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit,
}
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
{
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 8b27e59bc30..da646ceee4a 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -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). */
/* This function relies on the correct texture being bound and loaded. */
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;
struct gl_texture *gl_tex;
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);
@@ -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
- && (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->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9617a44b32d..74ad31ee137 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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,
- 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,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl,
--
2.11.0
More information about the wine-devel
mailing list