Henri Verbeet : wined3d: Move the "active_texture" field from struct wined3d_context to struct wined3d_context_gl.

Alexandre Julliard julliard at winehq.org
Wed Jun 5 16:12:40 CDT 2019


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

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

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

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

---

 dlls/wined3d/context.c         | 4 ++--
 dlls/wined3d/texture.c         | 4 ++--
 dlls/wined3d/view.c            | 6 +++---
 dlls/wined3d/wined3d_private.h | 3 ++-
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 7988eb6..8600361 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2520,7 +2520,7 @@ void wined3d_context_gl_active_texture(struct wined3d_context_gl *context_gl,
 {
     GL_EXTCALL(glActiveTexture(GL_TEXTURE0 + unit));
     checkGLcall("glActiveTexture");
-    context_gl->c.active_texture = unit;
+    context_gl->active_texture = unit;
 }
 
 void context_bind_bo(struct wined3d_context *context, GLenum binding, GLuint name)
@@ -2545,7 +2545,7 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLen
     else
         target = GL_NONE;
 
-    unit = context_gl->c.active_texture;
+    unit = context_gl->active_texture;
     old_texture_type = context_gl->texture_type[unit];
     if (old_texture_type != target)
     {
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index e3d9d54..beda900 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1061,9 +1061,9 @@ void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl,
      * called from sampler() in state.c. This means we can't touch anything
      * other than whatever happens to be the currently active texture, or we
      * would risk marking already applied sampler states dirty again. */
-    if (context_gl->c.active_texture < ARRAY_SIZE(context_gl->rev_tex_unit_map))
+    if (context_gl->active_texture < ARRAY_SIZE(context_gl->rev_tex_unit_map))
     {
-        unsigned int active_sampler = context_gl->rev_tex_unit_map[context_gl->c.active_texture];
+        unsigned int active_sampler = context_gl->rev_tex_unit_map[context_gl->active_texture];
         if (active_sampler != WINED3D_UNMAPPED_STAGE)
             context_invalidate_state(&context_gl->c, STATE_SAMPLER(active_sampler));
     }
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 1d61d09..b43dcdd 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -858,9 +858,9 @@ void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl
 static void shader_resource_view_gl_bind_and_dirtify(struct wined3d_shader_resource_view_gl *view_gl,
         struct wined3d_context_gl *context_gl)
 {
-    if (context_gl->c.active_texture < ARRAY_SIZE(context_gl->rev_tex_unit_map))
+    if (context_gl->active_texture < ARRAY_SIZE(context_gl->rev_tex_unit_map))
     {
-        unsigned int active_sampler = context_gl->rev_tex_unit_map[context_gl->c.active_texture];
+        unsigned int active_sampler = context_gl->rev_tex_unit_map[context_gl->active_texture];
         if (active_sampler != WINED3D_UNMAPPED_STAGE)
             context_invalidate_state(&context_gl->c, STATE_SAMPLER(active_sampler));
     }
@@ -912,7 +912,7 @@ void shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *
     }
 
     if (gl_info->supported[ARB_SAMPLER_OBJECTS])
-        GL_EXTCALL(glBindSampler(context->active_texture, 0));
+        GL_EXTCALL(glBindSampler(context_gl->active_texture, 0));
     gl_tex = wined3d_texture_gl_get_gl_texture(texture_gl, srgb);
     if (context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)
     {
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ec40e3b..4eddc55 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1946,7 +1946,6 @@ struct wined3d_context
     GLenum                  untracked_materials[2];
     UINT                    blit_w, blit_h;
     enum fogsource          fog_source;
-    DWORD active_texture;
 
     UINT instance_count;
 
@@ -1983,6 +1982,8 @@ struct wined3d_context_gl
 
     uint32_t default_attrib_value_set;
 
+    unsigned int active_texture;
+
     GLenum *texture_type;
 
     /* The WGL context. */




More information about the wine-cvs mailing list