Henri Verbeet : wined3d: Pass a wined3d_context_gl structure to wined3d_texture_gl_bind().

Alexandre Julliard julliard at winehq.org
Wed Jun 12 16:44:25 CDT 2019


Module: wine
Branch: master
Commit: 5fcffb10f7f9dad3dc1dc57683ab80c35629a4b6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5fcffb10f7f9dad3dc1dc57683ab80c35629a4b6

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Jun 12 16:17:34 2019 +0430

wined3d: Pass a wined3d_context_gl structure to wined3d_texture_gl_bind().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/state.c           |  2 +-
 dlls/wined3d/texture.c         | 15 +++++++--------
 dlls/wined3d/view.c            |  2 +-
 dlls/wined3d/wined3d_private.h |  2 +-
 4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 1e13557..d87f608 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -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_texture_gl_bind(texture_gl, context, srgb);
+        wined3d_texture_gl_bind(texture_gl, context_gl, srgb);
 
         if ((entry = wine_rb_get(&device->samplers, &desc)))
         {
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index da646ce..d3c58cb 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -934,18 +934,17 @@ void wined3d_gl_texture_swizzle_from_color_fixup(GLint swizzle[4], struct color_
 
 /* Context activation is done by the caller. */
 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_gl_info *gl_info = context_gl->c.gl_info;
     const struct color_fixup_desc fixup = format->color_fixup;
-    const struct wined3d_gl_info *gl_info = context->gl_info;
     struct gl_texture *gl_tex;
     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 mode cache for preload() calls outside drawprim. */
@@ -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.compare = FALSE;
     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;
     else
         gl_tex->sampler_desc.srgb_decode = srgb;
@@ -1046,7 +1045,7 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl,
         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];
 
@@ -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_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). */
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index e0ac57e..06e24fb 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -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));
-    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);
 }
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 74ad31e..91570ed 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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,
         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;
+        struct wined3d_context_gl *context_gl, BOOL srgb) DECLSPEC_HIDDEN;
 void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl,
         struct wined3d_context_gl *context_gl, BOOL srgb) DECLSPEC_HIDDEN;
 void wined3d_texture_gl_prepare_texture(struct wined3d_texture_gl *texture_gl,




More information about the wine-cvs mailing list